fixed the basename() replacement, reported by Gisle

This commit is contained in:
Daniel Stenberg 2004-10-01 11:20:38 +00:00
parent bb48ccedd7
commit ec4da97a35
1 changed files with 4 additions and 3 deletions

View File

@ -944,9 +944,10 @@ char *basename(char *path)
if(s1 && s2) { if(s1 && s2) {
path = (s1 > s2? s1 : s2)+1; path = (s1 > s2? s1 : s2)+1;
} }
else { else if(s1)
path = (s1 ? s1 : s2)+1; path = s1 + 1;
} else if(s2)
path = s1 + 1;
return path; return path;
} }