File: bash205b-003.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 (77 lines) | stat: -rw-r--r-- 2,813 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /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 -p0 < $0;;
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

# DP: bash-2.05b upstream patch 003

			     BASH PATCH REPORT
			     =================

Bash-Release: 2.05b
Patch-ID: bash205b-003

Bug-Reported-by:   jan.q.bruun-andersen@posten.se
Bug-Reference-ID:  <BE156C6450189B4ABAF7381F0AD4724A0165674F@002exmbs002.ad.posten.se>
Bug-Reference-URL: http://mail.gnu.org/pipermail/bug-bash/2002-July/004789.html

Bug-Description:

In certain cases, Bash appends a space instead of a slash to a directory
name relative to the current directory when performing command name
completion.  This affects partial completion of intermediate directory
names.

Patch:

*** ../bash-2.05b/bashline.c	Tue May  7 15:52:42 2002
--- bashline.c	Sat Aug  3 11:40:16 2002
***************
*** 1045,1049 ****
--- 1045,1052 ----
        else
  	{
+ #define CMD_IS_DIR(x)	(absolute_pathname(x) == 0 && *(x) != '~' && test_for_directory (x))
+ 
  	  matches = rl_completion_matches (text, command_word_completion_function);
+ 
  	  /* If we are attempting command completion and nothing matches, we
  	     do not want readline to perform filename completion for us.  We
***************
*** 1053,1057 ****
  	  if (matches == (char **)NULL)
  	    rl_ignore_some_completions_function = bash_ignore_filenames;
! 	  else if (matches[1] == 0 && *matches[0] != '/')
  	    /* Turn off rl_filename_completion_desired so readline doesn't
  	       append a slash if there is a directory with the same name
--- 1056,1060 ----
  	  if (matches == (char **)NULL)
  	    rl_ignore_some_completions_function = bash_ignore_filenames;
! 	  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
***************
*** 1062,1066 ****
  	       conflict. */
  	    rl_filename_completion_desired = 0;
! 	  else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && *matches[0] != '/')
  	    /* There are multiple instances of the same match (duplicate
  	       completions haven't yet been removed).  In this case, all of
--- 1065,1069 ----
  	       conflict. */
  	    rl_filename_completion_desired = 0;
! 	  else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0]))
  	    /* There are multiple instances of the same match (duplicate
  	       completions haven't yet been removed).  In this case, all of