xilun / cbwin

Launch Windows programs from "Bash on Ubuntu on Windows" (WSL)
Other
327 stars 25 forks source link

Use double quotes to prevent word splitting #26

Closed goreliu closed 7 years ago

goreliu commented 7 years ago

25

goreliu commented 7 years ago

Some problems ...

$ wcmd dir /a
 Volume in drive C is SYSTEM
 Volume Serial Number is 6E7D-F000

 Directory of c:\

File Not Found
$ wcmd 'dir /a'
 Volume in drive C is SYSTEM
 Volume Serial Number is 6E7D-F000

 Directory of c:\Users\goreliu

16/08/15  23:59    <DIR>          .
16/08/15  23:59    <DIR>          ..
...
xilun commented 7 years ago

Houch... this is going to hit everywhere, especially for wcmd. At this point I even start to wonder if some heuristics trying to identify filenames would not be a "good" idea (in a "less bad than all the others" way). Although even something as simple as only quoting when it seems needed because of e.g. space in the arg might help a lot.