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

PATCH: Expansion of \c escape sequences


I've noticed that in contexts where escape sequences are expanded
and \c's should not be recognized (i.e., not in arguments to the
various printing commands), then a \c is actually treated synonymous
to \U.  The attached patch contains a fix.

While inspecting the code I came across another glitch:  If a \c
occurs in the separator string of a $arr[(pws:...:)...] subscript,
it is not treated like an unrecognized sequence (i.e., replaced by
a "c"), but removed completely.  (Note that ${(p...)...} gets this
right.)  The attached patch also fixes that.

Finally, I've discovered that \c in an argument to a printing command
only suppresses the final newline, but according POSIX it should
suppress all output after the \c, and that's what ksh, bash, and
echo/printf from GNU coreutils do.  So is the current behaviour really
desired, or should I send a patch to change it?

Best regards
Thorsten Dahlheimer

Attachment: bsc.patch
Description: Binary data

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