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 798303d..affaf4b 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;
 }