diff options
author | Thomas Haller <thaller@redhat.com> | 2019-02-06 08:57:18 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-02-06 09:30:59 +0100 |
commit | bb341900ddf65b733e2b367d9dd77736cdc1c837 (patch) | |
tree | 7d3529b29b97bc77ee65f73a1a68106b3afe1da9 | |
parent | de1741e2d0737bc4e70c9875b437b829a9019e7c (diff) | |
download | NetworkManager-bb341900ddf65b733e2b367d9dd77736cdc1c837.tar.gz |
all: avoid backslash escape double quote inside single quote
It's not necessary.
-rw-r--r-- | src/dhcp/tests/test-dhcp-dhclient.c | 4 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/shvar.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/dhcp/tests/test-dhcp-dhclient.c b/src/dhcp/tests/test-dhcp-dhclient.c index ab1f5551d4..a65cbc4ef0 100644 --- a/src/dhcp/tests/test-dhcp-dhclient.c +++ b/src/dhcp/tests/test-dhcp-dhclient.c @@ -803,7 +803,7 @@ test_write_duid (void) static void test_write_existing_duid (void) { - const guint8 duid[] = { 000, 001, 000, 001, 023, 'o', 023, 'n', 000, '\"', 0372, 0214, 0326, 0302 }; + const guint8 duid[] = { 000, 001, 000, 001, 023, 'o', 023, 'n', 000, '"', 0372, 0214, 0326, 0302 }; const char *original_contents = "default-duid \"\\000\\001\\000\\001\\027X\\350X\\000#\\025\\010~\\254\";\n"; const char *expected_contents = "default-duid \"\\000\\001\\000\\001\\023o\\023n\\000\\\"\\372\\214\\326\\302\";\n"; GError *error = NULL; @@ -825,7 +825,7 @@ test_write_existing_duid (void) g_assert_cmpstr (expected_contents, ==, contents); } -static const guint8 DUID_BIN[] = { 000, 001, 000, 001, 023, 'o', 023, 'n', 000, '\"', 0372, 0214, 0326, 0302 }; +static const guint8 DUID_BIN[] = { 000, 001, 000, 001, 023, 'o', 023, 'n', 000, '"', 0372, 0214, 0326, 0302 }; #define DUID "\\000\\001\\000\\001\\023o\\023n\\000\\\"\\372\\214\\326\\302" static void diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c index 3259d936de..1995d72474 100644 --- a/src/settings/plugins/ifcfg-rh/shvar.c +++ b/src/settings/plugins/ifcfg-rh/shvar.c @@ -215,9 +215,9 @@ _escape_ansic (const char *source) /*****************************************************************************/ -#define _char_req_escape(ch) NM_IN_SET (ch, '\"', '\\', '$', '`') -#define _char_req_escape_old(ch) NM_IN_SET (ch, '\"', '\\', '\'', '$', '`', '~') -#define _char_req_quotes(ch) NM_IN_SET (ch, ' ', '\'', '~', '\t', '|', '&', ';', '(', ')', '<', '>') +#define _char_req_escape(ch) NM_IN_SET (ch, '"', '\\', '$', '`') +#define _char_req_escape_old(ch) NM_IN_SET (ch, '"', '\\', '\'', '$', '`', '~') +#define _char_req_quotes(ch) NM_IN_SET (ch, ' ', '\'', '~', '\t', '|', '&', ';', '(', ')', '<', '>') const char * svEscape (const char *s, char **to_free) |