Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] umount mountpoint completion

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.

Messages sorted by: Reverse Date, Date, Thread, Author