From f3391324ab617fc631f4f868d65b72ec23acc0e1 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 22 Nov 2011 20:15:39 +1100 Subject: [PATCH] quote spaces in -I options --- .gitignore | 2 +- Makefile.PL | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 20fb56f..35c27c9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,4 @@ pm_to_blib *~ MANIFEST.bak Imager-Screenshot-* - +Screenshot_def.old diff --git a/Makefile.PL b/Makefile.PL index 50cf6f8..2417bd9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -165,12 +165,22 @@ sub _find_file { grep -f File::Spec->catfile($_, $name), @where; } +sub _quote_spaces { + my $path = shift; + + if ($path =~ / /) { + return qq("$path"); + } + + return $path; +} + sub find_header { my ($name, $description) = @_; my @found = _find_file($_[0], header_search_path()); if (@found) { - push @cflags, "-I$_" for grep !$seen_incdir{$_}, @found; + push @cflags, _quote_spaces("-I$_") for grep !$seen_incdir{$_}, @found; @seen_incdir{@found} = (1) x @found; } else { -- 2.30.2