[RFC 2/4] Properly accept quoted space in filenames
the engine.pl script barfs on the properly quoted space
in filename options prevalent on Windows. Use quotewords()
rather than split() to separate such options. Signed-off-by: Philip Oakley <philipoakley@iee.org>
---
contrib/buildsystems/engine.pl | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 9144ea7..8e41808 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();
@@ -243,7 +244,8 @@ sub removeDuplicates
sub handleCompileLine
{
my ($line, $lineno) = @_;
- my @parts = split(' ', $line);
+ # my @parts = split(' ', $line);
+ my @parts = quotewords('\s+', 0, $line);
my $sourcefile;
shift(@parts); # ignore cmd
while (my $part = shift @parts) {
@@ -277,7 +279,8 @@ sub handleLibLine
my (@objfiles, @lflags, $libout, $part);
# kill cmd and rm 'prefix'
$line =~ s/^rm -f .* && .* rcs //;
- my @parts = split(' ', $line);
+ # my @parts = split(' ', $line);
+ my @parts = quotewords('\s+', 0, $line);
while ($part = shift @parts) {
if ($part =~ /^-/) {
push(@lflags, $part);
@@ -318,7 +321,9 @@ sub handleLinkLine
{
my ($line, $lineno) = @_;
my (@objfiles, @lflags, @libs, $appout, $part);
- my @parts = split(' ', $line);
+ # my @parts = split(' ', $line);
+ my @parts = quotewords('\s+', 0, $line);
+
shift(@parts); # ignore cmd
while ($part = shift @parts) {
if ($part =~ /^-IGNORE/) {
--
1.9.4.msysgit.0
--
--
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.
You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en
---
You received this message because you are subscribed to the Google Groups "Git for Windows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.