From eaca33978dbc7e7f0a96feb16aa078a329cb1ce5 Mon Sep 17 00:00:00 2001
From: Mykhailo Bratukha <bratukha.m@gmail.com>
Date: Tue, 10 Nov 2015 12:43:17 +0100
Subject: [PATCH] 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
---
 loadjson.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/loadjson.m b/loadjson.m
index 9fe0995..41fc45c 100644
--- a/loadjson.m
+++ b/loadjson.m
@@ -63,7 +63,7 @@ function data = loadjson(fname,varargin)
 
 global pos inStr len  esc index_esc len_esc isoct arraytoken
 
-if(regexp(fname,'[\{\}\]\[]','once'))
+if(regexp(fname,'^\s*(?:\[.+\])|(?:\{.+\})\s*$','once'))
    string=fname;
 elseif(exist(fname,'file'))
    try
-- 
GitLab