summaryrefslogtreecommitdiffstats
path: root/src/basic/env-file.c
diff options
context:
space:
mode:
authorLouis Taylor <louis@kragniz.eu>2019-01-15 19:51:31 +0100
committerLouis Taylor <louis@kragniz.eu>2019-01-17 17:46:29 +0100
commite768a4f03273c17b787b2c56c63852acaef28ce5 (patch)
tree30ea36e185de000a0e2d43f55893c4ee09a70927 /src/basic/env-file.c
parentutil-lib: follow shell syntax for escape in quotes (diff)
downloadsystemd-e768a4f03273c17b787b2c56c63852acaef28ce5.tar.xz
systemd-e768a4f03273c17b787b2c56c63852acaef28ce5.zip
tree-wide: use '"' instead of '\"'
The escape used previously was redundant and made things more confusing.
Diffstat (limited to 'src/basic/env-file.c')
-rw-r--r--src/basic/env-file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/basic/env-file.c b/src/basic/env-file.c
index 1fec948033..7f10f9ad39 100644
--- a/src/basic/env-file.c
+++ b/src/basic/env-file.c
@@ -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);