Skip to content

Commit e249ec8

Browse files
committed
Fix newline handling in quoted strings
1 parent e5bc758 commit e249ec8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Build/Apk.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ sub expandvars {
140140
sub quote {
141141
my ($str, $q, $vars) = @_;
142142
$str = expandvars($str, $vars) if $q ne "'" && $str =~ /\$/;
143-
$str =~ s/([ \t\"\'\$#])/sprintf("%%%02X", ord($1))/ge;
143+
$str =~ s/([ \n\t\"\'\$#])/sprintf("%%%02X", ord($1))/ge;
144144
$str = "%00" if $str eq ''; # so that split sees something
145145
return $str;
146146
}
@@ -159,7 +159,7 @@ sub unquotesplit {
159159
}
160160
}
161161
$str = expandvars($str, $vars) if $str =~ /\$/;
162-
my @args = split(/[ \t]+/, $str);
162+
my @args = split(/[ \t\n]+/, $str);
163163
for (@args) {
164164
s/%([a-fA-F0-9]{2})/$1 ne '00' ? chr(hex($1)) : ''/ge;
165165
}

0 commit comments

Comments
 (0)