Skip to content
Snippets Groups Projects
Commit 4046cfb8 authored by fangq's avatar fangq
Browse files

loadjson quotation mark escape bug, see http://bit.ly/yyk1nS

git-svn-id: http://svn.code.sf.net/p/iso2mesh/code/trunk/jsonlab@358 786e58fb-9377-0410-9ff7-e4ac0ac0635c
parent ab8f3e3b
Branches
Tags
No related merge requests found
......@@ -3,7 +3,7 @@
"value": "_&File",
"popup": {
"menuitem": [
{"value": "_&New", "onclick": "CreateNewDoc(\"\")"},
{"value": "_&New", "onclick": "CreateNewDoc(\"\"\")"},
{"value": "_&Open", "onclick": "OpenDoc()"},
{"value": "_&Close", "onclick": "CloseDoc()"}
]
......
......@@ -50,6 +50,10 @@ end
pos = 1; len = length(string); inStr = string;
isoct=exist('OCTAVE_VERSION');
arraytoken=find(inStr=='[' | inStr==']' | inStr=='"');
jstr=inStr;
jstr=regexprep(jstr,'\\\\',' ');
escquote=regexp(jstr,'\\"');
arraytoken=sort([arraytoken escquote]);
% String delimiters and escape chars identified to improve speed:
esc = find(inStr=='"' | inStr=='\' ); % comparable to: regexp(inStr, '["\\]');
......@@ -452,7 +456,7 @@ while(pos<len)
end
pos=pos+1;
end
error('unmatched quotation mark');
%%-------------------------------------------------------------------------
function [endpos e1l e1r maxlevel] = matching_bracket(str,pos)
global arraytoken
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment