On Fri, Apr 17, 2015 at 08:12:43AM +0100, Adam Thompson wrote: > On Thu, Apr 16, 2015 at 05:40:53PM -0400, Karl Dahlke wrote: > > I made one common routine to protect a file name or directory name from > > shell expansion, it's the same code I was using before, but now it is shared > > between the directory scan and the plugin commands. > > Ok, that's good software practice, but it exposed a bug > > that I think was there all along. > > You can't edit a directory with a backslash in it. > > > > mkdir "a\\b" > > cd a?b > > touch foo bar > > cd .. > > edbrowse a?b > > > > Try it before or after my latest push. > > The files therein just don't show up, > > because wordexp doesn't expand a\\b/* properly. > > and that is the proper escaping. > > At the shell prompt > > ls a\\b/* > > works fine. > > And it all works through the plugin system, i.e. a\b.pdf becomes > > pdftohtml a\\b.pdf > > This seems to be a bug in wordexp, at least my wordexp, > > and I'm really not sure what to do about it. Actually we broke things when doing wordexp implementation. Basically the "quick check" in envFile is just wrong and needs to go since it doesn't work correctly and doesn't include all corner cases. Whilst looking at this I also noticed that ~username/whatever was also not expanded due to this "quick check". Removing the check fixes this bug and probably makes the behaviour much more consistant into the bargain (i.e. ` suppresses it, otherwise we get wordexp expansion). Once I get the readline completion using the shellProtect routine I'll push the fix. Cheers, Adam.