From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philip Oakley Subject: [PATCH 2/5] engine.pl: Properly accept quoted spaces in filenames Date: Wed, 24 Dec 2014 10:47:11 +0000 Message-ID: <1419418034-6276-3-git-send-email-philipoakley@iee.org> References: <1419418034-6276-1-git-send-email-philipoakley@iee.org> Cc: Junio C Hamano , Marius Storm-Olsen , Ramsay Jones , Jonathan Nieder , Johannes Schindelin , Msysgit To: GitList X-From: git-owner@vger.kernel.org Wed Dec 24 11:47:32 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y3jTX-0004aY-7I for gcvg-git-2@plane.gmane.org; Wed, 24 Dec 2014 11:47:31 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751650AbaLXKrT (ORCPT ); Wed, 24 Dec 2014 05:47:19 -0500 Received: from b216.a.smtp2go.com ([216.22.18.216]:52054 "EHLO b216.a.smtp2go.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbaLXKrS (ORCPT ); Wed, 24 Dec 2014 05:47:18 -0500 X-Mailer: git-send-email 2.1.0 In-Reply-To: <1419418034-6276-1-git-send-email-philipoakley@iee.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: The engine.pl script barfs on the properly quoted spaces in filename options prevalent on Windows. Use shellwords() rather than split() to separate such options. Signed-off-by: Philip Oakley --- contrib/buildsystems/engine.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl index f48c28a..7f45b80 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(); @@ -237,7 +238,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) { @@ -271,7 +272,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); @@ -312,7 +313,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/) { -- 2.1.0