You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2006/09/21 09:42:55 UTC

svn commit: r448481 - /apr/apr/branches/1.2.x/file_io/unix/filepath.c

Author: wrowe
Date: Thu Sep 21 00:42:54 2006
New Revision: 448481

URL: http://svn.apache.org/viewvc?view=rev&rev=448481
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/1.2.x/file_io/unix/filepath.c

Modified: apr/apr/branches/1.2.x/file_io/unix/filepath.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/file_io/unix/filepath.c?view=diff&rev=448481&r1=448480&r2=448481
==============================================================================
--- apr/apr/branches/1.2.x/file_io/unix/filepath.c (original)
+++ apr/apr/branches/1.2.x/file_io/unix/filepath.c Thu Sep 21 00:42: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