소스 검색

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)
 			{