]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Inverted the boolean test from what I wanted it to be. Added a
authorPaul Smith <psmith@gnu.org>
Sat, 7 May 2011 14:36:11 +0000 (14:36 +0000)
committerPaul Smith <psmith@gnu.org>
Sat, 7 May 2011 14:36:11 +0000 (14:36 +0000)
regression test to make sure this continues to work.

ChangeLog
read.c
tests/ChangeLog
tests/scripts/functions/wildcard

index 25569451f9a412d0dd63297c569cadc950125eae..a8c865f80f8ef4550da7cb1e0a7f991937fae4e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-05-07  Paul Smith  <psmith@gnu.org>
+
+       * read.c (parse_file_seq): Ensure existence checks use glob().
+
 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
 
        * job.c (construct_command_argv_internal): Don't assume shellflags
diff --git a/read.c b/read.c
index 3f72326e7d537c585c1ef9da0c8566f7b461aa6d..c87d4a7f47603e8329eadf7e21faac04114a6718 100644 (file)
--- a/read.c
+++ b/read.c
@@ -3111,7 +3111,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopchar,
 #endif /* !NO_ARCHIVES */
 
       /* glob() is expensive: don't call it unless we need to.  */
-      if (!(flags & PARSEFS_EXISTS) || strpbrk (name, "?*[") == NULL)
+      if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL)
         {
           globme = 0;
           i = 1;
index 86c6789516a2e4de423a81de00c157d531fd7c0b..73b49fa30b4c42f26fa456923fd92510bc142531 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-07  Paul Smith  <psmith@gnu.org>
+
+       * scripts/functions/wildcard: Verify wildcard used to test for
+       file existence/non-existence.
+
 2011-05-02  Paul Smith  <psmith@gnu.org>
 
        * scripts/functions/sort: Add a test for Savannah bug #33125.
index 2841f5d56d65e4a191eb2d2a52226230dddb01b8..bcd84ad793a3ff40c7924422a455b95bea94a8b0 100644 (file)
@@ -88,4 +88,16 @@ all: ; @echo $(wildcard xz--y*.7)
 !,
               '', "\n");
 
+# TEST #5: wildcard used to verify file existence
+
+touch('xxx.yyy');
+
+run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!,
+              '', "file=xxx.yyy\n");
+
+unlink('xxx.yyy');
+
+run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!,
+              '', "file=\n");
+
 1;