zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ferdinand Thiessen <f.thiessen@gmx.de>, zsh-workers@zsh.org
Subject: Re: [BUG] umount mountpoint completion
Date: Mon, 6 Mar 2017 15:10:30 -0800	[thread overview]
Message-ID: <170306151030.ZM18800@torch.brasslantern.com> (raw)
In-Reply-To: <39bf9cbd-8082-3fd6-54f9-8d1a3f498095@gmx.de>

So ... there's a comment in the old _mount discussing what goes on here,
which was removed (and the code partially broken) by workers/33963.

The comment used to say:

-  # "Well, dear, the clever people who wrote Linux decided that some
-  # funny characters that might confuse programmes looking at the names
-  # would be encoded as octal escapes, like for example \040 for space.
-  # The clever people who wrote zsh decided that nothing would
-  # ever be quite as simple as it should be, so to substitute octal
-  # escapes everywhere in a string, even though the shell understands
-  # them natively in print escapes, needs some hackery where you match
-  # the octal number using the numeric closure syntax introduced after
-  # 4.3.4, then reinput the number in a standard math mode format as 8#OOO,
-  # and turn that into a character using the (#) parameter flag."

The fancy substitution that cleaned up this mess was then replaced by a
simpler one that works NEARLY all the time; except it breaks when the
aforementioned \040 for space is followed by ANOTHER digit.  In that
case the simplfied substitution treats (in Ferdinand's example) \0400
as a single octal number and turns it into $'\C-@' instead of " 0".

So perhaps 33963 needs to be reverted, and something less flippant
added to the comment to explain that the reason for bouncing back and
forth between numeric closure syntax and math mode format is to be sure
that EXACTLY THREE characters are interpreted as an octal number here.

However, one question remains.  Ferdinand, in your original message on
this thread you said:

} > % sudo umount "/tmp/a\ 0"
} 
} Which is of course invalid.

Could you please explain why you consider this to be invalid?  Because if
all we do is revert 33963, the above is what you're going to get again,
and I don't immediately see what's wrong with it.


  reply	other threads:[~2017-03-06 23:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-05 15:08 Ferdinand Thiessen
2017-03-06  0:55 ` Ferdinand Thiessen
2017-03-06  4:01 ` Bart Schaefer
2017-03-06 17:35   ` Ferdinand Thiessen
2017-03-06 23:10     ` Bart Schaefer [this message]
2017-03-07 11:19       ` Daniel Shahaf
2017-03-07 19:14         ` Bart Schaefer
2017-03-07 20:37           ` Ferdinand Thiessen
2017-03-07 21:49             ` Bart Schaefer
2017-03-08  2:08               ` Ferdinand Thiessen
2017-03-09  5:55                 ` Bart Schaefer

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=170306151030.ZM18800@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=f.thiessen@gmx.de \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).