summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <blueowl@centrum.cz>2016-09-15 11:37:25 +0200
committerThomas Haller <thaller@redhat.com>2016-10-27 18:48:25 +0200
commitcf7b524dadaaddacf6a00795c6c8f27c2e7fba17 (patch)
tree8dfc03cd7b8a6786ede7d586030825c5d8e6bd09
parent4f6364747baada5fdddb5f87b59b0f4000130edf (diff)
downloadNetworkManager-th/review/jk/ifcfg-comments-rh1369380.tar.gz
ifcfg-rh: do not take \' into account as an escaping sequence inside ''th/review/jk/ifcfg-comments-rh1369380
when searching for a comment. It means NAME='that\'s it' produces |that's it| string but NAME='that\'s it' # comment will return |'that's it| value.
-rw-r--r--src/settings/plugins/ifcfg-rh/shvar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c
index 58c19edd7c..7df7ad8d86 100644
--- a/src/settings/plugins/ifcfg-rh/shvar.c
+++ b/src/settings/plugins/ifcfg-rh/shvar.c
@@ -322,7 +322,7 @@ remove_comment (char *s)
if (s[0] == '"' || s[0] == '\'') {
do {
quote_end = strchr (quote_end + 1, s[0]);
- } while (quote_end && *(quote_end-1) == '\\');
+ } while (quote_end && *(quote_end-1) == '\\' && s[0] == '"');
if (!quote_end)
return FALSE; /* no closing quote */
}