diff src/variables.cc @ 4437:0a59e4de215e

[project @ 2003-06-24 19:28:48 by jwe]
author jwe
date Tue, 24 Jun 2003 19:28:48 +0000
parents dd7af4fa1942
children 4cc739e3cbd8
line wrap: on
line diff
--- a/src/variables.cc	Tue Jun 24 13:00:12 2003 +0000
+++ b/src/variables.cc	Tue Jun 24 19:28:48 2003 +0000
@@ -603,21 +603,24 @@
 
   if (! retval)
     {
-      std::string file_name = fcn_file_in_path (name);
+      string_vector names (2);
 
-      if ((type == "any" || type == "file") && ! file_name.empty ())
-	{
-	  retval = 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 (! retval)
-    {
-      std::string file_name = oct_file_in_path (name);
-
-      if ((type == "any" || type == "file") && ! file_name.empty ())
+      if (! file_name.empty ())
 	{
-	  retval = 3;
+	  if (type == "any" || type == "file")
+	    {
+	      if (file_name.substr (len-4) == ".oct")
+		retval = 3;
+	      else
+		retval = 2;
+	    }
 	}
     }