]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: use '"' instead of '\"' 11427/head
authorLouis Taylor <louis@kragniz.eu>
Tue, 15 Jan 2019 18:51:31 +0000 (18:51 +0000)
committerLouis Taylor <louis@kragniz.eu>
Thu, 17 Jan 2019 16:46:29 +0000 (16:46 +0000)
The escape used previously was redundant and made things more confusing.

src/basic/env-file.c
src/boot/efi/boot.c
src/shared/logs-show.c
src/shared/xml.c

index 1fec948033530d5cc49b9542227049ff119dd090..7f10f9ad39e4c4e39cc3418a118750e013e9b2cb 100644 (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);
 
index 5aae7e7c06bb6f93ac4e3409a353f3bc19aef00d..9bf6895831baecbeab36881c599a3cddbd073bb7 100644 (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';
         }
index 525a948f3609fc1ee9c2044577e3783b78cb3f7d..15ef0f19ff8f5ced3416c41a345906f8aef8a381 100644 (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);
         }
 }
 
index cb34d870c19d5e24f7b26d17588fc11c22b7b25a..27090762642d6e962bf4f470ff672b2a83b60f38 100644 (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);