Mercurial > octave
changeset 25437:5523d88bb5d3
* open.m: Check arg type before checking file type.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 06 Jun 2018 13:13:20 -0400 |
parents | 996d78102a71 |
children | cb1606f78f6b |
files | scripts/miscellaneous/open.m |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/open.m Wed Jun 06 12:41:03 2018 -0400 +++ b/scripts/miscellaneous/open.m Wed Jun 06 13:13:20 2018 -0400 @@ -61,14 +61,16 @@ if (nargin != 1) print_usage (); - elseif (! exist (file, "file")) - error ("open: unable to find file %s", file); endif if (! ischar (file)) error ("open: FILE must be a string"); endif + if (! exist (file, "file")) + error ("open: unable to find file %s", file); + endif + [~, fname, ext] = fileparts (file); if (! isempty (ext)