Skip to content

Commit eaca339

Browse files
committed
File path is wrongly inerpreted as JSON string
for example the following paths will be interpreted as JSON string: - D:\project\some [folder] name\example.json - C:\project\some {folder} name\example.json
1 parent 8e3a395 commit eaca339

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

loadjson.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
global pos inStr len esc index_esc len_esc isoct arraytoken
6565

66-
if(regexp(fname,'[\{\}\]\[]','once'))
66+
if(regexp(fname,'^\s*(?:\[.+\])|(?:\{.+\})\s*$','once'))
6767
string=fname;
6868
elseif(exist(fname,'file'))
6969
try

0 commit comments

Comments
 (0)