Sfoglia il codice sorgente

Allow \" in string values

"When dealing with an Arris TM502G MTA config file it is ideal to
 include the double quote character in the display name/callerid
 string."

http://sf.net/tracker/?func=detail&aid=1849682&group_id=22615&atid=375631
reticent 15 anni fa
parent
commit
897a50acd2
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      src/docsis_lex.l

+ 9 - 0
src/docsis_lex.l

@@ -84,6 +84,15 @@ TlvStringZero		{ return T_TLV_STRZERO_VALUE; 	}
 			}
 
 \"		{ BEGIN STRING; str=strbuf; memset(strbuf,0,2048); strsize=0; }
+<STRING>\\\"	{
+			if (strsize<2048)
+			{
+				*str++ = '"';
+				strsize++;
+			} else {
+			  printf("line %d: string too long (max 2048 characters)\n",line); exit(-1);
+			}
+		}
 <STRING>\\ 	{
 			if (strsize<2048)
 			{