From: Wayne Davison Date: Sat, 2 Sep 2006 19:57:56 +0000 (+0000) Subject: An even better way to un-backslash-escape the filenames from find. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/176e8e94c363ffeb8b5fe0b1fd516c8b63fb0ba1 An even better way to un-backslash-escape the filenames from find. --- diff --git a/support/file-attr-restore b/support/file-attr-restore index 8c25310e..7238b00f 100755 --- a/support/file-attr-restore +++ b/support/file-attr-restore @@ -48,8 +48,7 @@ while (<>) { die "Invalid input line $.:\n$_" unless defined $name; die "A filename is not properly escaped:\n$_" unless $name =~ /^[^"\\]*(\\(\d\d\d|\D)[^"\\]*)*$/; my $fn = $name; - $fn =~ s/([\$\@\%])/\\$1/g; - $fn = eval "\"$fn\""; + $fn =~ s/\\(\d+|[A-Za-z]|.)/ eval "\"\\$1\"" /eg; if ($type eq '-') { undef $type unless -f $fn; } elsif ($type eq 'd') {