[BusyBox 0003034]: Auto completion of symbolic links to catalogs broken in ash

bugs at busybox.net bugs at busybox.net
Wed Apr 23 20:59:05 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=3034 
====================================================================== 
Reported By:                234d
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   3034
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             04-22-2008 03:15 PDT
Last Modified:              04-23-2008 13:59 PDT
====================================================================== 
Summary:                    Auto completion of symbolic links to catalogs broken
in ash
Description: 
When I try to auto complete a symbolic link to a directory I get a space
instead of a slash at the end. This worked fine in 1.9.1 but not in
1.10.1.

# ls -l
drwxr-xr-x   2 root     root           0 Apr 22 12:00 bar
lrwxrwxrwx   1 root     root           3 Apr 22 12:00 foo -> bar
# ls -l foo<tab>[space]
====================================================================== 

---------------------------------------------------------------------- 
 vda - 04-23-08 13:39  
---------------------------------------------------------------------- 
bash 3.2 behavior:

adds '/' on "real" directories:
sh-3.2# /usr/m68k-uc[TAB] -> /usr/m68k-uclinux/

adds '/' on symlinks to dirs, on SECOND tab:
sh-3.2# /usr/srcd[TAB] -> /usr/srcdevel[TAB] -> /usr/srcdevel/

So that neither old nor current ash behavior matches that.

Anyway. This is how it can be fixed in libbb/lineedit.c:

                        found = concat_path_file(paths[i], str_found);
-                       /* hmm, remover in progress? */
-                       if (lstat(found, &st) < 0)
+                       /* hmm, remove in progress? */
+                       /* NB: stat() first so that we see is it a
directory;
+                        * but if that fails, use lstat() so that
+                        * we still match dangling links */
+                       if (stat(found, &st) && lstat(found, &st))
                                goto cont; 

---------------------------------------------------------------------- 
 bernhardf - 04-23-08 13:59  
---------------------------------------------------------------------- 
vda, sounds fine to me (didn't test it, of course). Please apply. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-22-08 03:15  234d           New Issue                                    
04-22-08 03:15  234d           Status                   new => assigned     
04-22-08 03:15  234d           Assigned To               => BusyBox         
04-23-08 13:39  vda            Note Added: 0007014                          
04-23-08 13:59  bernhardf      Note Added: 0007024                          
======================================================================




More information about the busybox-cvs mailing list