From: Daniel Stenberg Date: Fri, 1 Oct 2004 11:20:38 +0000 (+0000) Subject: fixed the basename() replacement, reported by Gisle X-Git-Tag: curl-7_12_2~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec4da97a35fb285c4316f8b4017f84cba5d494b7;p=thirdparty%2Fcurl.git fixed the basename() replacement, reported by Gisle --- diff --git a/lib/formdata.c b/lib/formdata.c index 798303d3ab..affaf4b6d2 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; }