diff options
author | Wayne Davison <wayned@samba.org> | 2005-06-23 15:58:57 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2005-06-23 15:58:57 +0000 |
commit | 26c87bb630d9a122f71ed6c4d76d81c9e1eb70fb (patch) | |
tree | 975d8d088c681a498016afa2fd65ae92ba0a5aa8 /support | |
parent | ea9b2add977b642babafd667e55f844529b0fcc3 (diff) | |
download | rsync-26c87bb630d9a122f71ed6c4d76d81c9e1eb70fb.tar.gz rsync-26c87bb630d9a122f71ed6c4d76d81c9e1eb70fb.tar.bz2 rsync-26c87bb630d9a122f71ed6c4d76d81c9e1eb70fb.zip |
Changed the arg-splitting code so that it can handle a literal
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).
Diffstat (limited to 'support')
-rw-r--r-- | support/rrsync | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/support/rrsync b/support/rrsync index 1c314eeb..54503d8e 100644 --- a/support/rrsync +++ b/support/rrsync @@ -45,7 +45,7 @@ die "$0 -ro: sending to read-only server not allowed\n" if $ro && !$am_sender; ### 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 = ''; @@ -117,7 +117,8 @@ my(@opts, @args); 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; |