tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Next steps for /bin/sh
On Fri, Mar 11, 2016 at 07:53:16AM +0700, Robert Elz wrote:
> The internal form of this is a simple C string (\0 terminated.) - \0's that
> appear in the input, if any, are silently removed ... this practice may
> just be ragmatic, or it may date way back to the very early days, which
> would have overlapped use of paper tape as an input method (not sure if
> paper tape was ever used in any serious way on a unix system, but it would
> have been in use on other systems of the time for sure) - there a \0 just
> represents an area of the tape that is (was) not punched, usually because
> someone wound the tape forward to see what had been "typed", and either
> did not wind it back at all, or not far enough, leaving a gap in the tape,
> which would read as \0 characters, so ignoring \0's when seen (usually at
> a very low level) was normal practice. That made it the prefect char to
> use as a string terminator for C, as it wasn't a chatacter that it was
> possible to enter.
>
> Anyway, the internal form needs to represent a few special characters,
> the two characters that don't wrork in filenames (0x81 and 0x88) are the
> internal representations of \ and ' (or "", by the time we get this far
> it no longer matters what kind of quoting, just that text is quoted).
> That is, approximately.
Three questions here. First is, how much work is it to go from NUL
delimited strings to explicitly sized strings? Second is, would that
allow most of the special chars to go away? Third is, alternatively,
would it allow to move to a more consistent scheme using NUL as escape
character?
Joerg
Home |
Main Index |
Thread Index |
Old Index