diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-10-01 11:20:38 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-10-01 11:20:38 +0000 |
commit | ec4da97a35fb285c4316f8b4017f84cba5d494b7 (patch) | |
tree | dd435106089f65d6421902cadd5f2581783a2c64 | |
parent | bb48ccedd7c8eb9eeab1d4d900f011ebdda1eb4b (diff) |
fixed the basename() replacement, reported by Gisle
-rw-r--r-- | lib/formdata.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/formdata.c b/lib/formdata.c index 798303d3a..affaf4b6d 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -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; } |