1
1
Граф коммитов

370 Коммитов

Автор SHA1 Сообщение Дата
rofl0r
abab9d360d dir_scan: fix wrong assumption that errno can only be changed by readdir()
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.)
2021-10-27 13:40:41 +00:00
Oğuz Ersen
96a9231927
Make options, keys and file flags bold in man page 2021-10-06 20:07:17 +03:00
Yorhel
376aad0d35 Add dark-bg color scheme + enable colors by default if !NO_COLOR
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.
2021-08-16 16:07:51 +02:00
Yorhel
f982af81b0 Year + version bump for 1.16 2021-07-02 13:30:55 +02:00
Yorhel
52daeafcd8 Display setuid/setgid and sticky bits in file mode
Same way that coreutils 'ls -l' displays them.
2021-06-11 11:13:14 +02:00
Yorhel
bd01f5773d JSON import: accept fractional mtime values
For sub-second precision, if we ever want to add that.
2021-05-27 10:33:01 +02:00
Yorhel
67a1d84216 Mark apparent size or disk usage label in footer as bold
Depending on what is being displayed. Not *super* happy with this
solution, but it works.

Fixes #110.
2021-05-24 10:42:51 +02:00
Yorhel
ebeee7be01 browser.c: Fix bar width floating point calculation
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.
2021-05-23 14:26:29 +02:00
Yorhel
a6b4aead43 Add $NCDU_LEVEL environment variable when spawning a shell
Similar to $SHLVL and $RANGER_LEVEL.
2021-05-12 16:30:43 +02:00
Yorhel
e278660464 dir_import: Accept JSON data after the last object
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. :(
2021-05-12 16:04:36 +02:00
Yorhel
ca51d4ed1a JSON Export: only export ino for hlinks and include hlink count
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.
2021-05-12 11:28:26 +02:00
Yorhel
9337cdc99e Test for read error while reading the --exclude-from file
Fixes #171
2021-03-04 16:07:48 +01:00
Christian Göttsche
a216bc2d35 Scale size bar with max column size
Use 'max(10, column_size / 7)' instead of a fixed size of 10
2020-07-12 18:30:02 +02:00
Yorhel
1035aed81a Version bump for 1.15.1 2020-06-10 12:24:34 +02:00
Yorhel
a389443c9a Add --exclude-firmlinks and follow firmlinks by default
What a mess.

https://code.blicky.net/yorhel/ncdu/issues/153#issuecomment-764
2020-06-07 10:03:11 +02:00
Christian Göttsche
c340980b80 is_kernfs: Check only defined magic numbers
Avoid undeclared identifiers when compiling with older kernel headers.
2020-06-05 18:04:11 +02:00
Christian Göttsche
19cfe9b15c Correct misspellings 2020-05-30 19:26:00 +02:00
Yorhel
239bbf542f Version bump for 1.15 2020-05-30 10:02:02 +02:00
Yorhel
d018dc0be6 dir_import.c: Remove already-implemented TODO comment 2020-05-15 09:09:35 +02:00
Yorhel
1c4d191193 help.c: Mention "F" flag + make the flag list scrollable 2020-05-15 09:02:16 +02:00
Yorhel
bff5da3547 man page: Mention --follow-firmlinks 2020-05-15 08:51:08 +02:00
Yorhel
08564ec7b6 dir_scan.c: Call statfs() with relative path
So we get around the PATH_MAX limitation. Also a tiny bit more
efficient, I hope.
2020-05-15 08:43:45 +02:00
Saagar Jha
c9ce16a633 Support excluding firmlinks on macOS 2020-05-13 11:29:55 -07:00
Saagar Jha
684e9e04ad Typo: exlude → exclude 2020-05-07 16:10:07 -07:00
Yorhel
9a3727759c Fix calculating of directory apparent sizes with hard links
Silly one-character typo that causes directory apparent sizes to be very
off in some scenarios.

Reported & patched by Andrew Neitsch.
2020-05-06 07:04:36 +02:00
Yorhel
4a2def5223 dir_scan.c: Fix integer overflow when list of file names in dir exceeds 2GiB
Fixes #150
2020-04-21 14:13:51 +02:00
Yorhel
1563e56223 help.c: Mention new ^ file flag 2020-04-08 18:35:01 +02:00
Christian Göttsche
c209b012b1 Add option --exclude-kernfs to skip scanning Linux pseudo filesystems
(cherry picked from commit a076ac714aa6fb24e0e9eb227372df84a4b6000b)
2020-04-08 18:32:11 +02:00
Christian Göttsche
50b48a6435 Mention supported color schemes in help text 2020-04-08 17:17:06 +02:00
Christian Göttsche
e3742f0c80 Remove redundant cast to the same type
(cherry picked from commit ef7b4e5c28739c26b3a120296f9dc2ddaf2d4375)
2020-04-08 11:00:41 +02:00
Christian Göttsche
3959210051 Drop never read initialization
(cherry picked from commit 9f28920a64c155957b83324cd3a3cf0fda6020c9)
2020-04-08 10:59:25 +02:00
Christian Göttsche
84834ff370 Declare file local variables static
(cherry picked from commit ad5b7fce74a3b7b0ed726620c81ea552c643cdad)
2020-04-08 10:58:53 +02:00
Christian Göttsche
53e5080d9a Avoid using extension of variable length array folded to constant array
(cherry picked from commit 2faefc3b2432409f3ccca0b6ab53a228d5b9b00d)
2020-04-08 10:57:23 +02:00
Christian Göttsche
61d268764d Drop extra ';' outside of a function
(cherry picked from commit 32b77d0064d3e5f52e9204ddeffc29bb21a67753)
2020-04-08 10:55:57 +02:00
Christian Göttsche
2bd83b3f22 Avoid using GNU empty initializer extension
(cherry picked from commit ce7036d249b6f05633c343ab95d88552aab85402)
2020-04-08 10:55:36 +02:00
Christian Göttsche
70f439d9a9 Enforce const correctness on strings
(cherry picked from commit 9801f46ece0ca2525f02d71464efc42296dddcb5)
2020-04-08 10:53:21 +02:00
Christian Göttsche
39709aa665 Use strict prototypes
(cherry picked from commit e4e8ebd9e0037812436a1588809deb23e0f3751a)
2020-04-08 10:52:25 +02:00
Christian Göttsche
bd22bf42ee Update configure.ac
* Use AS_HELP_STRING instead of deprecated AC_HELP_STRING
* Use AC_OUTPUT without arguments
* Enclose AC_INIT argument in brackets
* Add automake option std-options

(cherry picked from commit 53a33e1db2c9a58b867f7db26c5f476c3ee4b00b)
2020-04-08 10:48:14 +02:00
Christian Göttsche
227cdb35ae Ignore generated script compile in git
(cherry picked from commit fd75bd0c22a0ab6935ac5332999ebe77c6d8a1c8)
2020-04-08 10:45:24 +02:00
Christian Göttsche
2fd4d8b406 Remove trailing whitespaces 2020-04-07 21:49:14 +02:00
Yorhel
888bd663c6 Also quit on EIO from getch()
Fixes #141
2020-04-01 16:54:57 +02:00
Yorhel
8d58297328 Year + version bump for 1.14.2 2020-02-10 16:02:26 +01:00
Yorhel
5c5cd163a1 Fix khash.h -> khashl.h reference in Makefile 2020-02-06 08:58:10 +01:00
Yorhel
2d76190091 deps/khash.h -> khashl.h for slightly reduced memory usage
Reduces memory by a tiny bit. Arguably we never needed tombstones
because entries are never removed, so there shouldn't be any performance
hit there. We don't even need a 'used' flag either, considering that can
be represented by a NULL value, but I'm not really up for
implementing/modifying my own hash table.

ref: https://attractivechaos.wordpress.com/2019/12/28/deletion-from-hash-tables-without-tombstones/
2020-02-04 19:15:48 +01:00
Yorhel
ecb71f2550 Fix definitions of global vars confirm_quit and dir_process
They were defined (rather than just declared) in .h files, when they
really should be defined in at most a single .c file.

Fixes #140.
2020-01-25 09:25:11 +01:00
Yorhel
7875a76bba static: Add AArch64 binaries 2019-12-15 10:12:13 +01:00
Yorhel
a5e08cf597 Fix cross compiler targets
I assumed that ./configure would fail if it can't find a suitable
compiler for the given --host, but it just falls back to the host gcc.

Fixes #138
2019-11-14 19:00:32 +01:00
Yorhel
62bc78d937 Increase space for item count in loading screen
Fixes #135
2019-08-17 10:35:51 +02:00
Yorhel
72189c307f Version bump for 1.14.1 + static bin improvements 2019-08-05 08:22:22 +02:00
Yorhel
dc8b6cfaab Fix --exclude-caches
Broken in 77aca35fce
Fixes #134
2019-08-04 17:31:59 +02:00