changeset 970:b23956fb257c octave-forge

proper interpretation of file_in_path return value for failed case
author pkienzle
date Tue, 10 Jun 2003 20:44:22 +0000
parents cc49f2be13c1
children 4f8b63cf745e
files main/miscellaneous/slurp_file.m
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/main/miscellaneous/slurp_file.m	Tue Jun 10 20:42:42 2003 +0000
+++ b/main/miscellaneous/slurp_file.m	Tue Jun 10 20:44:22 2003 +0000
@@ -10,7 +10,7 @@
 function s = slurp_file (f)
 
 if ! isstr (f),  error ("slurp_file :  f  is not a string"); end
-if ! length (f), error ("slurp_file :  f  is empty"); end
+if isempty (f), error ("slurp_file :  f  is empty"); end
 
 s = "";
 
@@ -20,11 +20,11 @@
   f = file_in_path (LOADPATH, f);
 				# Could not find it anywhere. Open will
 				# fail.
-  if strcmp (f, "undefined"),  
+  if isempty (f)
     f = f0;
     error ("slurp_file : Can't find '%s' anywhere",f0);
   end
 end
 
 ## I'll even get decent error messages!
-s = system (sprintf ("cat %s",f), 1);
\ No newline at end of file
+s = system (sprintf ("cat %s",f), 1);