changeset 5140:550b12564a74

[project @ 2005-02-10 15:12:37 by jwe]
author jwe
date Thu, 10 Feb 2005 15:12:37 +0000
parents f2858bbf0277
children f51d2e9681f4
files src/ChangeLog src/variables.cc
diffstat 2 files changed, 45 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Feb 10 14:08:30 2005 +0000
+++ b/src/ChangeLog	Thu Feb 10 15:12:37 2005 +0000
@@ -1,3 +1,9 @@
+2005-02-10  John W. Eaton  <jwe@octave.org>
+
+	* variables.cc (symbol_exist): Don't search path if explicitly
+	asked for a variable or builtin.  From David Bateman
+	<dbateman@free.fr>.
+
 2005-02-09  John W. Eaton  <jwe@octave.org>
 
 	* variables.cc (same_file): New static function.
--- a/src/variables.cc	Thu Feb 10 14:08:30 2005 +0000
+++ b/src/variables.cc	Thu Feb 10 15:12:37 2005 +0000
@@ -823,49 +823,52 @@
 	}
     }
 
-  if (! retval)
+  if (! (type == "var" || type == "builtin"))
     {
-      string_vector names (2);
-
-      names(0) = name + ".oct";
-      names(1) = name + ".m";
-
-      std::string file_name = Vload_path_dir_path.find_first_of (names);
-
-      size_t len = file_name.length ();
-
-      if (! file_name.empty ())
+      if (! retval)
 	{
-	  if (type == "any" || type == "file")
+	  string_vector names (2);
+
+	  names(0) = name + ".oct";
+	  names(1) = name + ".m";
+
+	  std::string file_name = Vload_path_dir_path.find_first_of (names);
+
+	  size_t len = file_name.length ();
+
+	  if (! file_name.empty ())
 	    {
-	      if (file_name.substr (len-4) == ".oct")
-		retval = 3;
-	      else
-		retval = 2;
+	      if (type == "any" || type == "file")
+		{
+		  if (file_name.substr (len-4) == ".oct")
+		    retval = 3;
+		  else
+		    retval = 2;
+		}
 	    }
 	}
-    }
-
-  if (! retval)
-    {
-      std::string file_name = file_in_path (name, "");
-
-      if (file_name.empty ())
-	file_name = name;
-
-      file_stat fs (file_name);
-
-      if (fs)
+
+      if (! retval)
 	{
-	  if ((type == "any" || type == "file")
-	      && fs.is_reg ())
+	  std::string file_name = file_in_path (name, "");
+
+	  if (file_name.empty ())
+	    file_name = name;
+
+	  file_stat fs (file_name);
+
+	  if (fs)
 	    {
-	      retval = 2;
-	    }
-	  else if ((type == "any" || type == "dir")
-		   && fs.is_dir ())
-	    {
-	      retval = 7;
+	      if ((type == "any" || type == "file")
+		  && fs.is_reg ())
+		{
+		  retval = 2;
+		}
+	      else if ((type == "any" || type == "dir")
+		       && fs.is_dir ())
+		{
+		  retval = 7;
+		}
 	    }
 	}
     }