diff options
author | Filipe Brandenburger <filbranden@google.com> | 2015-06-08 21:31:43 -0700 |
---|---|---|
committer | Filipe Brandenburger <filbranden@google.com> | 2015-06-17 11:12:12 -0700 |
commit | b59292b296ad71a20a40d7c347b6ca71df48892d (patch) | |
tree | 64e88630263d09fa31c3c5db9eb00e2e277e513a /src/basic/util.h | |
parent | d6293c070e6e4b83d8e7ec56e465b0b215d55d98 (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/basic/util.h')
-rw-r--r-- | src/basic/util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/util.h b/src/basic/util.h index 748f22f1a2..a1d1dd15c3 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -845,6 +845,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); |