File: bashline-dir-comp.dpatch

package info (click to toggle)
bash 2.05b-2-26
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,336 kB
  • ctags: 50
  • sloc: sh: 45,451; makefile: 446; ansic: 268
file content (37 lines) | stat: -rw-r--r-- 1,200 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh -e

if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

# DP: Fix tab completion on relative path directories

--- bash-2.05b/bashline.c.003fix	2003-01-26 22:24:57.000000000 +0000
+++ bash-2.05b/bashline.c	2003-01-26 22:26:05.000000000 +0000
@@ -1055,6 +1055,7 @@
 	     filenames and leave directories in the match list. */
 	  if (matches == (char **)NULL)
 	    rl_ignore_some_completions_function = bash_ignore_filenames;
+#if 0
 	  else if (matches[1] == 0 && CMD_IS_DIR(matches[0]))
 	    /* Turn off rl_filename_completion_desired so readline doesn't
 	       append a slash if there is a directory with the same name
@@ -1074,6 +1075,7 @@
 	       completion.  If there are multiple completions this won't
 	       make a difference and the problem won't occur. */
 	    rl_filename_completion_desired = 0;
+#endif
 	}
     }