syncfiles: terminate directory names at equal signs
authorH. Peter Anvin <hpa@zytor.com>
Mon, 16 Jun 2008 06:43:44 +0000 (23:43 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 16 Jun 2008 06:43:44 +0000 (23:43 -0700)
In the case where the directory name should be removed (null pathname
separator) don't search backwards past an equal sign, just in case
there isn't a space after the assignment.

syncfiles.pl

index 57bae5a..f7e1163 100755 (executable)
@@ -18,7 +18,7 @@ sub do_transform($$) {
 
     if ($ps eq '') {
        # Remove the path separator and the preceeding directory
-       $l =~ s/\S*\x02//g;
+       $l =~ s/[^\s\=]*\x02//g;
     } else {
        # Convert the path separator
        $l =~ s/\x02/$ps/g;