corrected basename()

This commit is contained in:
erikb 1986-12-08 08:58:21 +00:00
parent 8702a522d8
commit ad5c92044c

View file

@ -586,10 +586,13 @@ basename(str, dst)
if (*p1++ == '/')
p2 = p1;
p1--;
if (*--p1 == '.')
if (*--p1 == '.') {
*p1 = '\0';
while (*dst++ = *p2++) {}
*p1 = '.';
while (*dst++ = *p2++) {}
*p1 = '.';
}
else
while (*dst++ = *p2++) {}
}
int