Repository: eza-community/eza (language: rust)

Issue:
bug: Stack Overflow on recursive listing
If eza does something unexpected, or its output looks wrong, or it displays an error on the screen, or if it outright crashes, then please include the following information in your report:

- The version of eza being used (`eza --version`)
0.17.0
- The command-line arguments you are using
`-laaR ~`
- Your operating system and hardware platform
GNU/Linux (Linux Mint 21, x86_64)

If it’s a crash, please include the full text of the crash that gets printed to the screen. If you’re seeing unexpected behaviour, a screenshot of the issue will help a lot.

    thread 'main' has overflowed its stack
    fatal runtime error: stack overflow
    Aborted

---
The problem seems to have something to do with having two `-a` arguments, as removing one (or doing a non-recursive search) seems to fix the issue. Also, IDK when this bug first appeared, but IIRC 0.14 works as it should.


Discussion / hints:

Fix patch:
diff --git a/src/output/color_scale.rs b/src/output/color_scale.rs
index 8192ebabd..742313a93 100644
--- a/src/output/color_scale.rs
+++ b/src/output/color_scale.rs
@@ -139,7 +139,13 @@ fn update_information_recursively(
             Extremes::update(size, &mut information.size);
         }
 
-        if file.is_directory() && r.is_some_and(|x| !x.is_too_deep(depth.0)) {
+        // We don't want to recurse into . and .., but still want to list them, therefore bypass
+        // the dot_filter.
+        if file.is_directory()
+            && r.is_some_and(|x| !x.is_too_deep(depth.0))
+            && file.name != "."
+            && file.name != ".."
+        {
             match file.to_dir() {
                 Ok(dir) => {
                     let files: Vec<File<'_>> = dir


Test patch: