> Please let me know how the relpath patch works for you.
Here's a better version of the relpath patch, which should apply more cleanly
to the bash-4.2.24 source tree.
Chet
*** ../bash-4.2-direxpand/bashline.c 2012-03-13 16:34:46.000000000 -0400
--- bashline.c 2012-03-13 16:36:41.000000000 -0400
***************
*** 249,252 ****
--- 249,253 ----
/* Expand directory names during word/filename completion. */
int dircomplete_expand = 0;
+ int dircomplete_expand_relpath = 0;
static char *bash_completer_word_break_characters = " \t\n\"'@><=;|&(:";
***************
*** 2856,2859 ****
--- 2857,2871 ----
}
+ /* no_symbolic_links == 0 -> use (default) logical view of the file system.
+ local_dirname[0] == '.' && local_dirname[1] == '/' means files in the
+ current directory (./).
+ local_dirname[0] == '.' && local_dirname[1] == 0 means relative pathnames
+ in the current directory (e.g., lib/sh).
+ XXX - should we do spelling correction on these? */
+
+ /* This is test as it was in bash-4.2: skip relative pathnames in current
+ directory. Change test to
+ (local_dirname[0] != '.' || (local_dirname[1] && local_dirname[1] !=
'/'))
+ if we want to skip paths beginning with ./ also. */
if (no_symbolic_links == 0 && (local_dirname[0] != '.' || local_dirname[1]))
{
***************
*** 2861,2864 ****
--- 2873,2885 ----
int len1, len2;
+ /* If we have a relative path
+ (local_dirname[0] != '/' && local_dirname[0] != '.')
+ that is canonical after appending it to the current directory, then
+ temp1 = temp2+'/'
+ That is,
+ strcmp (temp1, temp2) == 0
+ after adding a slash to temp2 below. It should be safe to not
+ change those.
+ */
t = get_working_directory ("symlink-hook");
temp1 = make_absolute (local_dirname, t);
***************
*** 2895,2899 ****
}
}
! return_value |= STREQ (local_dirname, temp2) == 0;
free (local_dirname);
*dirname = temp2;
--- 2916,2928 ----
}
}
!
! /* dircomplete_expand_relpath == 0 means we want to leave relative
! pathnames that are unchanged by canonicalization alone.
! *local_dirname != '/' && *local_dirname != '.' == relative pathname
! (consistent with general.c:absolute_pathname())
! temp1 == temp2 (after appending a slash to temp2) means the pathname
! is not changed by canonicalization as described above. */
! if (dircomplete_expand_relpath || ((local_dirname[0] != '/' &&
local_dirname[0] != '.') && STREQ (temp1, temp2) == 0))
! return_value |= STREQ (local_dirname, temp2) == 0;
free (local_dirname);
*dirname = temp2;
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/