diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-11-25 21:09:44 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-11-25 21:09:44 -0800 |
commit | 1cb01c571adc42ae269d4361df44f4bf6ab9d3ec (patch) | |
tree | a20dce2852c81309e5d9693e88755d33c17b993d /strudel.h | |
parent | 81fa0c0f30bb6bcd2a4d287748db6d090b0d04ea (diff) | |
download | txr-1cb01c571adc42ae269d4361df44f4bf6ab9d3ec.tar.gz txr-1cb01c571adc42ae269d4361df44f4bf6ab9d3ec.tar.bz2 txr-1cb01c571adc42ae269d4361df44f4bf6ab9d3ec.zip |
sh-esc: clean up mess I made.
Not all special characters can just be backslash escaped.
Spaces and newlines must be quoted.
* stream.c (sh_esc_common): New function. Handles both
sh-esc and sh-esc-all logic, distinguished by a flag.
Quoting is used, rather than backslash escaping.
If the string contains no special characters, it is just
erturned. If it can be double quoted, it is double quoted.
Otherwise it is single quoted and any contained single
quotes are replaced by '\''.
(sh_esc, sh_esc_all): Now just wrap sh_esc_common.
(sh_esc_dq): Remove the newline from the set of escaped
characters. Escaping a newline generates a continuation
sequence which eats the newline.
* tests/018/sh-esc.tl: Most test cases deleted; many new test
cases added.
* txr.1: Documentation revised.
Diffstat (limited to 'strudel.h')
0 files changed, 0 insertions, 0 deletions