use Config qw(%Config);
use File::Basename qw(basename dirname fileparse);
use DirHandle;
+use Text::ParseWords;
use vars qw($VERSION @ISA
$Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Win95 $Is_Dos $Is_VOS
# For INC we need to prepend parent directory but
# only iff the parent directory is not absolute.
my ($o, $i) = $Is_VMS ? ('/Include=', 'i') : ('-I', '');
- $inc =~ s!(?$i)$o(.+?)!$o.($self->file_name_is_absolute($1)?$1:$self->catdir($self->updir,$1))!eg;
- push @pasthru, "INC=\"$inc\"";
+ my $newinc = '';
+ foreach (grep { /\S/ } parse_line(qr/\s*(?$i)$o/, 1, $inc)) {
+ s/^"(.+)"$/$1/o;
+ my $dir = File::Spec->file_name_is_absolute($_) ? $_ : File::Spec->catdir(File::Spec->updir, $_);
+ $dir = qq["$dir"] if $dir =~ / /;
+ $newinc .= " $o$dir";
+ }
+ push @pasthru, "INC=\"$newinc\"";
} else {
push @pasthru, "$key=\"\$($key)\"";
}