diff src/variables.cc @ 5138:5fa9670b5956

[project @ 2005-02-09 23:13:03 by jwe]
author jwe
date Wed, 09 Feb 2005 23:13:03 +0000
parents b04b30d30c66
children 550b12564a74
line wrap: on
line diff
--- a/src/variables.cc
+++ b/src/variables.cc
@@ -957,6 +957,20 @@
   return retval;
 }
 
+// Return TRUE if F and G are both names for the same file.
+
+static bool
+same_file (const std::string& f, const std::string& g)
+{
+  std::string c_f = file_ops::canonicalize_file_name (f);
+  std::string c_g = file_ops::canonicalize_file_name (g);
+
+  file_stat f_fs (c_f);
+  file_stat g_fs (c_g);
+
+  return (f_fs.ino () == g_fs.ino () && f_fs.dev () == g_fs.dev ());
+}
+
 // Is there a corresponding function file that is newer than the
 // symbol definition?
 
@@ -994,9 +1008,7 @@
 		    (Vload_path_dir_path.find_first_of (names),
 		     octave_env::getcwd ());
 
-		  if (file != ff)
-		    retval = true;
-		  else
+		  if (same_file (file, ff))
 		    {
 		      tmp->mark_fcn_file_up_to_date (octave_time ());
 
@@ -1005,6 +1017,8 @@
 		      if (fs && fs.is_newer (tp))
 			retval = true;
 		    }
+		  else
+		    retval = true;
 		}
 	    }
 	}