You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2022/08/17 16:06:44 UTC

svn commit: r1903497 - /httpd/apreq/trunk/library/t/util.c

Author: ylavic
Date: Wed Aug 17 16:06:44 2022
New Revision: 1903497

URL: http://svn.apache.org/viewvc?rev=1903497&view=rev
Log:
library/t/util: Fix attributes separator.

* library/t/util.c(test_header_attribute):
  Add missing separator between "name" and "filename" attributes.
  Axe the useless "hdr+4" trick.
  

Modified:
    httpd/apreq/trunk/library/t/util.c

Modified: httpd/apreq/trunk/library/t/util.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/util.c?rev=1903497&r1=1903496&r2=1903497&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/util.c (original)
+++ httpd/apreq/trunk/library/t/util.c Wed Aug 17 16:06:44 2022
@@ -270,16 +270,16 @@ static void test_file_mktemp(dAT, void *
 
 static void test_header_attribute(dAT, void *ctx)
 {
-    const char hdr[] = "filename=\"filename=foo\" filename=\"quux.txt\"";
+    const char hdr[] = "name=\"filename=foo\"; filename=\"quux.txt\"";
     const char *val;
     apr_size_t vlen;
 
-    AT_int_eq(apreq_header_attribute(hdr+4, "name", 4, &val, &vlen),
+    AT_int_eq(apreq_header_attribute(hdr, "name", 4, &val, &vlen),
               APR_SUCCESS);
     AT_int_eq(vlen, 12);
     AT_mem_eq("filename=foo", val, 12);
 
-    AT_int_eq(apreq_header_attribute(hdr+4, "filename", 8, &val, &vlen),
+    AT_int_eq(apreq_header_attribute(hdr, "filename", 8, &val, &vlen),
               APR_SUCCESS);
     AT_int_eq(vlen, 8);
     AT_mem_eq("quux.txt", val, 8);