mirror of
https://github.com/mirror/make.git
synced 2025-03-28 21:11:03 +08:00
Fix a bug handling target/prerequisite names containing comment
characters.
This commit is contained in:
parent
ebd05dbeb3
commit
ae003efd61
@ -1,3 +1,11 @@
|
|||||||
|
2002-09-23 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* read.c (enum make_word_type): Remove w_comment.
|
||||||
|
(get_next_mword): Don't treat comment characters as special; where
|
||||||
|
this function is used we will never see a comment (it's stripped
|
||||||
|
before we get here) and treating comments specially means that
|
||||||
|
targets like "foo\#bar" aren't handled properly.
|
||||||
|
|
||||||
2002-09-18 Paul D. Smith <psmith@gnu.org>
|
2002-09-18 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* doc/make.texi (Bugs): Update with some info on Savannah, etc.
|
* doc/make.texi (Bugs): Update with some info on Savannah, etc.
|
||||||
|
8
read.c
8
read.c
@ -62,7 +62,7 @@ struct ebuffer
|
|||||||
enum make_word_type
|
enum make_word_type
|
||||||
{
|
{
|
||||||
w_bogus, w_eol, w_static, w_variable, w_colon, w_dcolon, w_semicolon,
|
w_bogus, w_eol, w_static, w_variable, w_colon, w_dcolon, w_semicolon,
|
||||||
w_comment, w_varassign
|
w_varassign
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -2620,7 +2620,6 @@ readline (ebuf)
|
|||||||
w_colon A colon
|
w_colon A colon
|
||||||
w_dcolon A double-colon
|
w_dcolon A double-colon
|
||||||
w_semicolon A semicolon
|
w_semicolon A semicolon
|
||||||
w_comment A comment character
|
|
||||||
w_varassign A variable assignment operator (=, :=, +=, or ?=)
|
w_varassign A variable assignment operator (=, :=, +=, or ?=)
|
||||||
|
|
||||||
Note that this function is only used when reading certain parts of the
|
Note that this function is only used when reading certain parts of the
|
||||||
@ -2650,10 +2649,6 @@ get_next_mword (buffer, delim, startp, length)
|
|||||||
wtype = w_eol;
|
wtype = w_eol;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '#':
|
|
||||||
wtype = w_comment;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ';':
|
case ';':
|
||||||
wtype = w_semicolon;
|
wtype = w_semicolon;
|
||||||
break;
|
break;
|
||||||
@ -2717,7 +2712,6 @@ get_next_mword (buffer, delim, startp, length)
|
|||||||
case ' ':
|
case ' ':
|
||||||
case '\t':
|
case '\t':
|
||||||
case '=':
|
case '=':
|
||||||
case '#':
|
|
||||||
goto done_word;
|
goto done_word;
|
||||||
|
|
||||||
case ':':
|
case ':':
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2002-09-23 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* scripts/features/escape: Test handling of escaped comment
|
||||||
|
characters in targets and prerequisites.
|
||||||
|
|
||||||
2002-09-18 Paul D. Smith <psmith@gnu.org>
|
2002-09-18 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* scripts/features/export: Test export/unexport of multiple
|
* scripts/features/export: Test export/unexport of multiple
|
||||||
|
@ -73,7 +73,7 @@ if ($parallel_jobs) {
|
|||||||
|
|
||||||
# TEST 4: Each double-colon rule is supposed to be run individually
|
# TEST 4: Each double-colon rule is supposed to be run individually
|
||||||
|
|
||||||
&touch('f2.h');
|
&utouch(-5, 'f2.h');
|
||||||
&touch('foo');
|
&touch('foo');
|
||||||
|
|
||||||
&run_make_with_options($makefile, "foo", &get_logfile, 0);
|
&run_make_with_options($makefile, "foo", &get_logfile, 0);
|
||||||
@ -90,7 +90,7 @@ if ($parallel_jobs) {
|
|||||||
|
|
||||||
# TEST 6: Each double-colon rule is supposed to be run individually
|
# TEST 6: Each double-colon rule is supposed to be run individually
|
||||||
|
|
||||||
&touch('f1.h');
|
&utouch(-5, 'f1.h');
|
||||||
unlink('f2.h');
|
unlink('f2.h');
|
||||||
&touch('foo');
|
&touch('foo');
|
||||||
|
|
||||||
|
@ -3,7 +3,8 @@ $description = "Test various types of escaping in makefiles.";
|
|||||||
|
|
||||||
$details = "\
|
$details = "\
|
||||||
Make sure that escaping of `:' works in target names.
|
Make sure that escaping of `:' works in target names.
|
||||||
Also make sure escaping of whitespace works in target names";
|
Make sure escaping of whitespace works in target names.
|
||||||
|
Make sure that escaping of '#' works.";
|
||||||
|
|
||||||
open(MAKEFILE,"> $makefile");
|
open(MAKEFILE,"> $makefile");
|
||||||
|
|
||||||
@ -11,6 +12,9 @@ print MAKEFILE <<'EOF';
|
|||||||
$(path)foo : ; @echo cp $^ $@
|
$(path)foo : ; @echo cp $^ $@
|
||||||
|
|
||||||
foo\ bar: ; @echo 'touch "$@"'
|
foo\ bar: ; @echo 'touch "$@"'
|
||||||
|
|
||||||
|
sharp: foo\#bar.ext
|
||||||
|
foo\#bar.ext: ; @echo foo\#bar.ext = '$@'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
close(MAKEFILE);
|
close(MAKEFILE);
|
||||||
@ -46,5 +50,11 @@ $answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n";
|
|||||||
$answer = "touch \"foo bar\"\n";
|
$answer = "touch \"foo bar\"\n";
|
||||||
&compare_output($answer,&get_logfile(1));
|
&compare_output($answer,&get_logfile(1));
|
||||||
|
|
||||||
|
# TEST 6: Test escaped comments
|
||||||
|
|
||||||
|
&run_make_with_options($makefile, "sharp", &get_logfile, 0);
|
||||||
|
$answer = "foo#bar.ext = foo#bar.ext\n";
|
||||||
|
&compare_output($answer,&get_logfile(1));
|
||||||
|
|
||||||
# This tells the test driver that the perl test script executed properly.
|
# This tells the test driver that the perl test script executed properly.
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user