Only remaining options missing from this C implementation are
--graph-style (sounds doable, but pretty low priority) and
--shared-column (unlikely to happen).
this breaks ncdu with musl 1.2.2, if the madvise syscall isn't implemented,
in which case realloc sets errno.
if errno is to be used, it needs to be set to 0 and checked after every
single libc call that could modify it.
interestingly, in the condition that the error is set here, ncdu just
prints nothing and silently quits with exit status 0 (success).
(maybe an error is being printed, but before the terminal is put back into
a normal state.)
The dark-bg scheme draws an explicit black background, so should also be
readable in terminals with a light background. That's been the main
show-stopper for enabling colors by default, as the 'dark' color scheme
is totally unreadable on light backgrounds and there's no way to detect
what background the terminal is actually using.
In some cases the bar width may be 1 block short due to imprecise
floating point calculations. i.e. (max_width * a) / a != max_width,
whereas (max_width * (a/a)) == max_width. Or, at least, that's what I've
observed so far.
This should really have been accepted from the start. Adding extra
elements to the top-level array might be useful for aux. data related to
the scanned files, e.g. map of seen uid/gids to names, information about
the scanned dev ids, etc. But since ncdu would throw an error on further
array elements, adding such information can't be done without breaking
compat with older versions. :(
Bumping the minor version of the file format to '2'.
The "ino" field is only interesting for hardlinks, so we can save space
by not exporting it for other entries.
The hlink count will be interesting later on when I implement tracking
of shared data between directories. It's currently ignored on import.
The "nlink" field makes the "hlnkc" field redundant, but let's keep
including that field anyway for backwards compatibility.