Thread (1 message) 1 message, 1 author, 2007-10-16

Re: dtc: Improve support for string escapes

From: Jon Loeliger <hidden>
Date: 2007-10-16 13:14:20

So, like, the other day David Gibson mumbled:
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 <redacted>
Excellent.  Thanks.
quoted hunk
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ dtc/tests/string_escapes.c	2007-10-16 16:34:20.000000000 +1000
@@ -0,0 +1,42 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ *	Testcase for strinc escapes in dtc
Applied, modulo fixing that typo.

jdl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help