RFC: Transparent subrepository support by match module
Martin Geisler
mg at aragost.com
Thu Aug 12 02:15:24 CDT 2010
"Daniel J. Lauk" <daniel.lauk at gmail.com> writes:
> Hello Klaus
>
> I don't think that your idea with \0 would work.
It cannot work no matter how friendly the shell is. The problem is that
command line arguments are passed to programs as C strings, that is,
NUL-terminated strings. This implies that you cannot pass a NUL
character in a command line argument.
In zsh there is something they call POSIX-quotes, and that lets me do
this:
% python -c 'import sys; print repr(sys.argv[-1])' $'x\ny'
'x\ny'
where you can see that the newline character was passed through just
fine. However, a \0 terminates the string:
% python -c 'import sys; print repr(sys.argv[-1])' $'x\0y'
'x'
--
Martin Geisler
aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/
More information about the Mercurial-devel
mailing list