summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorPhilip Oakley <philipoakley@iee.org>2019-07-29 20:08:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-29 21:51:42 (GMT)
commitd8c07013b93496fff8e16b75560a22aa44da1625 (patch)
tree24dec74c00fdb34339a8c4a8c6a0807971419d07 /contrib
parent90d5170cac9627d2a0bdd9660acb0477434eef42 (diff)
downloadgit-d8c07013b93496fff8e16b75560a22aa44da1625.zip
git-d8c07013b93496fff8e16b75560a22aa44da1625.tar.gz
git-d8c07013b93496fff8e16b75560a22aa44da1625.tar.bz2
contrib/buildsystems: handle quoted spaces in filenames
The engine.pl script expects file names not to contain spaces. However, paths with spaces are quite prevalent on Windows. Use shellwords() rather than split() to parse them correctly. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Philip Oakley <philipoakley@iee.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/buildsystems/engine.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 11f0e16..ad6a82c 100755
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -12,6 +12,7 @@ use File::Basename;
use File::Spec;
use Cwd;
use Generators;
+use Text::ParseWords;
my (%build_structure, %compile_options, @makedry);
my $out_dir = getcwd();
@@ -231,7 +232,7 @@ sub removeDuplicates
sub handleCompileLine
{
my ($line, $lineno) = @_;
- my @parts = split(' ', $line);
+ my @parts = shellwords($line);
my $sourcefile;
shift(@parts); # ignore cmd
while (my $part = shift @parts) {
@@ -265,7 +266,7 @@ sub handleLibLine
my (@objfiles, @lflags, $libout, $part);
# kill cmd and rm 'prefix'
$line =~ s/^rm -f .* && .* rcs //;
- my @parts = split(' ', $line);
+ my @parts = shellwords($line);
while ($part = shift @parts) {
if ($part =~ /^-/) {
push(@lflags, $part);
@@ -306,7 +307,7 @@ sub handleLinkLine
{
my ($line, $lineno) = @_;
my (@objfiles, @lflags, @libs, $appout, $part);
- my @parts = split(' ', $line);
+ my @parts = shellwords($line);
shift(@parts); # ignore cmd
while ($part = shift @parts) {
if ($part =~ /^-IGNORE/) {