Peng Yu wrote:
Hi,

The following line is in utils.c.

# in acceptable (const char *s)

   while (l&&  s[l] != '/')
     --l;
   if (s[l] == '/')
     s += (l + 1);

It essentially gets a substring after the last '/'. However, when a
query has '/', this is problematic. For example, the above code snip
will extract '/xxy' instead of 'somescript?arg1=/xxy'. I think that
the above code should add the test of the position of '?'. If there is
a '?', it should look for the last '/' before '?'. Is it the case?

http://xxx.org/somescript?arg1=/xxy
Maybe not. Consider a url like:
http://www.example.net/download.php?file=releases/wget.exe

In that case using as filename wget.exe makes more sense than
download.php@file=releases%2Fwget.exe
Whereas there are other cases where the basename is preferible.
Probably all examples of a url with a slash in the query string are a
bit contrived.



Reply via email to