]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
glob tests: Improve maintainability.
authorBruno Haible <bruno@clisp.org>
Wed, 15 Oct 2025 13:01:55 +0000 (15:01 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Oct 2025 13:01:55 +0000 (15:01 +0200)
* tests/test-glob.c (main): Make the second added test independent from
the first one.

ChangeLog
tests/test-glob.c

index c8af7641b257e92d8898b1036aaff274be5333e4..56efbc382003932692374bf5906b2d8272c11850 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-10-15  Bruno Haible  <bruno@clisp.org>
+
+       glob tests: Improve maintainability.
+       * tests/test-glob.c (main): Make the second added test independent from
+       the first one.
+
 2025-10-14  Collin Funk  <collin.funk1@gmail.com>
 
        getdelim: Avoid the symbol __getdelim with ASAN (regr. 2025-10-13).
index 140a2b10f5ac05f4cb703253b1b2616a3d6c1d57..7b3439b6cd0f223abff5d13a3fca9bfcbe797f25 100644 (file)
@@ -110,12 +110,13 @@ main ()
       globfree (&g);
 
       /* "/*/////sh".  */
+      memset (pattern, '/', 9997);
       pattern[1] = '*';
-      pattern[9997] = 's';
-      pattern[9998] = 'h';
+      strcpy (pattern + 9997, "sh");
       res = glob (pattern, 0, NULL, &g);
       ASSERT (res == 0);
       globfree (&g);
+
       free (pattern);
     }