# HG changeset patch # User jwe # Date 1052671271 0 # Node ID 6b191c6e6875ebdeba2172a9545ab36f47526a52 # Parent e50ef03af9baf6f66cb24158478a8fe250c9705b [project @ 2003-05-11 16:41:10 by jwe] diff --git a/liboctave/Array-idx.h b/liboctave/Array-idx.h --- a/liboctave/Array-idx.h +++ b/liboctave/Array-idx.h @@ -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); diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,13 @@ +2003-05-11 John W. Eaton + + * Array-idx.h (Array::index): Fix off-by-one error. + +2003-05-07 John W. Eaton + + * 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 * kpse.cc (dir_list_add): Ensure that directory ends with a diff --git a/liboctave/kpse.cc b/liboctave/kpse.cc --- a/liboctave/kpse.cc +++ b/liboctave/kpse.cc @@ -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);