changeset 4409:6b191c6e6875

[project @ 2003-05-11 16:41:10 by jwe]
author jwe
date Sun, 11 May 2003 16:41:11 +0000
parents e50ef03af9ba
children b6bc72f02a9b
files liboctave/Array-idx.h liboctave/ChangeLog liboctave/kpse.cc
diffstat 3 files changed, 33 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array-idx.h	Tue May 06 19:06:49 2003 +0000
+++ b/liboctave/Array-idx.h	Sun May 11 16:41:11 2003 +0000
@@ -101,7 +101,7 @@
 	  for (int i = 0; i < n; i++)
 	    {
 	      int ii = idx_arg.elem (i);
-	      if (ii > len)
+	      if (ii >= len)
 		retval.elem (i) = resize_fill_value;
 	      else
 		retval.elem (i) = elem (ii);
--- a/liboctave/ChangeLog	Tue May 06 19:06:49 2003 +0000
+++ b/liboctave/ChangeLog	Sun May 11 16:41:11 2003 +0000
@@ -1,3 +1,13 @@
+2003-05-11  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* Array-idx.h (Array<T>::index): Fix off-by-one error.
+
+2003-05-07  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* kpse.cc (kpse_absolute_p): Fix typo in translation.
+	(find_first_of): Also do an absolute search on each
+	name before looking in the path.
+
 2003-05-04  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* kpse.cc (dir_list_add): Ensure that directory ends with a
--- 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);