Просмотр исходного кода

fix: filetype, coloring for executables and folder

When the reuse filetype code was introduced, an if statements logic was
accidentally flipped, marking exectuables as folders, and folders as
executables.

This incorporates the proposed patch by jschpp in #1195.

Refs: #883
Closes: #1195 #1196
Co-authored-by: =?UTF-8?q?Johannes=20Sch=C3=B6pp?= <darkdiscover@gmail.com>
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen 1 год назад
Родитель
Сommit
f80b882a74
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/fs/file.rs

+ 1 - 1
src/fs/file.rs

@@ -334,7 +334,7 @@ impl<'dir> File<'dir> {
     #[cfg(unix)]
     #[cfg(unix)]
     pub fn is_executable_file(&self) -> bool {
     pub fn is_executable_file(&self) -> bool {
         let bit = modes::USER_EXECUTE;
         let bit = modes::USER_EXECUTE;
-        if self.is_file() {
+        if !self.is_file() {
             return false;
             return false;
         }
         }
         let Ok(md) = self.metadata() else {
         let Ok(md) = self.metadata() else {