]> granicus.if.org Git - curl/commitdiff
fixed the basename() replacement, reported by Gisle
authorDaniel Stenberg <daniel@haxx.se>
Fri, 1 Oct 2004 11:20:38 +0000 (11:20 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 1 Oct 2004 11:20:38 +0000 (11:20 +0000)
lib/formdata.c

index 798303d3ab8b47822a4d3e2297c513a745ffee75..affaf4b6d2765cf82bae7122012248d0c14778cf 100644 (file)
@@ -944,9 +944,10 @@ char *basename(char *path)
   if(s1 && s2) {
     path = (s1 > s2? s1 : s2)+1;
   }
-  else {
-    path = (s1 ? s1 : s2)+1;
-  }
+  else if(s1)
+    path = s1 + 1;
+  else if(s2)
+    path = s1 + 1;
 
   return path;
 }