# HG changeset patch # User Rik # Date 1396021675 25200 # Node ID 348f67886dc4d2dedca7efb05826e79db2895308 # Parent 29f00c0d0657a087e094c71bb39c4b27202f7eff 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. diff -r 29f00c0d0657 -r 348f67886dc4 scripts/plot/util/hgload.m --- 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");