dtc: Improve support for string escapes
dtc supports the use of C-style escapes (\n, \t and so forth) in
string property definitions via the data_copy_escape_string()
function. However, while it supports the most common escape
characters, it doesn't support the full set that C does, which is a
potential gotcha.
Worse, a bug in the lexer means that while data_copy_escape_string()
can handle the \" escape, a string with such an escape won't lex
correctly.
This patch fixes both problems, extending data_copy_escape_string() to
support the missing escapes, and fixing the regex for strings in the
lexer to handle internal escaped quotes.
This also adds a testcase for string escape functionality.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
diff --git a/tests/Makefile.tests b/tests/Makefile.tests
index 3c3305b..78afc8d 100644
--- a/tests/Makefile.tests
+++ b/tests/Makefile.tests
@@ -7,7 +7,8 @@
setprop_inplace nop_property nop_node \
sw_tree1 \
move_and_save \
- open_pack rw_tree1 setprop del_property del_node
+ open_pack rw_tree1 setprop del_property del_node \
+ string_escapes
LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
LIBTREE_TESTS_L = truncated_property