Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/bin/sh



Module Name:    src
Committed By:   kre
Date:           Tue Feb 16 15:30:26 UTC 2021

Modified Files:
        src/bin/sh: input.c

Log Message:
PR bin/55979

Correctly handle (ie: ignore completely) \0 chars (nuls) in the
shell command input stream (script, dot file, or stdin).

Previously nul chars were ignored correctly in the line in which
they occurred, but would cause trailing chars of that line to reappear
as the start of the following line.   If there was just one \0 skipped,
this would generally result in an extra \n in the sh input, which in
most cases has no effect.   With multiple \0's in a single line, more
of the end of that line was duplicated into the following one.  This
usually manifested as a weird "command not found" error.

Note that any \0 chars in the sh input make the script non-conforming,
so fixing this is not crucial (no \0's should really ever be seen) but
it was an obvious bug in the code, which was attempting to ignore nul
chars (as do many other shells), so let it be fixed.

XXX pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/bin/sh/input.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index