]> granicus.if.org Git - apache/commitdiff
As I understand it, this test is supposed to read like so:
authorCliff Woolley <jwoolley@apache.org>
Fri, 31 Aug 2001 05:05:58 +0000 (05:05 +0000)
committerCliff Woolley <jwoolley@apache.org>
Fri, 31 Aug 2001 05:05:58 +0000 (05:05 +0000)
----------------------------------------------------
if the base paths are the same
    if (strncmp(rnew->filename, fdir, fdirlen) == 0

and there's more stuff in the new filename than just the base path
        && rnew->filename[fdirlen]

and that stuff contains no slashes
        && ap_strchr_c(rnew->filename + fdirlen, '/') == NULL)
----------------------------------------------------

Assuming that's a correct translation, which I believe to be the case
(and which also seems to jive with the previous version of the test),
then that first part darned well better check == 0, as opposed to != 0.
strncmp returns 0 when they match.  =-)

And voila,
"All tests successful, 1 test skipped."
is the result from httpd-test

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90842 13f79535-47bb-0310-9956-ffa450edef68

server/request.c

index 20a75b10ac4d5aaa9966843ea7dc264eb0ff8ac3..b56471563531820120004cde8d0ba66aa7dfdf7f 100644 (file)
@@ -1565,7 +1565,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
      * either, if the base paths match, we can pick up where we leave off.
      */
 
-    if (strncmp(rnew->filename, fdir, fdirlen) != 0
+    if (strncmp(rnew->filename, fdir, fdirlen) == 0
            && rnew->filename[fdirlen] 
            && ap_strchr_c(rnew->filename + fdirlen, '/') == NULL) 
     {