| 1048 | QUOTING_STYLE is set. */ |
| 1049 | |
| 1050 | static void |
| 1051 | getenv_quoting_style (void) |
| 1052 | { |
| 1053 | char const *q_style = getenv ("QUOTING_STYLE"); |
| 1054 | if (q_style) |
| 1055 | { |
| 1056 | int i = ARGMATCH (q_style, quoting_style_args, quoting_style_vals); |
| 1057 | if (0 <= i) |
| 1058 | set_quoting_style (NULL, quoting_style_vals[i]); |
| 1059 | else |
| 1060 | { |
| 1061 | set_quoting_style (NULL, shell_escape_always_quoting_style); |
| 1062 | error (0, 0, _("ignoring invalid value of environment " |
| 1063 | "variable QUOTING_STYLE: %s"), quote (q_style)); |
| 1064 | } |
| 1065 | } |
| 1066 | else |
| 1067 | set_quoting_style (NULL, shell_escape_always_quoting_style); |
| 1068 | } |
| 1069 | |
| 1070 | /* Equivalent to quotearg(), but explicit to avoid syntax checks. */ |
| 1071 | #define quoteN(x) quotearg_style (get_quoting_style (NULL), x) |