* bin/autom4te.in (files_to_options): Quote active characters
for the shell.
* tests/tools.at (autom4te and white space in file names):
New test.
2007-11-26 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Fix autom4te for unusual characters in input file names.
+ * bin/autom4te.in (files_to_options): Quote active characters
+ for the shell.
+ * tests/tools.at (autom4te and white space in file names):
+ New test.
+
* doc/autoconf.texi (Limitations of Usual Tools) <awk>:
Document that Tru64 awk always splits $0.
my @res;
foreach my $file (@file)
{
+ (my $arg = $file) =~ s/'/'\\''/g;
if ($file =~ /\.m4f$/)
{
- push @res, "--reload-state=$file";
+ $arg = "--reload-state=$file";
}
- else
+ if ($file =~ /[\t "'\\\$()]/)
{
- push @res, $file;
+ $arg = "'$arg'";
}
+ push @res, $arg;
}
return join ' ', @res;
}
AT_CLEANUP
+# autom4te and file names containing white space
+# ----------------------------------------------
+
+AT_SETUP([autom4te and white space in file names])
+
+file='file with funny \ '\'' \'\'' $ & #!*? name'
+cat >"$file.m4" <<'END'
+right
+END
+# skip if we cannot create such a file
+AT_CHECK([test -f "$file.m4" || exit 77])
+AT_CHECK_AUTOM4TE([-o "$file" "$file.m4"])
+
+AT_CHECK([cat "$file"], [],
+[[right
+]])
+
+AT_CLEANUP
## ------------------ ##