edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] wordexp again
Date: Fri, 17 Apr 2015 23:28:42 +0100	[thread overview]
Message-ID: <20150417222842.GG5949@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <20150417215826.GF5949@toaster.adamthompson.me.uk>

[-- Attachment #1: Type: text/plain, Size: 2205 bytes --]

On Fri, Apr 17, 2015 at 10:58:26PM +0100, Adam Thompson wrote:
> On Fri, Apr 17, 2015 at 10:34:05PM +0100, Adam Thompson wrote:
> > > By the way, removing quick check had nothing to do with the bug
> > > that I posted at the top of this thread.
> > > You stil can't edit a directory with backslash in the name,
> > > and I think that is a bug in wordexp that we can't get around.
> > > That's maybe another reason to go back to my home grown code.
> 
> No, it's a bug in our code. I've checked and we've got a couple of interesting
> things happening. With wordexp enabled, we're duble expanding the filename,
> once before we pass it to sortedDirList, and once in nextScanFile.
> Without wordexp expansion, we don't expand the file name before we get to
> nextScanFile, but then the single \ is swallowed by wordexp so the glob is incorrect.
> I should've spotted this when we first switched to using wordexp because the
> call in nextScanFile really should be to glob rather than wordexp.
> Better still, I think we just shouldn't have switched nextScanFile to wordexp
> since we just want a directory listing in this case.

In the case of sortedDirList we should be using scandir with the alphasort
function as a comparison function (then loading into your line map probably),
for the NextScanFile function (used in fetchmail.c I think)
we probably want to go back to readdir.
I'm happy to put together a fix for this tomorrow.

> I've also tried out the inverted ` character and that seems to make much more
> sense in terms of usable behaviour.

Any thoughts? I think this makes more sense to me since I don't have to be
trying to work out what and when I need to escape things, i.e.
with the "quick check" if I use ~/ then I have to shell escape everything,
or if I use $ then I have to escape everything.
Whereas with the ` character acting to *enable* expansion,
then if I specify ` at the start of the filename then I know I need to shell
escape everything because I'm getting wordexp.
The change I made also had a \ escape for ` in the rare case that the leading ` is required.
If you're happy with this then I'll test and push this change.

Cheers,
Adam.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2015-04-17 22:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16 21:40 Karl Dahlke
2015-04-17  7:12 ` Adam Thompson
2015-04-17 12:50   ` Adam Thompson
2015-04-17 13:33     ` Karl Dahlke
2015-04-17 17:59       ` Adam Thompson
2015-04-17 13:47     ` Karl Dahlke
2015-04-17 18:01     ` Karl Dahlke
2015-04-17 21:34       ` Adam Thompson
2015-04-17 21:58         ` Adam Thompson
2015-04-17 22:25           ` Karl Dahlke
2015-04-17 22:43             ` Adam Thompson
2015-04-17 23:14               ` Karl Dahlke
2015-04-17 22:28           ` Adam Thompson [this message]
2015-04-17 22:39             ` Karl Dahlke
2015-04-18 10:53               ` Adam Thompson
2015-04-18  4:18     ` Karl Dahlke
2015-04-18 10:49       ` Adam Thompson
2015-04-18 11:34         ` Karl Dahlke
2015-04-18 13:09           ` Adam Thompson
2015-04-18 19:33             ` Chris Brannon
2015-04-18 20:05               ` Adam Thompson
2015-04-18 23:03                 ` Chris Brannon
2015-04-18 12:36         ` Karl Dahlke
2015-04-18 12:54           ` Adam Thompson
2015-04-18 13:09             ` Karl Dahlke
2015-04-18 13:24               ` Adam Thompson
2015-04-18 13:45                 ` Karl Dahlke
2015-04-18 17:44                   ` Adam Thompson
2015-04-18 19:48                     ` Karl Dahlke
  -- strict thread matches above, loose matches on Subject: below --
2015-01-09 22:44 Karl Dahlke
2015-01-09 22:19 Karl Dahlke
2015-01-09 22:29 ` Chris Brannon
2015-01-09 21:16 Chris Brannon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150417222842.GG5949@toaster.adamthompson.me.uk \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).