Repositories / jai.git

jai.git

Clone (read-only): git clone http://git.guha-anderson.com/git/jai.git

Branch

fix directory check for completion

Author
David Mazieres <dm@uun.org>
Date
2026-03-27 08:51:45 -0700
Commit
edce8dc073c747bcae56490e468c32f63bc54a6c
complete.cc
index f77a880..9f09b5a 100644
--- a/complete.cc
+++ b/complete.cc
@@ -40,7 +40,7 @@ complete_path(int dfd, CompSet &c, bool dir_only)
       continue;
     if (de->d_type == DT_UNKNOWN || de->d_type == DT_LNK) {
       struct stat sb;
-      if (fstatat(dirfd(*d), d_name(de), &sb, 0) && S_ISDIR(sb.st_mode))
+      if (!fstatat(dirfd(*d), d_name(de), &sb, 0) && S_ISDIR(sb.st_mode))
         de->d_type = DT_DIR;
     }
     if (dir_only && de->d_type != DT_DIR)