From: raster Date: Sat, 9 Apr 2011 02:59:28 +0000 (+0000) Subject: and dont handle escape if in string X-Git-Tag: submit/trunk/20120815.180907~662 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97476f383d4afdccf1c9c473d18fe55c34a11a98;p=profile%2Fivi%2Fedje.git and dont handle escape if in string git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@58511 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/bin/epp/cpplib.c b/src/bin/epp/cpplib.c index 8c92b3b..6fecb99 100644 --- a/src/bin/epp/cpplib.c +++ b/src/bin/epp/cpplib.c @@ -2030,20 +2030,28 @@ cpp_expand_to_buffer(cpp_reader * pfile, unsigned char *buf, int length) { unsigned char *p1 = buf; unsigned char *p2 = buf1; - -#if 0 + int in_string = 0; + +#if 0 /* old behavior */ while (p1 != limit) *p2++ = *p1++; -#else +#else /* new one - handle \ escapes if not in string */ while (p1 != limit) { - if (*p1 == '\\') + if (!in_string) { - p1++; - if (p1 != limit) + if (*p1 == '"') in_string = 1; + if (*p1 == '\\') + { + p1++; + if (p1 != limit) *p2++ = *p1++; + } + else *p2++ = *p1++; } else { + if ((*p1 == '"') && (p1 > buf) && (p1[-1] != '\\')) + in_string = 0; *p2++ = *p1++; } }