tree-wide: use '"' instead of '\"'

The escape used previously was redundant and made things more confusing.
This commit is contained in:
Louis Taylor
2019-01-17 16:46:29 +00:00
parent e4a8db1fbd
commit e768a4f032
4 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -112,7 +112,7 @@ static int parse_env_file_internal(
} else if (c == '\'')
state = SINGLE_QUOTE_VALUE;
else if (c == '\"')
else if (c == '"')
state = DOUBLE_QUOTE_VALUE;
else if (c == '\\')
state = VALUE_ESCAPE;
@@ -195,7 +195,7 @@ static int parse_env_file_internal(
break;
case DOUBLE_QUOTE_VALUE:
if (c == '\"')
if (c == '"')
state = PRE_VALUE;
else if (c == '\\')
state = DOUBLE_QUOTE_VALUE_ESCAPE;
@@ -517,7 +517,7 @@ static void write_env_var(FILE *f, const char *v) {
fwrite_unlocked(v, 1, p-v, f);
if (string_has_cc(p, NULL) || chars_intersect(p, WHITESPACE SHELL_NEED_QUOTES)) {
fputc_unlocked('\"', f);
fputc_unlocked('"', f);
for (; *p; p++) {
if (strchr(SHELL_NEED_ESCAPE, *p))
@@ -526,7 +526,7 @@ static void write_env_var(FILE *f, const char *v) {
fputc_unlocked(*p, f);
}
fputc_unlocked('\"', f);
fputc_unlocked('"', f);
} else
fputs_unlocked(p, f);
+1 -1
View File
@@ -1000,7 +1000,7 @@ skip:
value++;
/* unquote */
if (value[0] == '\"' && line[linelen-1] == '\"') {
if (value[0] == '"' && line[linelen-1] == '"') {
value++;
line[linelen-1] = '\0';
}
+2 -2
View File
@@ -724,7 +724,7 @@ void json_escape(
fputs(" ]", f);
} else {
fputc('\"', f);
fputc('"', f);
while (l > 0) {
if (IN_SET(*p, '"', '\\')) {
@@ -741,7 +741,7 @@ void json_escape(
l--;
}
fputc('\"', f);
fputc('"', f);
}
}
+1 -1
View File
@@ -191,7 +191,7 @@ int xml_tokenize(const char **p, char **name, void **state, unsigned *line) {
if (*c == '=') {
c++;
if (IN_SET(*c, '\'', '\"')) {
if (IN_SET(*c, '\'', '"')) {
/* Tag with a quoted value */
e = strchr(c+1, *c);