From b59292b296ad71a20a40d7c347b6ca71df48892d Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Mon, 8 Jun 2015 21:31:43 -0700 Subject: 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. --- src/basic/util.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/basic/util.h') 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); -- cgit v1.2.3-54-g00ecf