Package: file-rc
Version: 0.8.10
Tags: patch
Followup-For: Bug #310456

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It's been a while, but here's the fix.

- -- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19-ck2
Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8)

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFoovC823633cP2P8RAnGTAJ0RvT38ODxdaW4Ef6A5PZ2N3GpzXQCeKxdU
T94u1qDtK4QJwwZvpkY6JW8=
=kbKQ
-----END PGP SIGNATURE-----
--- file-rc.orig        2007-01-08 15:14:56.000000000 -0300
+++ file-rc     2007-01-08 15:14:37.000000000 -0300
@@ -8,17 +8,21 @@
 have invoke-rc.d &&
 _invoke_rcd()
 {
-    if [ $(basename $3) == invoke-rc.d ]; then
+    local cur prev
+    cur=${COMP_WORDS[COMP_CWORD]}
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+
+    if [ $(basename $prev) == invoke-rc.d ]; then
          COMPREPLY=($(find /etc/init.d -maxdepth 1 -type f \
-                           -perm +0111 -name "$2*" -printf '%f\n'))
+                           -perm +0111 -name "$cur*" -printf '%f\n'))
     else
-       if [ -z $2 ]; then
+       if [ -z $cur ]; then
          COMPREPLY=(start stop restart reload force-reload)
        else
          k=0
          for i in start stop restart reload force-reload; do
             case $i in
-               $2*) COMPREPLY[$k]=$i; k=$(($k+1));;
+               $cur*) COMPREPLY[$k]=$i; k=$(($k+1));;
             esac
          done
        fi

Reply via email to