X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fquotearg.c;h=75fbc72f3d5174559161bdd35b9237d777dc9830;hb=c70a54e290ea07f2ac94169b15aa1919dcb28028;hp=c599acdbbc5ee14e44f82e168a2ff46b19e7593f;hpb=df4e570bc75f0ec8234ded88b130d934a630dedd;p=gnulib.git diff --git a/lib/quotearg.c b/lib/quotearg.c index c599acdbb..75fbc72f3 100644 --- a/lib/quotearg.c +++ b/lib/quotearg.c @@ -373,7 +373,11 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize, 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_and_shell_escape; + case '\\': esc = c; + /* No need to escape the escape if we are trying to elide + outer quotes and nothing else is problematic. */ + if (backslash_escapes && elide_outer_quotes && quote_string_len) + goto store_c; c_and_shell_escape: if (quoting_style == shell_always_quoting_style