projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mark 'memcpy' obsolete.
[gnulib.git]
/
lib
/
quotearg.c
diff --git
a/lib/quotearg.c
b/lib/quotearg.c
index
7d0c91d
..
75fbc72
100644
(file)
--- a/
lib/quotearg.c
+++ b/
lib/quotearg.c
@@
-337,7
+337,8
@@
quotearg_buffer_restyled (char *buffer, size_t buffersize,
break;
case c_quoting_style:
break;
case c_quoting_style:
- if (i + 2 < argsize && arg[i + 1] == '?')
+ if ((flags & QA_SPLIT_TRIGRAPHS)
+ && i + 2 < argsize && arg[i + 1] == '?')
switch (arg[i + 2])
{
case '!': case '\'':
switch (arg[i + 2])
{
case '!': case '\'':
@@
-372,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 '\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
c_and_shell_escape:
if (quoting_style == shell_always_quoting_style