Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 717b526

Browse files
committed
separating input to xargs using NUL, which is more standard.
1 parent bd23048 commit 717b526

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

git-add--interactive.perl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,14 @@ sub run_cmd_pipe {
201201
shift(@myArgs);
202202

203203
foreach (@myArgs) {
204-
# if files have whitespace in the name, quotes around $_ are mandatory:
205-
print $fhargs "\"$_\" \n";
204+
print $fhargs "$_" . "\0";
206205
}
207206

208207
$fhargs->flush;
209208
close($fhargs);
210209

211210
# 2015 may 26: @kkheller using cat to xargs instead of "< $filename"
212-
$cmd = "cat $filename | xargs -s 20000 " . $cmd;
211+
$cmd = "cat $filename | xargs -0 -s 20000 " . $cmd;
213212
}
214213

215214
my $fh = undef;

0 commit comments

Comments
 (0)