[Pkg-libvirt-commits] [libguestfs] 20/59: fish: fix dir completion on filesystems w/o dirent.d_type (RHBZ#1153844).

Hilko Bengen bengen at moszumanska.debian.org
Wed Nov 26 22:04:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit e44a3ea1bf187e6f65f41dd7e59b7ea9cce9ddbb
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Fri Oct 31 17:37:22 2014 +0100

    fish: fix dir completion on filesystems w/o dirent.d_type (RHBZ#1153844).
    
    On filesystems whose dirent.d_type is DT_UNKNOWN or some unknown value,
    manually check whether an entry is a directory, thus completing in the
    proper way.
    
    (cherry picked from commit a8b95a5535480c7b382fab82dcaf18eb67e5278a)
---
 fish/destpaths.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fish/destpaths.c b/fish/destpaths.c
index f224106..df1ec00 100644
--- a/fish/destpaths.c
+++ b/fish/destpaths.c
@@ -191,7 +191,13 @@ complete_dest_paths_generator (const char *text, int state)
                   else {
                     words = w;
                     words[nr_words].name = p;
-                    words[nr_words].is_dir = dirents->val[i].ftyp == 'd';
+                    if (dirents->val[i].ftyp == 'u'
+                        || dirents->val[i].ftyp == '?') {
+                      int is_dir = guestfs_is_dir_opts (g, words[nr_words].name,
+                        GUESTFS_IS_DIR_OPTS_FOLLOWSYMLINKS, 1, -1);
+                      words[nr_words].is_dir = is_dir;
+                    } else
+                      words[nr_words].is_dir = dirents->val[i].ftyp == 'd';
                     nr_words++;
                   }
                 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list