diff liboctave/kpse.cc @ 4409:6b191c6e6875

[project @ 2003-05-11 16:41:10 by jwe]
author jwe
date Sun, 11 May 2003 16:41:11 +0000
parents 16e8acbd19d5
children 34438519fac3
line wrap: on
line diff
--- a/liboctave/kpse.cc	Tue May 06 19:06:49 2003 +0000
+++ b/liboctave/kpse.cc	Sun May 11 16:41:11 2003 +0000
@@ -705,16 +705,17 @@
 {
   size_t len = filename.length ();
 
-  int absolute = IS_DIR_SEP (len > 0 && filename[0])
+  int absolute = (len > 0 && IS_DIR_SEP (filename[0]))
 #ifdef DOSISH
                      /* Novell allows non-alphanumeric drive letters. */
-                     || (len > 0 && IS_DEVICE_SEP (filename[1]))
+    || (len > 0 && IS_DEVICE_SEP (filename[1]))
 #endif /* DOSISH */
 #ifdef WIN32
                      /* UNC names */
-                     || (len > 1 && filename[0] == '\\' && filename[1] == '\\')
+    || (len > 1 && filename[0] == '\\' && filename[1] == '\\')
 #endif
-		      ;
+    ;
+
   int explicit_relative
     = relative_ok
       && (len > 1
@@ -1148,6 +1149,23 @@
 	       path.c_str (), must_exist);
     }
 
+  for (int i = 0; i < names.length (); i++)
+    {
+      std::string name = names[i];
+
+      if (kpse_absolute_p (name, true))
+	{
+	  /* If the name is absolute or explicitly relative, no need
+	     to consider PATH at all.  If we find something, then we
+	     are done.  */
+
+	  ret_list = absolute_search (name);
+
+	  if (! ret_list.empty ())
+	    return ret_list;
+	}
+    }
+
   /* Find the file. */
   ret_list = path_find_first_of (path, names, must_exist, all);