summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
authorFilipe Brandenburger <filbranden@google.com>2015-06-08 21:31:43 -0700
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:01:48 +0100
commit052cd31ffd9de042f25126992294ebd6db5a67c2 (patch)
tree6fc54cf9e0c1185e811af0ac72025bef5f5d5e3d /src/shared/util.h
parent61c0276130571598a970f314368866b219d7cddc (diff)
util: Introduce unquote_first_word_and_warn
It will try to unquot_first_word, but if it runs into escaping problems it will retry it adding UNQUOTE_CUNESCAPE_RELAX to the flags. If it succeeds on the second try, it will log a warning about it. If it fails both times, it will log an error. Add test cases to confirm it behaves as expected.
Diffstat (limited to 'src/shared/util.h')
-rw-r--r--src/shared/util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index d465d6908..93fe000a2 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -1008,6 +1008,7 @@ typedef enum UnquoteFlags{
} UnquoteFlags;
int unquote_first_word(const char **p, char **ret, UnquoteFlags flags);
+int unquote_first_word_and_warn(const char **p, char **ret, UnquoteFlags flags, const char *unit, const char *filename, unsigned line, const char *rvalue);
int unquote_many_words(const char **p, UnquoteFlags flags, ...) _sentinel_;
int free_and_strdup(char **p, const char *s);