diff src/parse.y @ 5472:e2f85b298a74

[project @ 2005-09-23 21:10:36 by jwe]
author jwe
date Fri, 23 Sep 2005 21:10:36 +0000
parents c7e3cf2fce3e
children 2ff5363a16bd
line wrap: on
line diff
--- a/src/parse.y	Fri Sep 23 20:06:35 2005 +0000
+++ b/src/parse.y	Fri Sep 23 21:10:36 2005 +0000
@@ -3362,12 +3362,25 @@
 
   string_vector names (2);
 
-  names[0] = nm + ".oct";
-  names[1] = nm + ".m";
-
-  std::string file
-   = octave_env::make_absolute (Vload_path_dir_path.find_first_of (names),
-                                octave_env::getcwd ());
+  int nm_len = nm.length ();
+
+  std::string file;
+
+  if (octave_env::absolute_pathname (nm)
+      && ((nm_len > 4 && nm.substr (nm_len-4) == ".oct")
+	  || (nm_len > 2 && nm.substr (nm_len-4) == ".m")))
+    {
+      file = nm;
+    }
+  else
+    {
+      names[0] = nm + ".oct";
+      names[1] = nm + ".m";
+
+      file
+	= octave_env::make_absolute (Vload_path_dir_path.find_first_of (names),
+				     octave_env::getcwd ());
+    }
 
   int len = file.length ();