diff options
author | Boris Kolpackov <boris@kolpackov.net> | 2005-08-10 10:21:13 +0000 |
---|---|---|
committer | Boris Kolpackov <boris@kolpackov.net> | 2005-08-10 10:21:13 +0000 |
commit | e437226241ac0c1776ac1c82688a472b3f8ed581 (patch) | |
tree | 094fca322a8eee1471a4c11589202ba26daa9473 | |
parent | b237dff7753f444c4e0e8ea6bb1929243e45b310 (diff) | |
download | gunmake-e437226241ac0c1776ac1c82688a472b3f8ed581.tar.gz |
Fixed Savannah bug #13881.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | read.c | 24 | ||||
-rw-r--r-- | tests/ChangeLog | 4 | ||||
-rw-r--r-- | tests/scripts/features/statipattrules | 11 |
4 files changed, 33 insertions, 12 deletions
@@ -1,3 +1,9 @@ +2005-08-10 Boris Kolpackov <boris@kolpackov.net> + + * read.c (record_files): Move code that sets stem for static + pattern rules out of the if (!two_colon) condition so it is + also executed for two-colon rules. Fixes Savannah bug #13881. + 2005-08-07 Paul D. Smith <psmith@gnu.org> * w32/pathstuff.c (getcwd_fs): Fix warning about assignment in a @@ -2106,18 +2106,6 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent, if (cmds != 0) f->updating = 1; } - - /* If this is a static pattern rule, set the file's stem to - the part of its name that matched the `%' in the pattern, - so you can use $* in the commands. */ - if (pattern != 0) - { - static char *percent = "%"; - char *buffer = variable_expand (""); - char *o = patsubst_expand (buffer, name, pattern, percent, - pattern_percent+1, percent+1); - f->stem = savestring (buffer, o - buffer); - } } else { @@ -2143,6 +2131,18 @@ record_files (struct nameseq *filenames, char *pattern, char *pattern_percent, f->cmds = cmds; } + /* If this is a static pattern rule, set the file's stem to + the part of its name that matched the `%' in the pattern, + so you can use $* in the commands. */ + if (pattern != 0) + { + static char *percent = "%"; + char *buffer = variable_expand (""); + char *o = patsubst_expand (buffer, name, pattern, percent, + pattern_percent+1, percent+1); + f->stem = savestring (buffer, o - buffer); + } + /* Free name if not needed further. */ if (f != 0 && name != f->name && (name < f->name || name > f->name + strlen (f->name))) diff --git a/tests/ChangeLog b/tests/ChangeLog index a205074..cb3edeb 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2005-08-10 Boris Kolpackov <boris@kolpackov.net> + + * scripts/features/statipattrules: Add a test for Savannah bug #13881. + 2005-08-07 Paul D. Smith <psmith@gnu.org> * scripts/features/parallelism: Add a test for a bug reported by diff --git a/tests/scripts/features/statipattrules b/tests/scripts/features/statipattrules index b5459b9..0ca2bb7 100644 --- a/tests/scripts/features/statipattrules +++ b/tests/scripts/features/statipattrules @@ -73,4 +73,15 @@ foo.x bar.x: %.x : ; @echo $@ 'foo.x '); + +# TEST #6 -- bug #13881: double colon static pattern rule does not +# substitute %. +# +run_make_test(' +foo.bar:: %.bar: %.baz +foo.baz: ;@: +', +'', +''); + 1; |