diff src/octave.cc @ 1766:e8e76be43e79

[project @ 1996-01-23 03:33:34 by jwe]
author jwe
date Tue, 23 Jan 1996 03:34:14 +0000
parents 3a9462b655f1
children e6d79e281f7d
line wrap: on
line diff
--- a/src/octave.cc
+++ b/src/octave.cc
@@ -55,6 +55,7 @@
 #include "dynamic-ld.h"
 #include "error.h"
 #include "file-io.h"
+#include "file-ops.h"
 #include "help.h"
 #include "input.h"
 #include "lex.h"
@@ -65,7 +66,6 @@
 #include "pathsearch.h"
 #include "procstream.h"
 #include "sighandlers.h"
-#include "statdefs.h"
 #include "sysdep.h"
 #include "pt-const.h"
 #include "pt-misc.h"
@@ -241,14 +241,15 @@
 
       // Names alone are not enough.
 
-      struct stat home_rc_statbuf;
-      stat (home_rc.c_str (), &home_rc_statbuf);
+      file_stat fs_home_rc (home_rc);
 
-      struct stat dot_rc_statbuf;
-      stat ("./.octaverc", &dot_rc_statbuf);
+      if (fs_home_rc)
+	{
+	  file_stat fs_dot_rc ("./.octaverc");
 
-      if (home_rc_statbuf.st_ino == dot_rc_statbuf.st_ino)
-	home_rc_already_executed = 1;
+	  if (fs_dot_rc && fs_home_rc.ino () == fs_dot_rc.ino ())
+	    home_rc_already_executed = 1;
+	}
     }
 
   if (! home_rc_already_executed)