apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r424831 - /apr/apr/trunk/test/testnames.c
Date Sun, 23 Jul 2006 21:45:55 GMT
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);



Mime
View raw message