summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-03-04Experiment with scanning using openat() rather than chdir()openatYorhel6-173/+87
A slightly different approach. In terms of syscalls it probably doesn't matter at all, but it's a simpler, less hacky and maybe more efficient way to work around PATH_MAX limitations than constantly chdir()'ing for each directory. Should also fix the chdir("..") fail case in MacOS firmlink scenarios, though I haven't a clue if MacOS implements all these openat()-related calls in the first place. Downsides: - Less portable. Everything is in POSIX, but it's more recent than what we used to use. - Requires more open file descriptions, might hit the limit for deeply nested directories. Haven't done much testing yet, but there's a bunch of TODO's: - Make refreshing work again (not sure what's going wrong there) - See if we can report readdir() etc errors again? - Make firmlink detection work again? - See how portable this really is. - Also update file deletion code
2021-03-04Test for read error while reading the --exclude-from fileYorhel1-1/+2
Fixes #171
2020-07-12Scale size bar with max column sizeChristian Göttsche1-5/+5
Use 'max(10, column_size / 7)' instead of a fixed size of 10
2020-06-10Version bump for 1.15.1v1.15.1Yorhel3-3/+8
2020-06-07Add --exclude-firmlinks and follow firmlinks by defaultYorhel2-10/+20
What a mess. https://code.blicky.net/yorhel/ncdu/issues/153#issuecomment-764
2020-06-05is_kernfs: Check only defined magic numbersChristian Göttsche1-2/+29
Avoid undeclared identifiers when compiling with older kernel headers.
2020-05-30Correct misspellingsChristian Göttsche8-10/+10
2020-05-30Version bump for 1.15v1.15Yorhel3-3/+11
2020-05-15dir_import.c: Remove already-implemented TODO commentYorhel1-1/+0
2020-05-15help.c: Mention "F" flag + make the flag list scrollableYorhel1-19/+23
2020-05-15man page: Mention --follow-firmlinksYorhel1-3/+8
2020-05-15dir_scan.c: Call statfs() with relative pathYorhel1-1/+1
So we get around the PATH_MAX limitation. Also a tiny bit more efficient, I hope.
2020-05-13Support excluding firmlinks on macOSSaagar Jha7-3/+51
2020-05-07Typo: exlude → excludeSaagar Jha1-1/+1
2020-05-06Fix calculating of directory apparent sizes with hard linksYorhel1-1/+1
Silly one-character typo that causes directory apparent sizes to be very off in some scenarios. Reported & patched by Andrew Neitsch.
2020-04-21dir_scan.c: Fix integer overflow when list of file names in dir exceeds 2GiBYorhel1-3/+3
Fixes #150
2020-04-08help.c: Mention new ^ file flagYorhel1-6/+8
2020-04-08Add option --exclude-kernfs to skip scanning Linux pseudo filesystemsChristian Göttsche9-14/+87
(cherry picked from commit a076ac714aa6fb24e0e9eb227372df84a4b6000b)
2020-04-08Mention supported color schemes in help textChristian Göttsche1-1/+1
2020-04-08Remove redundant cast to the same typeChristian Göttsche1-1/+1
(cherry picked from commit ef7b4e5c28739c26b3a120296f9dc2ddaf2d4375)
2020-04-08Drop never read initializationChristian Göttsche1-1/+1
(cherry picked from commit 9f28920a64c155957b83324cd3a3cf0fda6020c9)
2020-04-08Declare file local variables staticChristian Göttsche5-6/+6
(cherry picked from commit ad5b7fce74a3b7b0ed726620c81ea552c643cdad)
2020-04-08Avoid using extension of variable length array folded to constant arrayChristian Göttsche1-4/+3
(cherry picked from commit 2faefc3b2432409f3ccca0b6ab53a228d5b9b00d)
2020-04-08Drop extra ';' outside of a functionChristian Göttsche1-1/+1
(cherry picked from commit 32b77d0064d3e5f52e9204ddeffc29bb21a67753)
2020-04-08Avoid using GNU empty initializer extensionChristian Göttsche1-1/+1
(cherry picked from commit ce7036d249b6f05633c343ab95d88552aab85402)
2020-04-08Enforce const correctness on stringsChristian Göttsche6-15/+15
(cherry picked from commit 9801f46ece0ca2525f02d71464efc42296dddcb5)
2020-04-08Use strict prototypesChristian Göttsche12-26/+26
(cherry picked from commit e4e8ebd9e0037812436a1588809deb23e0f3751a)
2020-04-08Update configure.acChristian Göttsche1-5/+6
* 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-08Ignore generated script compile in gitChristian Göttsche1-0/+1
(cherry picked from commit fd75bd0c22a0ab6935ac5332999ebe77c6d8a1c8)
2020-04-07Remove trailing whitespacesChristian Göttsche2-2/+2
2020-04-01Also quit on EIO from getch()Yorhel1-1/+1
Fixes #141
2020-02-10Year + version bump for 1.14.2v1.14.2Yorhel30-30/+35
2020-02-06Fix khash.h -> khashl.h reference in MakefileYorhel1-2/+2
2020-02-04deps/khash.h -> khashl.h for slightly reduced memory usageYorhel3-624/+357
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-01-25Fix definitions of global vars `confirm_quit` and `dir_process`Yorhel4-2/+3
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.
2019-12-15static: Add AArch64 binariesYorhel1-0/+1
2019-11-14Fix cross compiler targetsYorhel1-4/+4
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-08-17Increase space for item count in loading screenYorhel1-2/+2
Fixes #135
2019-08-05Version bump for 1.14.1 + static bin improvementsv1.14.1Yorhel4-5/+11
2019-08-04Fix --exclude-cachesYorhel1-1/+1
Broken in 77aca35fce59b222254e0dec6ba03249b8d96f78 Fixes #134
2019-07-23Handle malloc failure by pausing any activityYorhel12-37/+68
This is a best-effort approach to save ncdu state when memory is low. There's likely allocation in libraries that isn't being checked (ncurses, printf). Fixes #132 (it actually doesn't, that needs a 64bit static binary too, but I'll get to that)
2019-04-19Clear errno before getch()Yorhel1-0/+1
Fixes #128.
2019-02-19dir_scan: Avoid allocating new copies of buf_dirMartin Storsjö1-1/+2
This allocation is currently leaked, but as long as we don't allocate new ones for each refresh, that shouldn't be much of an issue. (cherry picked from commit 9dc2d32a8fb557112f8f96cd14d50b934543ce39)
2019-02-18dir_setlasterr: strcpy the right variableMartin Storsjö1-1/+1
2019-02-04Year + version bump for 1.14v1.14Yorhel30-30/+40
2019-01-24symlinks: Only call stat_to_dir() once, impove manualYorhel2-12/+12
stat_to_dir() assumes that buf_dir is clean; calling it twice breaks that asumption.
2019-01-24Add a '--follow-symlinks' optionSimon Doppler4-0/+17
Symlink loops are handled by the stat(2) syscall. Symlinks pointing to a directory are ignored (to avoid loops in the recursive scan).
2019-01-21Fix minor typoYorhel1-1/+1
2019-01-21add a max modified time, or mtime, view and sortingAlex Wilson8-10/+84
This adds an 'm' command to show the latest modified time of all files in a directory. The 'M' command allows for ascending and descending mtime sorting. These are only enabled with the -e flag and overload the dir_ext mtime field.
2019-01-20Fix crash when attempting to sort an empty directoryYorhel1-1/+2
I had taken care to not sort empty directories during dirlist_open(), but forgot that manual user actions can still cause dirlist_set_sort() to be called, which does not handle empty directories. Reported by Alex Wilson.