backslash prior to whitespace without treating it as escaped
whitespace (e.g. if we receive "foo\\ bar", it is two args,
while "foo\ bar" and "foo\\\ bar" are each just one).
### START of options data produced by the cull_options script. ###
# These options are the only options that rsync might send to the server,
-# and only in the option/arg format that the stock rsync produces.
+# and only in the option format that the stock rsync produces.
# To disable a short-named option, add its letter to this string:
our $short_disabled = '';
my $in_options = 1;
my $last_opt = '';
my $check_type;
-foreach (split(/(?<!\\)\s+/, $command)) {
+while ($command =~ /((?:[^\s\\]+|\\.[^\s\\]*)+)/g) {
+ $_ = $1;
if ($check_type) {
push(@opts, check_arg($last_opt, $_, $check_type));
$check_type = 0;