Mercurial > octave-nkf
diff scripts/plot/util/hgload.m @ 18633:348f67886dc4
hgload.m: Check for file with .ofig extension before bare file name (bug #41978).
* hgload.m: Check for file with .ofig extension before bare file name.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 28 Mar 2014 08:47:55 -0700 |
parents | 70d9db29db6f |
children | a142f35f3cb6 |
line wrap: on
line diff
--- a/scripts/plot/util/hgload.m Tue Mar 25 17:00:41 2014 +0000 +++ b/scripts/plot/util/hgload.m Fri Mar 28 08:47:55 2014 -0700 @@ -33,18 +33,21 @@ if (nargin != 1) print_usage (); endif - + ## Check file existence - if (isempty (file_in_loadpath (filename))) - [~, ~, ext] = fileparts (filename); - if (isempty (ext)) + [~, ~, ext] = fileparts (filename); + if (isempty (ext)) + if (! isempty (file_in_loadpath ([filename ".ofig"]))) filename = [filename ".ofig"]; + elseif (isempty (file_in_loadpath (filename))) + error ("hgload: unable to locate file %s", filename); endif + else if (isempty (file_in_loadpath (filename))) error ("hgload: unable to locate file %s", filename); endif endif - + ## Load the handle try stmp = load (filename, "s_oct40");