util: Introduce unquote_first_word_and_warn
authorFilipe Brandenburger <filbranden@google.com>
Tue, 9 Jun 2015 04:31:43 +0000 (21:31 -0700)
committerFilipe Brandenburger <filbranden@google.com>
Wed, 17 Jun 2015 18:12:12 +0000 (11:12 -0700)
commitb59292b296ad71a20a40d7c347b6ca71df48892d
tree64e88630263d09fa31c3c5db9eb00e2e277e513a
parentd6293c070e6e4b83d8e7ec56e465b0b215d55d98
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.c
src/basic/util.h
src/test/test-util.c