# HG changeset patch # User Rik # Date 1386105224 28800 # Node ID 1e9cb13faa7a5b041920bb1e192e37c6267b774c # Parent 832ecfda1d3cf9743d201c67b893b3060f0ada1f ls.m: Strip tailing UNIX file separator when running in Windows environment (bug #40726). * ls.m: Strip tailing UNIX file separator when running in Windows environment (bug #40726). diff -r 832ecfda1d3c -r 1e9cb13faa7a scripts/miscellaneous/ls.m --- a/scripts/miscellaneous/ls.m Tue Dec 03 12:30:50 2013 -0800 +++ b/scripts/miscellaneous/ls.m Tue Dec 03 13:13:44 2013 -0800 @@ -63,6 +63,10 @@ if (ispc () && ! isunix ()) ## shell (cmd.exe) on MinGW uses '^' as escape character args = regexprep (args, '([^\w.*? -])', '^$1'); + ## Strip UNIX directory character which looks like an option to dir cmd. + if (args{end}(end) == '/') + args{end}(end) = ""; + endif else args = regexprep (args, '([^\w.*? -])', '\\$1'); endif