summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-01-17 08:01:40 +0000
committerJim Meyering <jim@meyering.net>2000-01-17 08:01:40 +0000
commit4d034357da1d9566e9a0246ab11adbf4fb670d0c (patch)
tree2670072aa0fd0a30bd1b1fec69d9e59fabcc5fd7 /lib
parentea51a6cbaa84b98405837dbcf28e66b986bdff51 (diff)
downloadcoreutils-4d034357da1d9566e9a0246ab11adbf4fb670d0c.tar.xz
(quotearg_buffer_restyled): Do not quote
alert, backslash, formfeed, and vertical tab unnecessarily in shell quoting style.
Diffstat (limited to 'lib')
-rw-r--r--lib/quotearg.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/quotearg.c b/lib/quotearg.c
index 9eb05161c..bdbb82080 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -262,20 +262,21 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
#endif
case '\b': esc = 'b'; goto c_escape;
case '\f': esc = 'f'; goto c_escape;
- case '\n': esc = 'n'; goto c_escape;
- case '\r': esc = 'r'; goto c_escape;
- case '\t': esc = 't'; goto c_escape;
+ case '\n': esc = 'n'; goto c_and_shell_escape;
+ case '\r': esc = 'r'; goto c_and_shell_escape;
+ case '\t': esc = 't'; goto c_and_shell_escape;
case '\v': esc = 'v'; goto c_escape;
- case '\\': esc = c; goto c_escape;
+ case '\\': esc = c; goto c_and_shell_escape;
+ c_and_shell_escape:
+ if (quoting_style == shell_quoting_style)
+ goto use_shell_always_quoting_style;
c_escape:
if (backslash_escapes)
{
c = esc;
goto store_escape;
}
- if (quoting_style == shell_quoting_style)
- goto use_shell_always_quoting_style;
break;
case '#': case '~':