瀏覽代碼

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 年之前
父節點
當前提交
897a50acd2
共有 1 個文件被更改,包括 9 次插入0 次删除
  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)
 			{