summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-01-21Rewrite man page in mdocHEADzigYorhel4-581/+519
Still not a fan of roff, but even less a fan of build system stuff and a dependency on a tool that is getting less ubiquitous over time. I've removed the "hard links" section from the man page for now. Such a section might be useful, but much of it was outdated.
2023-12-05Update parent dir suberr on refreshYorhel2-22/+37
Fixes #233
2023-11-20fix new "var never mutated" error on Zig 0.12.0-dev.1663+6b1a823b2Eric Joldasov6-19/+19
Fixes these errors (introduced in https://github.com/ziglang/zig/pull/18017 and https://github.com/ziglang/zig/commit/6b1a823b2b30d9318c9877dbdbd3d02fa939fba0 ): ``` src/main.zig:290:13: error: local variable is never mutated var line_ = line_fbs.getWritten(); ^~~~~ src/main.zig:290:13: note: consider using 'const' src/main.zig:450:17: error: local variable is never mutated var path = std.fs.path.joinZ(allocator, &.{p, "ncdu", "config"}) catch unreachable; ^~~~ src/main.zig:450:17: note: consider using 'const' ... ``` Will be included in future Zig 0.12, this fix is backward compatible: ncdu still builds and runs fine on Zig 0.11.0. Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-11-19replace ncurses_refs.c workaround with pure Zig workaroundEric Joldasov4-46/+11
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-08-08Add --quit-after-scan CLI flag for benchmarkingYorhel1-1/+3
2023-08-04Version 2.3v2.3Yorhel2-1/+8
2023-08-04Makefile: Honor ZIG variable + fix static build for x86Yorhel1-7/+7
2023-08-04Update to Zig 0.11.0Eric Joldasov10-152/+176
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-04-09build.zig: add option for building PIEEric Joldasov1-0/+4
Might be useful for package maintainers. Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-04-02scan.zig: Add explicit cast for struct statfs.f_typeYorhel1-1/+1
Hopefully fixes #221.
2023-03-09Makefile: Add ZIG variable and build targetFlorian Schmaus1-2/+7
The ZIG variable helps to test ncdu with different zig installations, and it allows Gentoo to inject the zig version that should be used to build zig into the Makefile. Also add a phony 'build' target as first target to the Makefile so that it becomes the default target. This allows the Gentoo package to use the default src_compile() function. See also https://bugs.gentoo.org/900547
2023-03-05Add --(enable|disable)-natsort optionsYorhel3-4/+11
2023-03-03UI: Add * indicator to apparent size/disk usage selection + spacingYorhel1-3/+6
More visible than just bold.
2023-02-22Set `headerpad_max_install_names` on DarwinCarlo Cabrera1-0/+5
This is useful for building binary distributions because it allows references to library dependendencies on the build machine to be rewritten appropriately upon installation on the user's machine. Zig also does this in their `build.zig`: https://github.com/ziglang/zig/blob/b52be973dfb7d1408218b8e75800a2da3dc69108/build.zig#L551-L554
2023-01-19Oops, forgot to update the READMEYorhel1-2/+2
2023-01-19Version 2.2.2 + copyright year bumpv2.2.2Yorhel13-14/+18
2023-01-11Work around a Zig ReleaseSafe mode performance regressionYorhel1-1/+4
With a little help from IRC: <ifreund> Ayo: its probaly stupidly copying that array to the stack to do the safety check, pretty sure there's an open issue on this still <ifreund> you may be able to work around the compiler's stupidity by using a pointer to the array or slice or something <Ayo> ifreund: Yup, (&self.rdbuf)[self.rdoff] does the trick, thanks. <ifreund> no problem! should get fixed eventually
2023-01-11Minor doc formatting fix & error message fixYorhel2-2/+2
2022-11-02Fix struct copy and invalid pointer access in Link.path()Yorhel1-1/+1
Interesting case of https://ziglang.org/download/0.10.0/release-notes.html#Escaped-Pointer-to-Parameter
2022-11-02Slightly less hacky Entry struct allocation and initializationYorhel2-55/+51
2022-11-02Use extern instead of packed structs for the data modelYorhel4-133/+130
Still using a few embedded packed structs for those fields that benefit from bit packing. This isn't much cleaner than using packed structs for everything, but it does have better semantics. In particular, all fields (except those inside nested packed structs) are now guaranteed to be byte-aligned and I don't have to worry about the memory representation of integers when pointer-casting between the different Entry types.
2022-10-26Some fixes for building with Zig stage2Yorhel3-7/+9
Building is currently broken on packed struct alignment issues. :/
2022-10-26Fixes for stdlib changesYorhel4-15/+16
2022-10-25Version 2.2.1v2.2.1Yorhel2-1/+5
2022-10-23Fix colors on FreeBSD (and MacOS?) againYorhel2-2/+2
Broken in 1548f9276f48b9d7a378b2e491609fc947f93e6c because I'm an idiot. Probably also fixes #210, but I don't have a Mac to test.
2022-10-17Version 2.2v2.2Yorhel2-1/+8
2022-10-16Fix type signature of ncdu_init_pair()Yorhel1-1/+1
2022-10-15Fix incorrect format string causing invalid export filesTorbjörn Lönnemark1-1/+1
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
2022-08-10Improve exclude pattern matching performance (and behavior, a bit)Yorhel3-20/+343
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.
2022-08-08Fix unreferenced test in model.zigYorhel2-4/+9
The other files were already indirectly referenced, but it's good to make it explicit.
2022-06-15Set default attributes to the whole window during curses initYorhel1-0/+1
Based on #204.
2022-04-28Version 2.1.2v2.1.2Yorhel2-1/+6
2022-04-28Fix build with zig 0.10.0-dev.1946+6f4343b61Yorhel1-1/+1
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.
2022-04-16Fix panic when shortening strings with unicode variation selectorsYorhel1-5/+8
Fixes #199. That's not to say it handles variation selectors or combining marks well, though. This is kind of messy. :(
2022-03-25Version 2.1.1v2.1.1Yorhel3-2/+8
2022-03-24Fix bad assertion in scan.zig:addSpecial()Yorhel1-2/+0
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
2022-03-16Revert default --graph-style to "hash"Yorhel2-3/+3
Because, even in 2022, there are systems where the libc locale is not, in fact, UTF-8. Fixes #186.
2022-03-14Still accept "eigth-block" typo argument for compatYorhel1-1/+1
2022-03-14Fix typo in --graph-style optionPhil Jones3-6/+6
Change "eigth-block" to "eighth-block"
2022-02-07Version 2.1; remove 1.x changes from the ChangeLogv2.1Yorhel2-194/+11
2022-02-07Fix compilation on 32bit systemsYorhel1-1/+1
Broken in 7d2905952d956801050baaed08eb092fb22f661f
2022-02-05scan: Add UI message when counting hard linksYorhel1-2/+17
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.
2022-02-03Add --graph-style option and Unicode graph drawingYorhel3-6/+30
And also adjust the graph width calculation to do a better job when the largest item is smaller than the number of columns used for the graph, which would previously draw either nothing (if size = 0) or a full bar (if size > 0). Fixes #172.
2022-02-03Use natsort when sorting by nameYorhel2-3/+108
Fixes #181, now also for Zig.
2022-02-02Mention --ignore-config flag when reading config failsYorhel1-3/+3
2022-02-02Ignore ENOTDIR when trying to open config filesYorhel1-0/+1
2022-02-02browser: Fix long file name overflow + unique size display glitchYorhel1-2/+2
2022-01-01Version 2.0.1 + copyright year bumpv2.0.1Yorhel13-14/+19
2022-01-01Makefile: Add ZIG_FLAGS variableYorhel1-1/+2
Fixes #185
2021-12-26ui.zig: Really fix import of wcwidth() this timeYorhel1-1/+1
Fixes #183