changeset 2145:d0a924014953

(quotearg_buffer_restyled): Do not quote alert, backslash, formfeed, and vertical tab unnecessarily in shell quoting style.
author Jim Meyering <jim@meyering.net>
date Mon, 17 Jan 2000 08:01:40 +0000
parents 058d24018808
children c3ab26ed1e51
files lib/quotearg.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -262,20 +262,21 @@
 #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 '~':