apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r448483 - /apr/apr/branches/0.9.x/file_io/unix/filepath.c
Date Thu, 21 Sep 2006 07:43:55 GMT
Author: wrowe
Date: Thu Sep 21 00:43:54 2006
New Revision: 448483

URL: http://svn.apache.org/viewvc?view=rev&rev=448483
Log:
  Solve svn issue 1869, only one symptom on the Unix platform; when 
  a trailing .. element is present without a trailing slash, always
  avoid appending a trailing slash.
  Solved with hints from Lieven Govaerts <lgo mobsol.be>.

  Resolves test fail identified by test/testnames.c commit 424831

Backport: 448480

Modified:
    apr/apr/branches/0.9.x/file_io/unix/filepath.c

Modified: apr/apr/branches/0.9.x/file_io/unix/filepath.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/file_io/unix/filepath.c?view=diff&rev=448483&r1=448482&r2=448483
==============================================================================
--- apr/apr/branches/0.9.x/file_io/unix/filepath.c (original)
+++ apr/apr/branches/0.9.x/file_io/unix/filepath.c Thu Sep 21 00:43:54 2006
@@ -225,10 +225,11 @@
                     return APR_EABOVEROOT;
                 }
 
-                /* Otherwise append another backpath.
+                /* Otherwise append another backpath, including
+                 * trailing slash if present.
                  */
-                memcpy(path + pathlen, "../", 3);
-                pathlen += 3;
+                memcpy(path + pathlen, "../", *next ? 3 : 2);
+                pathlen += *next ? 3 : 2;
             }
             else {
                 /* otherwise crop the prior segment



Mime
View raw message