diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-01 11:47:10 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-08-01 11:47:42 -0700 |
commit | e30ed262092b809899bd545bc418719c5e8a384a (patch) | |
tree | 4d3b37a11af4780209396828b44e598aba3f10ce /bin | |
parent | e9bfc7c7582a6b69bf753f2bea5d4cb1f669759a (diff) | |
download | autoconf-e30ed262092b809899bd545bc418719c5e8a384a.tar.gz |
Fix regression that broke Automake ‘make check’
Problem reported by Ken Moffat (sr#110287); the problem was
introduced in 2016-12-21T16:15:46Z!daniel.kitta@gmail.com.
* bin/autoheader.in (templates_for_header):
When generating warnings about symbols lacking templates,
downgrade template read failure from a fatal error to a warning.
Also, don’t even try to read from a template file whose name has
shell metavariables (which Autoconf 2.50 withdrew support for);
just warn about that, too. These changes cause the Automake
tests to merely generate warnings that are ignored, instead
of failing.
* doc/autoconf.texi (Configuration Files, Configuration Headers)
(Configuration Commands, Configuration Links):
Also document here that the file names should not contain
shell metacharacters, to make this constraint more obvious.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/autoheader.in | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/bin/autoheader.in b/bin/autoheader.in index 7d07fad1..bd824ea3 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -273,13 +273,24 @@ $out->close; { foreach my $template ("$tmp/config.hin", @config_templates) { - my $in = new Autom4te::XFile ($template, "<"); - - while ($_ = $in->getline) + if ($template =~ /["#\$&'()*;<>?[\\\^`|]/) + { + msg 'syntax', "warning: header template has shell metacharacters: $template"; + } + elsif (! -r $template) + { + msg 'syntax', "warning: cannot read $template: $!"; + } + else { - my ($sym) = /^\#\s*\w+\s+(\w+)/ - or next; - delete $symbol{$sym}; + my $in = new Autom4te::XFile ($template, "<"); + + while ($_ = $in->getline) + { + my ($sym) = /^\#\s*\w+\s+(\w+)/ + or next; + delete $symbol{$sym}; + } } } |