corrected basename()
This commit is contained in:
parent
8702a522d8
commit
ad5c92044c
1 changed files with 6 additions and 3 deletions
|
@ -586,10 +586,13 @@ basename(str, dst)
|
||||||
if (*p1++ == '/')
|
if (*p1++ == '/')
|
||||||
p2 = p1;
|
p2 = p1;
|
||||||
p1--;
|
p1--;
|
||||||
if (*--p1 == '.')
|
if (*--p1 == '.') {
|
||||||
*p1 = '\0';
|
*p1 = '\0';
|
||||||
while (*dst++ = *p2++) {}
|
while (*dst++ = *p2++) {}
|
||||||
*p1 = '.';
|
*p1 = '.';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
while (*dst++ = *p2++) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in a new issue