corrected basename()

This commit is contained in:
erikb 1986-12-08 08:58:21 +00:00
parent bdfa65a962
commit b9823c8daa

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