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/07/23 23:45:55 UTC

svn commit: r424831 - /apr/apr/trunk/test/testnames.c

Author: wrowe
Date: Sun Jul 23 14:45:55 2006
New Revision: 424831

URL: http://svn.apache.org/viewvc?rev=424831&view=rev
Log:

  From svn issue 1869, test for ../../../ as submitted, plus i've added
  the pattern ../../.. which breaks the reporter's assumptions about the
  fix.  Reviewing the bug now.

Submitted by: Lieven Govaerts <lgo mobsol.be>

Modified:
    apr/apr/trunk/test/testnames.c

Modified: apr/apr/trunk/test/testnames.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testnames.c?rev=424831&r1=424830&r2=424831&view=diff
==============================================================================
--- apr/apr/trunk/test/testnames.c (original)
+++ apr/apr/trunk/test/testnames.c Sun Jul 23 14:45:55 2006
@@ -91,6 +91,24 @@
     ABTS_STR_EQUAL(tc, "../test", dstpath);
 }
 
+static void merge_dotdot_dotdot_dotdot(abts_case *tc, void *data)
+{
+    apr_status_t rv;
+    char *dstpath = NULL;
+
+    rv = apr_filepath_merge(&dstpath, "", 
+                            "../../..", APR_FILEPATH_TRUENAME, p);
+    ABTS_PTR_NOTNULL(tc, dstpath);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    ABTS_STR_EQUAL(tc, "../../..", dstpath);
+
+    rv = apr_filepath_merge(&dstpath, "", 
+                            "../../../", APR_FILEPATH_TRUENAME, p);
+    ABTS_PTR_NOTNULL(tc, dstpath);
+    ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
+    ABTS_STR_EQUAL(tc, "../../../", dstpath);
+}
+
 static void merge_secure(abts_case *tc, void *data)
 {
     apr_status_t rv;
@@ -249,6 +267,7 @@
     abts_run_test(suite, merge_notrelfail, NULL);
     abts_run_test(suite, merge_notabs, NULL);
     abts_run_test(suite, merge_notabsfail, NULL);
+    abts_run_test(suite, merge_dotdot_dotdot_dotdot, NULL);
 
     abts_run_test(suite, root_absolute, NULL);
     abts_run_test(suite, root_relative, NULL);