Skip to content
Snippets Groups Projects
  1. Oct 15, 2022
    • Torbjörn Lönnemark's avatar
      Fix incorrect format string causing invalid export files · d6728bca
      Torbjörn Lönnemark authored
      Zig requires alignment to be specified when specifying a fill character,
      as otherwise digits specified after ':' are interpreted as part of the
      field width.
      
      The missing alignment specifier caused character codes < 0x10 to be
      serialized incorrectly, producing an export file ncdu could not import.
      
      For example, a character with code 1 would be serialized as '\u00 1'
      instead of '\u0001'.
      
      A directory of test files can be generated using:
      
          mkdir test_files; i=1; while [ $i -le 255 ]; do c="$(printf "$(printf "\\\\x%02xZ" "$i")")"; c="${c%Z}"; touch "test_files/$c"; i=$((i+1)); done
      d6728bca
  2. Aug 10, 2022
    • Yorhel's avatar
      Improve exclude pattern matching performance (and behavior, a bit) · d523a77f
      Yorhel authored
      Behavioral changes:
      - A single wildcard ('*') does not cross directory boundary anymore.
        Previously 'a*b' would also match 'a/b', but no other tool that I am
        aware of matches paths that way. This change breaks compatibility with
        old exclude patterns but improves consistency with other tools.
      - Patterns with a trailing '/' now prevent recursing into the directory.
        Previously any directory excluded with such a pattern would show up as
        a regular directory with all its contents excluded, but now the
        directory entry itself shows up as excluded.
      - If the path given to ncdu matches one of the exclude patterns, the old
        implementation would exclude every file/dir being read, this new
        implementation would instead ignore the rule. Not quite sure how to
        best handle this case, perhaps just exit with an error message?
      
      Performance wise, I haven't yet found a scenario where this
      implementation is slower than the old one and it's *significantly*
      faster in some cases - in particular when using a large amount of
      patterns, especially with literal paths and file names.
      
      That's not to say this implementation is anywhere near optimal:
      - A list of relevant patterns is constructed for each directory being
        scanned. It may be possible to merge pattern lists that share
        the same prefix, which could both reduce memory use and the number of
        patterns that need to be matched upon entering a directory.
      - A hash table with dynamic arrays as values is just garbage from a
        memory allocation point of view.
      - This still uses libc fnmatch(), but there's an opportunity to
        precompile patterns for faster matching.
      d523a77f
  3. Aug 08, 2022
  4. Jun 15, 2022
  5. Apr 28, 2022
    • Yorhel's avatar
      Version 2.1.2 · e6806059
      Yorhel authored
    • Yorhel's avatar
      Fix build with zig 0.10.0-dev.1946+6f4343b61 · bb98939e
      Yorhel authored
      I wasn't planning on (publicly) keeping up with Zig master before the
      next release, but it's looking like 0.10 will mainly focus on the new
      stage2 compiler and there might not be any significant language/stdlib
      changes. If that's the case, might as well pull in this little change in
      order to increase chances of ncdu working out of the box when 0.10 is
      out.
      bb98939e
  6. Apr 16, 2022
  7. Mar 25, 2022
  8. Mar 24, 2022
    • Yorhel's avatar
      Fix bad assertion in scan.zig:addSpecial() · 5f383966
      Yorhel authored
      While it's true that the root item can't be a special, the first item to
      be added is not necessarily the root item. In particular, it isn't when
      refreshing.
      
      Probably fixes #194
      5f383966
  9. Mar 16, 2022
  10. Mar 14, 2022
  11. Feb 07, 2022
  12. Feb 05, 2022
    • Yorhel's avatar
      scan: Add UI message when counting hard links · e42db579
      Yorhel authored
      That *usually* doesn't take longer than a few milliseconds, but it can
      take a few seconds for some extremely large dirs, on very slow computers
      or with optimizations disabled. Better display a message than make it
      seem as if ncdu has stopped doing anything.
      e42db579
  13. Feb 03, 2022
  14. Feb 02, 2022
  15. Jan 01, 2022
  16. Dec 26, 2021
  17. Dec 21, 2021
  18. Nov 09, 2021
  19. Nov 02, 2021
    • Yorhel's avatar
      Fix export feature · 5b462cfb
      Yorhel authored
      ...by making sure that Context.parents is properly initialized to null
      when not scanning to RAM.
      
      Fixes #179.
      5b462cfb
  20. Oct 07, 2021
  21. Oct 06, 2021
  22. Oct 05, 2021
    • Yorhel's avatar
      Add CLI options for all UI settings · 900d31f6
      Yorhel authored
      + reorder manpage a bit, since the scan options tend to be more relevant
      than all those UI options.
      
      Again, these are mainly useful with a config file.
      900d31f6
    • Yorhel's avatar
      Document the 'u' key · d005e7c6
      Yorhel authored
      Might as well keep it. The quick-config menu popup idea can always be
      implemented later on, we're not running out of keys quite yet.
      d005e7c6
Loading