changeset 25432:d8aa0e66aa5c

open.m: check the requested file exists (bug #54064) open.m: error out if the file doesn't exist.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Wed, 06 Jun 2018 14:07:04 +0200
parents 6782d1f0fe54
children 49e0447413ad
files scripts/miscellaneous/open.m
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/open.m	Tue Jun 05 20:57:36 2018 +0200
+++ b/scripts/miscellaneous/open.m	Wed Jun 06 14:07:04 2018 +0200
@@ -61,6 +61,8 @@
 
   if (nargin != 1)
     print_usage ();
+  elseif (! exist (file, "file"))
+    error ("open: unable to find file %s", file);
   endif
 
   if (! ischar (file))