diff --git a/matlab/utilities/doc/dynInfo.m b/matlab/utilities/doc/dynInfo.m
index 31dff4973..2b8381cd0 100644
--- a/matlab/utilities/doc/dynInfo.m
+++ b/matlab/utilities/doc/dynInfo.m
@@ -41,11 +41,18 @@ function dynInfo(fun)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see .
-dynare_config([],0);
+if isempty(strfind(fun,'@')) & (~isempty(strfind(fun,'/')) || ~isempty(strfind(fun,'\')) )
+ [pathstr1, name, ext] = fileparts(fun);
+ addpath(pathstr1);
+ rm_path = 1;
+else
+ rm_path = 0;
+end
+
+[pathstr2, name, ext] = fileparts(which(fun));
-[pathstr, name, ext] = fileparts(which(fun));
if strcmp(ext(2:end),'m')
- block = get_internal_doc_block(name,pathstr);
+ block = get_internal_doc_block(name,pathstr2);
if ~isempty(block)
fid = fopen([fun '.texi'],'wt');
for i=1:size(block,1)
@@ -61,4 +68,8 @@ if strcmp(ext(2:end),'m')
end
else
disp('Not a known matlab/octave routine!')
+end
+
+if rm_path
+ rmpath(pathstr1)
end
\ No newline at end of file
diff --git a/matlab/utilities/tests/dynTest.m b/matlab/utilities/tests/dynTest.m
index 43d4aa6b2..40a842f62 100644
--- a/matlab/utilities/tests/dynTest.m
+++ b/matlab/utilities/tests/dynTest.m
@@ -41,15 +41,25 @@ function dynTest(fun)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see .
-dynare_config([],0);
+if isempty(strfind(fun,'@')) & (~isempty(strfind(fun,'/')) || ~isempty(strfind(fun,'\')) )
+ [pathstr1, name, ext] = fileparts(fun);
+ addpath(pathstr1);
+ rm_path = 1;
+else
+ rm_path = 0;
+end
-[pathstr, name, ext] = fileparts(which(fun));
+[pathstr2, name, ext] = fileparts(which(fun));
-if ~( isempty(pathstr) || isempty(name) || isempty(ext) ) && strcmp(ext(2:end),'m')
- check = mtest(name,pathstr);
+if ~( isempty(pathstr2) || isempty(name) || isempty(ext) ) && strcmp(ext(2:end),'m')
+ check = mtest(name,pathstr2);
if check
disp(['Succesfull test(s) for ' fun ' routine!'])
end
else
disp([fun 'is not a known matlab/octave routine!'])
+end
+
+if rm_path
+ rmpath(pathstr1)
end
\ No newline at end of file