diff -Nru ncdu-1.13/aclocal.m4 ncdu-1.14.1/aclocal.m4 --- ncdu-1.13/aclocal.m4 2018-01-29 10:58:44.000000000 +0000 +++ ncdu-1.14.1/aclocal.m4 2019-08-05 06:11:30.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -296,7 +296,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR -# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -308,10 +308,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15.1], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -327,14 +327,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15.1])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -386,7 +386,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -417,7 +417,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -608,13 +608,12 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -622,49 +621,41 @@ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -673,18 +664,17 @@ # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -771,8 +761,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. @@ -839,7 +829,7 @@ Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -881,7 +871,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -902,7 +892,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2017 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -923,7 +913,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -931,49 +921,42 @@ # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2017 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1012,7 +995,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1041,7 +1024,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1088,7 +1071,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1107,7 +1090,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1188,7 +1171,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1248,7 +1231,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1276,7 +1259,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2017 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1295,7 +1278,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2017 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru ncdu-1.13/ChangeLog ncdu-1.14.1/ChangeLog --- ncdu-1.13/ChangeLog 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/ChangeLog 2019-08-05 06:10:52.000000000 +0000 @@ -1,3 +1,18 @@ +1.14.1 - 2019-08-05 + - Fix occasional early exit on OS X + - Fix --exclude-caches + - Improve handling of out-of-memory situations + +1.14 - 2019-02-04 + - Add mtime display and sorting (Alex Wilson) + - Add (limited) --follow-symlinks option (Simon Doppler) + - Display larger file counts in browser UI + - Add -V, --version, and --help alias flags + - Fix crash when attempting to sort an empty directory + - Fix 100% CPU bug when ncdu loses the terminal + - Fix '--color=off' flag + - Fix some typos + 1.13 - 2018-01-29 - Add "extended information" mode and -e flag - Add file mode, modification time and uid/gid to info window with -e diff -Nru ncdu-1.13/compile ncdu-1.14.1/compile --- ncdu-1.13/compile 2018-01-29 10:58:45.000000000 +0000 +++ ncdu-1.14.1/compile 2019-08-05 06:11:31.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -340,7 +340,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -Nru ncdu-1.13/configure ncdu-1.14.1/configure --- ncdu-1.13/configure 2018-01-29 10:58:44.000000000 +0000 +++ ncdu-1.14.1/configure 2019-08-05 06:11:30.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ncdu 1.13. +# Generated by GNU Autoconf 2.69 for ncdu 1.14.1. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='ncdu' PACKAGE_TARNAME='ncdu' -PACKAGE_VERSION='1.13' -PACKAGE_STRING='ncdu 1.13' +PACKAGE_VERSION='1.14.1' +PACKAGE_STRING='ncdu 1.14.1' PACKAGE_BUGREPORT='projects@yorhel.nl' PACKAGE_URL='' @@ -642,7 +642,6 @@ AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -716,7 +715,8 @@ PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -1281,7 +1281,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ncdu 1.13 to adapt to many kinds of systems. +\`configure' configures ncdu 1.14.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1347,7 +1347,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ncdu 1.13:";; + short | recursive ) echo "Configuration of ncdu 1.14.1:";; esac cat <<\_ACEOF @@ -1457,7 +1457,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ncdu configure 1.13 +ncdu configure 1.14.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2013,7 +2013,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ncdu $as_me 1.13, which was +It was created by ncdu $as_me 1.14.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2364,7 +2364,7 @@ ac_config_headers="$ac_config_headers config.h" -am__api_version='1.15' +am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2879,7 +2879,7 @@ # Define the identity of the package. PACKAGE='ncdu' - VERSION='1.13' + VERSION='1.14.1' cat >>confdefs.h <<_ACEOF @@ -2909,8 +2909,8 @@ # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The @@ -2961,7 +2961,7 @@ Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3825,45 +3825,45 @@ ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -5799,7 +5799,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ncdu $as_me 1.13, which was +This file was extended by ncdu $as_me 1.14.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5865,7 +5865,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ncdu config.status 1.13 +ncdu config.status 1.14.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -5984,7 +5984,7 @@ # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF @@ -6596,29 +6596,35 @@ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -6636,53 +6642,48 @@ q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; diff -Nru ncdu-1.13/configure.ac ncdu-1.14.1/configure.ac --- ncdu-1.13/configure.ac 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/configure.ac 2019-08-05 06:11:22.000000000 +0000 @@ -1,5 +1,5 @@ -AC_INIT(ncdu, 1.13, projects@yorhel.nl) +AC_INIT(ncdu, 1.14.1, projects@yorhel.nl) AC_CONFIG_SRCDIR([src/global.h]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([foreign subdir-objects]) diff -Nru ncdu-1.13/COPYING ncdu-1.14.1/COPYING --- ncdu-1.13/COPYING 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/COPYING 2019-02-04 15:50:09.000000000 +0000 @@ -1,4 +1,4 @@ -Copyright (c) 2007-2018 Yoran Heling +Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/debian/changelog ncdu-1.14.1/debian/changelog --- ncdu-1.13/debian/changelog 2019-10-15 08:09:36.000000000 +0000 +++ ncdu-1.14.1/debian/changelog 2019-09-08 07:50:47.000000000 +0000 @@ -1,3 +1,14 @@ +ncdu (1.14.1-1) unstable; urgency=low + + * New upstream release. (Closes: #821750) + * debian/source/format: + - Introduced, with '3.0 (quilt)'. + * debian/patches: + - 0001-Increase-space-for-item-count-in-loading-screen: added + (cherry-picked from upstream). (Closes: #931444) + + -- Eugene V. Lyubimkin Sun, 08 Sep 2019 09:50:47 +0200 + ncdu (1.13-1) unstable; urgency=low * New upstream release. diff -Nru ncdu-1.13/debian/patches/0001-Increase-space-for-item-count-in-loading-screen.patch ncdu-1.14.1/debian/patches/0001-Increase-space-for-item-count-in-loading-screen.patch --- ncdu-1.13/debian/patches/0001-Increase-space-for-item-count-in-loading-screen.patch 1970-01-01 00:00:00.000000000 +0000 +++ ncdu-1.14.1/debian/patches/0001-Increase-space-for-item-count-in-loading-screen.patch 2019-09-08 07:50:47.000000000 +0000 @@ -0,0 +1,26 @@ +From: Yorhel +Date: Sat, 17 Aug 2019 10:35:50 +0200 +Subject: Increase space for item count in loading screen + +Fixes #135 +--- + src/dir_common.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dir_common.c b/src/dir_common.c +index 3a2a9d0..f17fa2c 100644 +--- a/src/dir_common.c ++++ b/src/dir_common.c +@@ -119,10 +119,10 @@ static void draw_progress() { + + ncaddstr(2, 2, "Total items: "); + uic_set(UIC_NUM); +- printw("%-8d", dir_output.items); ++ printw("%-9d", dir_output.items); + + if(dir_output.size) { +- ncaddstrc(UIC_DEFAULT, 2, 23, "size: "); ++ ncaddstrc(UIC_DEFAULT, 2, 24, "size: "); + printsize(UIC_DEFAULT, dir_output.size); + } + diff -Nru ncdu-1.13/debian/patches/series ncdu-1.14.1/debian/patches/series --- ncdu-1.13/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ ncdu-1.14.1/debian/patches/series 2019-09-08 07:50:47.000000000 +0000 @@ -0,0 +1 @@ +0001-Increase-space-for-item-count-in-loading-screen.patch diff -Nru ncdu-1.13/debian/source/format ncdu-1.14.1/debian/source/format --- ncdu-1.13/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ ncdu-1.14.1/debian/source/format 2019-09-08 07:50:47.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru ncdu-1.13/depcomp ncdu-1.14.1/depcomp --- ncdu-1.13/depcomp 2018-01-29 10:58:45.000000000 +0000 +++ ncdu-1.14.1/depcomp 2019-08-05 06:11:31.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,7 +783,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -Nru ncdu-1.13/doc/ncdu.pod ncdu-1.14.1/doc/ncdu.pod --- ncdu-1.13/doc/ncdu.pod 2018-01-23 13:17:16.000000000 +0000 +++ ncdu-1.14.1/doc/ncdu.pod 2019-01-24 07:55:04.000000000 +0000 @@ -20,11 +20,11 @@ =over -=item -h +=item -h, --help Print a short help message and quit. -=item -v +=item -v, -V, --version Print ncdu version and quit. @@ -67,6 +67,9 @@ effect when importing a file that has been exported without the extended information. +This enables viewing and sorting by the latest child mtime, or modified time, +using 'm' and 'M', respectively. + =back =head2 Interface options @@ -169,6 +172,13 @@ usage statistics. See http://www.brynosaurus.com/cachedir/ +=item -L, --follow-symlinks + +Follow symlinks and count the size of the file they point to. As of ncdu 1.14, +this option will not follow symlinks to directories and will count each +symlinked file as a unique file (i.e. unlike how hard links are handled). This +is subject to change in later versions. + =back @@ -208,6 +218,11 @@ Toggle between showing disk usage and showing apparent size. +=item M + +Order by latest child mtime, or modified time. (press again for descending order) +Requires the -e flag. + =item d Delete the selected file or directory. An error message will be shown when the @@ -228,6 +243,10 @@ Toggle display of child item counts. +=item m + +Toggle display of latest child mtime, or modified time. Requires the -e flag. + =item e Show/hide 'hidden' or 'excluded' files and directories. Please note that even @@ -263,6 +282,45 @@ =back + +=head1 FILE FLAGS + +Entries in the browser interface may be prefixed by a one-character flag. These +flags have the following meaning: + +=over + +=item ! + +An error occurred while reading this directory. + +=item . + +An error occurred while reading a subdirectory, so the indicated size may not be +correct. + +=item < + +File or directory is excluded from the statistics by using exlude patterns. + +=item > + +Directory is on another filesystem. + +=item @ + +This is neither a file nor a folder (symlink, socket, ...). + +=item H + +Same file was already counted (hard link). + +=item e + +Empty directory. + +=back + =head1 EXAMPLES diff -Nru ncdu-1.13/install-sh ncdu-1.14.1/install-sh --- ncdu-1.13/install-sh 2018-01-29 10:58:45.000000000 +0000 +++ ncdu-1.14.1/install-sh 2019-08-05 06:11:31.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -271,15 +271,18 @@ fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,6 +291,11 @@ fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then @@ -324,34 +332,43 @@ # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; @@ -427,8 +444,8 @@ else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 @@ -493,7 +510,7 @@ done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -Nru ncdu-1.13/Makefile.in ncdu-1.14.1/Makefile.in --- ncdu-1.13/Makefile.in 2018-01-29 10:58:45.000000000 +0000 +++ ncdu-1.14.1/Makefile.in 2019-08-05 06:11:31.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -127,7 +127,15 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = src/$(DEPDIR)/browser.Po src/$(DEPDIR)/delete.Po \ + src/$(DEPDIR)/dir_common.Po src/$(DEPDIR)/dir_export.Po \ + src/$(DEPDIR)/dir_import.Po src/$(DEPDIR)/dir_mem.Po \ + src/$(DEPDIR)/dir_scan.Po src/$(DEPDIR)/dirlist.Po \ + src/$(DEPDIR)/exclude.Po src/$(DEPDIR)/help.Po \ + src/$(DEPDIR)/main.Po src/$(DEPDIR)/path.Po \ + src/$(DEPDIR)/quit.Po src/$(DEPDIR)/shell.Po \ + src/$(DEPDIR)/util.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -374,8 +382,8 @@ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) @@ -485,21 +493,27 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/browser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/delete.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_common.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_export.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_import.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_mem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_scan.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dirlist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/exclude.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/help.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/path.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/quit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/shell.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/browser.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/delete.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_common.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_export.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_import.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_mem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dir_scan.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dirlist.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/exclude.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/help.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/path.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/quit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/shell.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/util.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @@ -619,7 +633,10 @@ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -827,7 +844,21 @@ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf src/$(DEPDIR) + -rm -f src/$(DEPDIR)/browser.Po + -rm -f src/$(DEPDIR)/delete.Po + -rm -f src/$(DEPDIR)/dir_common.Po + -rm -f src/$(DEPDIR)/dir_export.Po + -rm -f src/$(DEPDIR)/dir_import.Po + -rm -f src/$(DEPDIR)/dir_mem.Po + -rm -f src/$(DEPDIR)/dir_scan.Po + -rm -f src/$(DEPDIR)/dirlist.Po + -rm -f src/$(DEPDIR)/exclude.Po + -rm -f src/$(DEPDIR)/help.Po + -rm -f src/$(DEPDIR)/main.Po + -rm -f src/$(DEPDIR)/path.Po + -rm -f src/$(DEPDIR)/quit.Po + -rm -f src/$(DEPDIR)/shell.Po + -rm -f src/$(DEPDIR)/util.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags @@ -875,7 +906,21 @@ maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf src/$(DEPDIR) + -rm -f src/$(DEPDIR)/browser.Po + -rm -f src/$(DEPDIR)/delete.Po + -rm -f src/$(DEPDIR)/dir_common.Po + -rm -f src/$(DEPDIR)/dir_export.Po + -rm -f src/$(DEPDIR)/dir_import.Po + -rm -f src/$(DEPDIR)/dir_mem.Po + -rm -f src/$(DEPDIR)/dir_scan.Po + -rm -f src/$(DEPDIR)/dirlist.Po + -rm -f src/$(DEPDIR)/exclude.Po + -rm -f src/$(DEPDIR)/help.Po + -rm -f src/$(DEPDIR)/main.Po + -rm -f src/$(DEPDIR)/path.Po + -rm -f src/$(DEPDIR)/quit.Po + -rm -f src/$(DEPDIR)/shell.Po + -rm -f src/$(DEPDIR)/util.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -897,9 +942,9 @@ .MAKE: all install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-cscope clean-generic cscope \ - cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ + check-am clean clean-binPROGRAMS clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-tags distcleancheck distdir \ diff -Nru ncdu-1.13/missing ncdu-1.14.1/missing --- ncdu-1.13/missing 2018-01-29 10:58:45.000000000 +0000 +++ ncdu-1.14.1/missing 2019-08-05 06:11:31.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,7 +207,7 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -Nru ncdu-1.13/ncdu.1 ncdu-1.14.1/ncdu.1 --- ncdu-1.13/ncdu.1 2018-01-23 13:19:18.000000000 +0000 +++ ncdu-1.14.1/ncdu.1 2019-02-04 15:52:44.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) +.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "NCDU 1" -.TH NCDU 1 "2018-01-23" "ncdu-1.12g" "ncdu manual" +.TH NCDU 1 "2019-01-24" "ncdu-1.14" "ncdu manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -147,11 +147,11 @@ .IX Header "OPTIONS" .SS "Mode Selection" .IX Subsection "Mode Selection" -.IP "\-h" 4 -.IX Item "-h" +.IP "\-h, \-\-help" 4 +.IX Item "-h, --help" Print a short help message and quit. -.IP "\-v" 4 -.IX Item "-v" +.IP "\-v, \-V, \-\-version" 4 +.IX Item "-v, -V, --version" Print ncdu version and quit. .IP "\-f \fI\s-1FILE\s0\fR" 4 .IX Item "-f FILE" @@ -188,6 +188,9 @@ when importing (to read this extra information in memory). This flag has no effect when importing a file that has been exported without the extended information. +.Sp +This enables viewing and sorting by the latest child mtime, or modified time, +using 'm' and 'M', respectively. .SS "Interface options" .IX Subsection "Interface options" .IP "\-0" 4 @@ -264,10 +267,16 @@ by a newline. .IP "\-\-exclude\-caches" 4 .IX Item "--exclude-caches" -Exclude directories containing \s-1CACHEDIR.TAG. \s0 The directories will still be +Exclude directories containing \s-1CACHEDIR.TAG.\s0 The directories will still be displayed, but not their content, and they are not counted towards the disk usage statistics. See http://www.brynosaurus.com/cachedir/ +.IP "\-L, \-\-follow\-symlinks" 4 +.IX Item "-L, --follow-symlinks" +Follow symlinks and count the size of the file they point to. As of ncdu 1.14, +this option will not follow symlinks to directories and will count each +symlinked file as a unique file (i.e. unlike how hard links are handled). This +is subject to change in later versions. .SH "KEYS" .IX Header "KEYS" .IP "?" 4 @@ -293,6 +302,10 @@ .IP "a" 4 .IX Item "a" Toggle between showing disk usage and showing apparent size. +.IP "M" 4 +.IX Item "M" +Order by latest child mtime, or modified time. (press again for descending order) +Requires the \-e flag. .IP "d" 4 .IX Item "d" Delete the selected file or directory. An error message will be shown when the @@ -309,6 +322,9 @@ .IP "c" 4 .IX Item "c" Toggle display of child item counts. +.IP "m" 4 +.IX Item "m" +Toggle display of latest child mtime, or modified time. Requires the \-e flag. .IP "e" 4 .IX Item "e" Show/hide 'hidden' or 'excluded' files and directories. Please note that even @@ -339,6 +355,27 @@ .IP "q" 4 .IX Item "q" Quit +.SH "FILE FLAGS" +.IX Header "FILE FLAGS" +Entries in the browser interface may be prefixed by a one-character flag. These +flags have the following meaning: +.IP "!" 4 +An error occurred while reading this directory. +.IP "." 4 +An error occurred while reading a subdirectory, so the indicated size may not be +correct. +.IP "<" 4 +File or directory is excluded from the statistics by using exlude patterns. +.IP ">" 4 +Directory is on another filesystem. +.IP "@" 4 +This is neither a file nor a folder (symlink, socket, ...). +.IP "H" 4 +.IX Item "H" +Same file was already counted (hard link). +.IP "e" 4 +.IX Item "e" +Empty directory. .SH "EXAMPLES" .IX Header "EXAMPLES" To scan and browse the directory you're currently in, all you need is a simple: diff -Nru ncdu-1.13/README ncdu-1.14.1/README --- ncdu-1.13/README 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/README 2019-08-05 06:11:17.000000000 +0000 @@ -1,5 +1,5 @@ -ncdu 1.13 -========= +ncdu 1.14.1 +=========== DESCRIPTION @@ -33,7 +33,7 @@ COPYING - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/browser.c ncdu-1.14.1/src/browser.c --- ncdu-1.13/src/browser.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/browser.c 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -31,7 +31,7 @@ #include -static int graph = 1, show_as = 0, info_show = 0, info_page = 0, info_start = 0, show_items = 0; +static int graph = 1, show_as = 0, info_show = 0, info_page = 0, info_start = 0, show_items = 0, show_mtime = 0; static char *message = NULL; @@ -169,19 +169,54 @@ static void browse_draw_items(struct dir *n, int *x) { enum ui_coltype c = n->flags & FF_BSEL ? UIC_SEL : UIC_DEFAULT; + enum ui_coltype cn = c == UIC_SEL ? UIC_NUM_SEL : UIC_NUM; if(!show_items) return; *x += 7; - if(n->items > 99999) { - addstrc(c, "> "); - addstrc(c == UIC_SEL ? UIC_NUM_SEL : UIC_NUM, "100"); - addchc(c, 'k'); - } else if(n->items) { - uic_set(c == UIC_SEL ? UIC_NUM_SEL : UIC_NUM); + if(!n->items) + return; + else if(n->items < 100*1000) { + uic_set(cn); printw("%6s", fullsize(n->items)); + } else if(n->items < 1000*1000) { + uic_set(cn); + printw("%5.1f", n->items / 1000.0); + addstrc(c, "k"); + } else if(n->items < 1000*1000*1000) { + uic_set(cn); + printw("%5.1f", n->items / 1e6); + addstrc(c, "M"); + } else { + addstrc(c, " > "); + addstrc(cn, "1"); + addchc(c, 'B'); + } +} + + +static void browse_draw_mtime(struct dir *n, int *x) { + enum ui_coltype c = n->flags & FF_BSEL ? UIC_SEL : UIC_DEFAULT; + char mbuf[26]; + struct dir_ext *e; + time_t t; + + if (n->flags & FF_EXT) { + e = dir_ext_ptr(n); + } else if (!strcmp(n->name, "..") && (n->parent->flags & FF_EXT)) { + e = dir_ext_ptr(n->parent); + } else { + snprintf(mbuf, sizeof(mbuf), "no mtime"); + goto no_mtime; } + t = (time_t)e->mtime; + + strftime(mbuf, sizeof(mbuf), "%Y-%m-%d %H:%M:%S %z", localtime(&t)); + uic_set(c == UIC_SEL ? UIC_NUM_SEL : UIC_NUM); +no_mtime: + printw("%26s", mbuf); + *x += 27; } @@ -207,6 +242,11 @@ browse_draw_items(n, &x); move(row, x); + if (extended_info && show_mtime) { + browse_draw_mtime(n, &x); + move(row, x); + } + if(n->flags & FF_DIR) c = c == UIC_SEL ? UIC_DIR_SEL : UIC_DIR; addchc(c, n->flags & FF_DIR ? '/' : ' '); @@ -398,6 +438,12 @@ dirlist_set_sort(DL_COL_ITEMS, dirlist_sort_col == DL_COL_ITEMS ? !dirlist_sort_desc : 1, DL_NOCHANGE); info_show = 0; break; + case 'M': + if (extended_info) { + dirlist_set_sort(DL_COL_MTIME, dirlist_sort_col == DL_COL_MTIME ? !dirlist_sort_desc : 1, DL_NOCHANGE); + info_show = 0; + } + break; case 'e': dirlist_set_hidden(!dirlist_hidden); info_show = 0; @@ -463,6 +509,10 @@ case 'c': show_items = !show_items; break; + case 'm': + if (extended_info) + show_mtime = !show_mtime; + break; case 'i': info_show = !info_show; break; diff -Nru ncdu-1.13/src/browser.h ncdu-1.14.1/src/browser.h --- ncdu-1.13/src/browser.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/browser.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/delete.c ncdu-1.14.1/src/delete.c --- ncdu-1.13/src/delete.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/delete.c 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -195,7 +195,7 @@ r = unlink(dr->name); delete_nxt: - /* error occured, ask user what to do */ + /* error occurred, ask user what to do */ if(r == -1 && !ignoreerr) { state = DS_FAILED; lasterrno = errno; diff -Nru ncdu-1.13/src/delete.h ncdu-1.14.1/src/delete.h --- ncdu-1.13/src/delete.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/delete.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/dir_common.c ncdu-1.14.1/src/dir_common.c --- ncdu-1.13/src/dir_common.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dir_common.c 2019-07-23 08:22:32.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -36,7 +36,7 @@ char *dir_fatalerr; /* Error message on a fatal error. (NULL if there was no fatal error) */ int dir_ui; /* User interface to use */ static int confirm_quit_while_scanning_stage_1_passed; /* Additional check before quitting */ -static char *lasterr; /* Path where the last error occured. */ +static char *lasterr; /* Path where the last error occurred. */ static int curpathl; /* Allocated length of dir_curpath */ static int lasterrl; /* ^ of lasterr */ @@ -44,7 +44,7 @@ static void curpath_resize(int s) { if(curpathl < s) { curpathl = s < 128 ? 128 : s < curpathl*2 ? curpathl*2 : s; - dir_curpath = realloc(dir_curpath, curpathl); + dir_curpath = xrealloc(dir_curpath, curpathl); } } @@ -85,9 +85,9 @@ int req = strlen(path)+1; if(lasterrl < req) { lasterrl = req; - lasterr = realloc(lasterr, lasterrl); + lasterr = xrealloc(lasterr, lasterrl); } - strcpy(lasterr, dir_curpath); + strcpy(lasterr, path); } @@ -99,7 +99,7 @@ va_list va; va_start(va, fmt); - dir_fatalerr = malloc(1024); /* Should be enough for everything... */ + dir_fatalerr = xmalloc(1024); /* Should be enough for everything... */ vsnprintf(dir_fatalerr, 1023, fmt, va); dir_fatalerr[1023] = 0; va_end(va); diff -Nru ncdu-1.13/src/dir_export.c ncdu-1.14.1/src/dir_export.c --- ncdu-1.13/src/dir_export.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dir_export.c 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/dir.h ncdu-1.14.1/src/dir.h --- ncdu-1.13/src/dir.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dir.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -123,7 +123,7 @@ void dir_curpath_enter(const char *); void dir_curpath_leave(); -/* Sets the path where the last error occured, or reset on NULL. */ +/* Sets the path where the last error occurred, or reset on NULL. */ void dir_setlasterr(const char *); /* Error message on fatal error, or NULL if there hasn't been a fatal error yet. */ diff -Nru ncdu-1.13/src/dir_import.c ncdu-1.14.1/src/dir_import.c --- ncdu-1.13/src/dir_import.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dir_import.c 2019-07-23 08:23:56.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -81,7 +81,7 @@ /* Fills readbuf with data from the stream. *buf will have at least n (< * READ_BUF_SIZE) bytes available, unless the stream reached EOF or an error - * occured. If the file data contains a null-type, this is considered an error. + * occurred. If the file data contains a null-type, this is considered an error. * Returns 0 on success, non-zero on error. */ static int fill(int n) { int r; @@ -596,12 +596,12 @@ else if((stream = fopen(fn, "r")) == NULL) return 1; - ctx = malloc(sizeof(struct ctx)); + ctx = xmalloc(sizeof(struct ctx)); ctx->stream = stream; ctx->line = 1; ctx->byte = ctx->eof = ctx->items = 0; ctx->buf = ctx->lastfill = ctx->readbuf; - ctx->buf_dir = malloc(dir_memsize("")); + ctx->buf_dir = xmalloc(dir_memsize("")); ctx->readbuf[0] = 0; dir_curpath_set(fn); diff -Nru ncdu-1.13/src/dirlist.c ncdu-1.14.1/src/dirlist.c --- ncdu-1.13/src/dirlist.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dirlist.c 2019-07-23 08:25:45.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -50,6 +50,14 @@ )) +static inline int cmp_mtime(struct dir *x, struct dir*y) { + int64_t x_mtime = 0, y_mtime = 0; + if (x->flags & FF_EXT) + x_mtime = dir_ext_ptr(x)->mtime; + if (y->flags & FF_EXT) + y_mtime = dir_ext_ptr(y)->mtime; + return (x_mtime > y_mtime ? 1 : (x_mtime == y_mtime ? 0 : -1)); +} static int dirlist_cmp(struct dir *x, struct dir *y) { int r; @@ -80,7 +88,8 @@ r = dirlist_sort_col == DL_COL_NAME ? CMP_NAME : dirlist_sort_col == DL_COL_SIZE ? CMP_SIZE : dirlist_sort_col == DL_COL_ASIZE ? CMP_ASIZE : - CMP_ITEMS; + dirlist_sort_col == DL_COL_ITEMS ? CMP_ITEMS : + cmp_mtime(x, y); /* try 2 */ if(!r) r = dirlist_sort_col == DL_COL_SIZE ? CMP_ASIZE : CMP_SIZE; @@ -208,7 +217,7 @@ /* set the reference to the parent dir */ if(d->parent) { if(!parent_alloc) - parent_alloc = calloc(1, dir_memsize("..")); + parent_alloc = xcalloc(1, dir_memsize("..")); dirlist_parent = parent_alloc; strcpy(dirlist_parent->name, ".."); dirlist_parent->next = head; @@ -306,7 +315,7 @@ * 1 = selected has moved down * -1 = selected has moved up * -2 = selected = first item in the list (faster version of '1') - * -3 = top should be considered as invalid (after sorting or opening an other dir) + * -3 = top should be considered as invalid (after sorting or opening another dir) * -4 = an item has been deleted * -5 = hidden flag has been changed * @@ -371,7 +380,8 @@ dirlist_sort_df = df; /* sort the list (excluding the parent, which is always on top) */ - head_real = dirlist_sort(head_real); + if(head_real) + head_real = dirlist_sort(head_real); if(dirlist_parent) dirlist_parent->next = head_real; else diff -Nru ncdu-1.13/src/dirlist.h ncdu-1.14.1/src/dirlist.h --- ncdu-1.13/src/dirlist.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dirlist.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -37,6 +37,7 @@ #define DL_COL_SIZE 1 #define DL_COL_ASIZE 2 #define DL_COL_ITEMS 3 +#define DL_COL_MTIME 4 void dirlist_open(struct dir *); diff -Nru ncdu-1.13/src/dir_mem.c ncdu-1.14.1/src/dir_mem.c --- ncdu-1.13/src/dir_mem.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dir_mem.c 2019-07-23 08:24:10.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -67,10 +67,8 @@ /* found in the table? update hlnk */ if(!i) { - t = d->hlnk = kh_key(links, k); - if(t->hlnk != NULL) - for(t=t->hlnk; t->hlnk!=d->hlnk; t=t->hlnk) - ; + t = kh_key(links, k); + d->hlnk = t->hlnk == NULL ? t : t->hlnk; t->hlnk = d; } @@ -125,7 +123,7 @@ if(!extended_info) dir->flags &= ~FF_EXT; - item = malloc(dir->flags & FF_EXT ? dir_ext_memsize(name) : dir_memsize(name)); + item = xmalloc(dir->flags & FF_EXT ? dir_ext_memsize(name) : dir_memsize(name)); memcpy(item, dir, offsetof(struct dir, name)); strcpy(item->name, name); if(dir->flags & FF_EXT) @@ -146,10 +144,13 @@ * possible hard link, because hlnk_check() will take care of it in that * case. */ if(item->flags & FF_HLNKC) { - addparentstats(item->parent, 0, 0, 1); + addparentstats(item->parent, 0, 0, 0, 1); hlink_check(item); - } else - addparentstats(item->parent, item->size, item->asize, 1); + } else if(item->flags & FF_EXT) { + addparentstats(item->parent, item->size, item->asize, dir_ext_ptr(item)->mtime, 1); + } else { + addparentstats(item->parent, item->size, item->asize, 0, 1); + } /* propagate ERR and SERR back up to the root */ if(item->flags & FF_SERR || item->flags & FF_ERR) diff -Nru ncdu-1.13/src/dir_scan.c ncdu-1.14.1/src/dir_scan.c --- ncdu-1.13/src/dir_scan.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/dir_scan.c 2019-08-04 15:29:27.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -84,7 +84,7 @@ /* Reads all filenames in the currently chdir'ed directory and stores it as a * nul-separated list of filenames. The list ends with an empty filename (i.e. * two nuls). . and .. are not included. Returned memory should be freed. *err - * is set to 1 if some error occured. Returns NULL if that error was fatal. + * is set to 1 if some error occurred. Returns NULL if that error was fatal. * The reason for reading everything in memory first and then walking through * the list is to avoid eating too many file descriptors in a deeply recursive * directory. */ @@ -100,7 +100,7 @@ return NULL; } - buf = malloc(buflen); + buf = xmalloc(buflen); errno = 0; while((item = readdir(dir)) != NULL) { @@ -109,7 +109,7 @@ int req = off+3+strlen(item->d_name); if(req > buflen) { buflen = req < buflen*2 ? buflen*2 : req; - buf = realloc(buf, buflen); + buf = xrealloc(buf, buflen); } strcpy(buf+off, item->d_name); off += strlen(item->d_name)+1; @@ -185,7 +185,7 @@ * directory. Assumes we're chdir'ed in the directory in which this item * resides. */ static int dir_scan_item(const char *name) { - struct stat st; + static struct stat st, stl; int fail = 0; #ifdef __CYGWIN__ @@ -204,11 +204,15 @@ dir_setlasterr(dir_curpath); } - if(!(buf_dir->flags & (FF_ERR|FF_EXL))) - stat_to_dir(&st); + if(!(buf_dir->flags & (FF_ERR|FF_EXL))) { + if(follow_symlinks && S_ISLNK(st.st_mode) && !stat(name, &stl) && !S_ISDIR(stl.st_mode)) + stat_to_dir(&stl); + else + stat_to_dir(&st); + } if(cachedir_tags && (buf_dir->flags & FF_DIR) && !(buf_dir->flags & (FF_ERR|FF_EXL|FF_OTHFS))) - if(has_cachedir_tag(buf_dir->name)) { + if(has_cachedir_tag(name)) { buf_dir->flags |= FF_EXL; buf_dir->size = buf_dir->asize = 0; } @@ -308,6 +312,7 @@ dir_setlasterr(NULL); dir_seterr(NULL); dir_process = process; - buf_dir = malloc(dir_memsize("")); + if (!buf_dir) + buf_dir = xmalloc(dir_memsize("")); pstate = ST_CALC; } diff -Nru ncdu-1.13/src/exclude.c ncdu-1.14.1/src/exclude.c --- ncdu-1.13/src/exclude.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/exclude.c 2019-07-23 08:58:18.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -23,7 +23,7 @@ */ -#include "exclude.h" +#include "global.h" #include #include @@ -45,8 +45,8 @@ while(*n != NULL) n = &((*n)->next); - *n = (struct exclude *) calloc(1, sizeof(struct exclude)); - (*n)->pattern = (char *) malloc(strlen(pat)+1); + *n = (struct exclude *) xcalloc(1, sizeof(struct exclude)); + (*n)->pattern = (char *) xmalloc(strlen(pat)+1); strcpy((*n)->pattern, pat); } @@ -125,7 +125,7 @@ /* We don't need to copy the content of `path`, so it's more efficient to * use `free` + `malloc`. */ free(path); - path = malloc(path_l); + path = xmalloc(path_l); } snprintf(path, path_l, "%s/%s", name, CACHEDIR_TAG_FILENAME); f = fopen(path, "rb"); diff -Nru ncdu-1.13/src/exclude.h ncdu-1.14.1/src/exclude.h --- ncdu-1.13/src/exclude.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/exclude.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/global.h ncdu-1.14.1/src/global.h --- ncdu-1.13/src/global.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/global.h 2019-07-23 08:45:55.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -45,7 +45,7 @@ #define FF_DIR 0x01 #define FF_FILE 0x02 #define FF_ERR 0x04 /* error while reading this item */ -#define FF_OTHFS 0x08 /* excluded because it was an other filesystem */ +#define FF_OTHFS 0x08 /* excluded because it was another filesystem */ #define FF_EXL 0x10 /* excluded using exlude patterns */ #define FF_SERR 0x20 /* error in subdirectory */ #define FF_HLNKC 0x40 /* hard link candidate (file with st_nlink > 1) */ @@ -103,10 +103,15 @@ extern int confirm_quit; /* flag whether we want to enable use of struct dir_ext */ extern int extended_info; +/* flag whether we want to follow symlinks */ +extern int follow_symlinks; /* handle input from keyboard and update display */ int input_handle(int); +/* de-initialize ncurses */ +void close_nc(); + /* import all other global functions and variables */ #include "browser.h" diff -Nru ncdu-1.13/src/help.c ncdu-1.14.1/src/help.c --- ncdu-1.13/src/help.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/help.c 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -32,7 +32,7 @@ int page, start; -#define KEYS 17 +#define KEYS 19 char *keys[KEYS*2] = { /*|----key----| |----------------description----------------|*/ "up, k", "Move cursor up", @@ -42,11 +42,13 @@ "n", "Sort by name (ascending/descending)", "s", "Sort by size (ascending/descending)", "C", "Sort by items (ascending/descending)", + "M", "Sort by mtime (-e flag)", "d", "Delete selected file or directory", "t", "Toggle dirs before files when sorting", "g", "Show percentage and/or graph", "a", "Toggle between apparent size and disk usage", "c", "Toggle display of child item counts", + "m", "Toggle display of latest mtime (-e flag)", "e", "Show/hide hidden or excluded files", "i", "Show information about selected item", "r", "Recalculate the current directory", @@ -97,10 +99,10 @@ ncaddch(10, 4, 'H'); ncaddch(11, 4, 'e'); uic_set(UIC_DEFAULT); - ncaddstr( 5, 7, "An error occured while reading this directory"); - ncaddstr( 6, 7, "An error occured while reading a subdirectory"); + ncaddstr( 5, 7, "An error occurred while reading this directory"); + ncaddstr( 6, 7, "An error occurred while reading a subdirectory"); ncaddstr( 7, 7, "File or directory is excluded from the statistics"); - ncaddstr( 8, 7, "Directory was on an other filesystem"); + ncaddstr( 8, 7, "Directory was on another filesystem"); ncaddstr( 9, 7, "This is not a file nor a dir (symlink, socket, ...)"); ncaddstr(10, 7, "Same file was already counted (hard link)"); ncaddstr(11, 7, "Empty directory"); diff -Nru ncdu-1.13/src/help.h ncdu-1.14.1/src/help.h --- ncdu-1.13/src/help.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/help.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/main.c ncdu-1.14.1/src/main.c --- ncdu-1.13/src/main.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/main.c 2019-07-23 08:42:08.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -41,6 +41,7 @@ long update_delay = 100; int cachedir_tags = 0; int extended_info = 0; +int follow_symlinks = 0; static int min_rows = 17, min_cols = 60; static int ncurses_init = 0; @@ -85,6 +86,7 @@ return wait == 0 ? 1 : 0; nodelay(stdscr, wait?1:0); + errno = 0; while((ch = getch()) != ERR) { if(ch == KEY_RESIZE) { if(ncresize(min_rows, min_cols)) @@ -103,6 +105,8 @@ } screen_draw(); } + if(errno == EPIPE || errno == EBADF) + return 1; return 0; } @@ -117,9 +121,9 @@ char *dir = NULL; static yopt_opt_t opts[] = { - { 'h', 0, "-h,-?" }, + { 'h', 0, "-h,-?,--help" }, { 'q', 0, "-q" }, - { 'v', 0, "-v" }, + { 'v', 0, "-v,-V,--version" }, { 'x', 0, "-x" }, { 'e', 0, "-e" }, { 'r', 0, "-r" }, @@ -130,6 +134,7 @@ { '2', 0, "-2" }, { 1, 1, "--exclude" }, { 'X', 1, "-X,--exclude-from" }, + { 'L', 0, "-L,--follow-symlinks" }, { 'C', 0, "--exclude-caches" }, { 's', 0, "--si" }, { 'Q', 0, "--confirm-quit" }, @@ -146,9 +151,9 @@ case 0 : dir = val; break; case 'h': printf("ncdu \n\n"); - printf(" -h This help message\n"); + printf(" -h,--help This help message\n"); printf(" -q Quiet mode, refresh interval 2 seconds\n"); - printf(" -v Print version\n"); + printf(" -v,-V,--version Print version\n"); printf(" -x Same filesystem\n"); printf(" -e Enable extended information\n"); printf(" -r Read only\n"); @@ -158,6 +163,7 @@ printf(" --si Use base 10 (SI) prefixes instead of base 2\n"); printf(" --exclude PATTERN Exclude files that match PATTERN\n"); printf(" -X, --exclude-from FILE Exclude files that match any pattern in FILE\n"); + printf(" -L, --follow-symlinks Follow symbolic links (excluding directories)\n"); printf(" --exclude-caches Exclude directories containing CACHEDIR.TAG\n"); printf(" --confirm-quit Confirm quitting ncdu\n"); printf(" --color SCHEME Set color scheme\n"); @@ -183,12 +189,13 @@ exit(1); } break; + case 'L': follow_symlinks = 1; break; case 'C': cachedir_tags = 1; break; case 'c': if(strcmp(val, "off") == 0) { uic_theme = 0; } - if(strcmp(val, "dark") == 0) { uic_theme = 1; } + else if(strcmp(val, "dark") == 0) { uic_theme = 1; } else { fprintf(stderr, "Unknown --color option: %s\n", val); exit(1); @@ -273,6 +280,15 @@ } +void close_nc() { + if(ncurses_init) { + erase(); + refresh(); + endwin(); + } +} + + /* main program */ int main(int argc, char **argv) { read_locale(); @@ -302,11 +318,7 @@ break; } - if(ncurses_init) { - erase(); - refresh(); - endwin(); - } + close_nc(); exclude_clear(); return 0; diff -Nru ncdu-1.13/src/path.c ncdu-1.14.1/src/path.c --- ncdu-1.13/src/path.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/path.c 2019-07-23 08:26:54.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -23,7 +23,7 @@ */ -#include "path.h" +#include "global.h" #include #include @@ -64,8 +64,8 @@ } /* create array of the components */ - old = malloc((j+1)*sizeof(char *)); - *res = malloc((j+1)*sizeof(char *)); + old = xmalloc((j+1)*sizeof(char *)); + *res = xmalloc((j+1)*sizeof(char *)); for(i=j=0; i n) - ret = realloc(ret, i); + ret = xrealloc(ret, i); strcat(ret, "/"); strcat(ret, path); /* otherwise, just make a copy */ } else { - ret = malloc(strlen(path)+1); + ret = xmalloc(strlen(path)+1); strcpy(ret, path); } return ret; @@ -133,7 +133,7 @@ char **arr, *tmp, *lnk = NULL, *ret = NULL; tmpl = strlen(cur)+1; - tmp = malloc(tmpl); + tmp = xmalloc(tmpl); /* split path */ i = path_split(cur, &arr); @@ -142,7 +142,7 @@ strcpy(tmp, "/"); if(i > 0) { lnkl = RPATH_CNKSZ; - lnk = malloc(lnkl); + lnk = xmalloc(lnkl); if(chdir("/") < 0) goto path_real_done; } @@ -153,7 +153,7 @@ /* check for symlink */ while((n = readlink(arr[i], lnk, lnkl)) == lnkl || (n < 0 && errno == ERANGE)) { lnkl += RPATH_CNKSZ; - lnk = realloc(lnk, lnkl); + lnk = xrealloc(lnk, lnkl); } if(n < 0 && errno != EINVAL) goto path_real_done; @@ -168,7 +168,7 @@ n += strlen(tmp); if(tmpl < n) { tmpl = n; - tmp = realloc(tmp, tmpl); + tmp = xrealloc(tmp, tmpl); } if(lnk[0] != '/') strcat(tmp, lnk); @@ -179,7 +179,7 @@ n += strlen(arr[i])+1; if(tmpl < n) { tmpl = n; - tmp = realloc(tmp, tmpl); + tmp = xrealloc(tmp, tmpl); } strcat(tmp, "/"); strcat(tmp, arr[i]); diff -Nru ncdu-1.13/src/path.h ncdu-1.14.1/src/path.h --- ncdu-1.13/src/path.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/path.h 2019-07-23 08:24:50.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -30,7 +30,6 @@ - path_real uses chdir(), so it's not thread safe - Process requires +x access for all directory components - Potentionally slow - - Doesn't check return value of malloc() and realloc() - path_real doesn't check for the existance of the last component - cwd is unreliable after path_real */ diff -Nru ncdu-1.13/src/quit.c ncdu-1.14.1/src/quit.c --- ncdu-1.13/src/quit.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/quit.c 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2015-2018 Yoran Heling + Copyright (c) 2015-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/quit.h ncdu-1.14.1/src/quit.h --- ncdu-1.13/src/quit.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/quit.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2015-2018 Yoran Heling + Copyright (c) 2015-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -Nru ncdu-1.13/src/shell.c ncdu-1.14.1/src/shell.c --- ncdu-1.13/src/shell.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/shell.c 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Shell support: Copyright (c) 2014 Thomas Jarosch Permission is hereby granted, free of charge, to any person obtaining diff -Nru ncdu-1.13/src/shell.h ncdu-1.14.1/src/shell.h --- ncdu-1.13/src/shell.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/shell.h 2019-02-04 15:49:57.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Shell support: Copyright (c) 2014 Thomas Jarosch Permission is hereby granted, free of charge, to any person obtaining diff -Nru ncdu-1.13/src/util.c ncdu-1.14.1/src/util.c --- ncdu-1.13/src/util.c 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/util.c 2019-07-23 09:01:28.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef HAVE_LOCALE_H #include #endif @@ -344,8 +345,11 @@ freedir_hlnk(dr); /* update sizes of parent directories if this isn't a hard link. - * If this is a hard link, freedir_hlnk() would have done so already */ - addparentstats(dr->parent, dr->flags & FF_HLNKC ? 0 : -dr->size, dr->flags & FF_HLNKC ? 0 : -dr->asize, -(dr->items+1)); + * If this is a hard link, freedir_hlnk() would have done so already + * + * mtime is 0 here because recalculating the maximum at every parent + * dir is expensive, but might be good feature to add later if desired */ + addparentstats(dr->parent, dr->flags & FF_HLNKC ? 0 : -dr->size, dr->flags & FF_HLNKC ? 0 : -dr->asize, 0, -(dr->items+1)); free(dr); } @@ -368,12 +372,12 @@ if(datl == 0) { datl = i; - dat = malloc(i); + dat = xmalloc(i); } else if(datl < i) { datl = i; - dat = realloc(dat, i); + dat = xrealloc(dat, i); } - list = malloc(c*sizeof(struct dir *)); + list = xmalloc(c*sizeof(struct dir *)); c = 0; for(d=cur; d!=NULL; d=d->parent) @@ -397,11 +401,34 @@ } -void addparentstats(struct dir *d, int64_t size, int64_t asize, int items) { +void addparentstats(struct dir *d, int64_t size, int64_t asize, uint64_t mtime, int items) { + struct dir_ext *e; while(d) { d->size = adds64(d->size, size); d->asize = adds64(d->asize, asize); d->items += items; + if (d->flags & FF_EXT) { + e = dir_ext_ptr(d); + e->mtime = (e->mtime > mtime) ? e->mtime : mtime; + } d = d->parent; } } + + +/* Apparently we can just resume drawing after endwin() and ncurses will pick + * up where it left. Probably not very portable... */ +#define oom_msg "\nOut of memory, press enter to try again or Ctrl-C to give up.\n" +#define wrap_oom(f) \ + void *ptr;\ + char buf[128];\ + while((ptr = f) == NULL) {\ + close_nc();\ + write(2, oom_msg, sizeof(oom_msg));\ + read(0, buf, sizeof(buf));\ + }\ + return ptr; + +void *xmalloc(size_t size) { wrap_oom(malloc(size)) } +void *xcalloc(size_t n, size_t size) { wrap_oom(calloc(n, size)) } +void *xrealloc(void *mem, size_t size) { wrap_oom(realloc(mem, size)) } diff -Nru ncdu-1.13/src/util.h ncdu-1.14.1/src/util.h --- ncdu-1.13/src/util.h 2018-01-29 10:58:14.000000000 +0000 +++ ncdu-1.14.1/src/util.h 2019-07-23 08:25:10.000000000 +0000 @@ -1,6 +1,6 @@ /* ncdu - NCurses Disk Usage - Copyright (c) 2007-2018 Yoran Heling + Copyright (c) 2007-2019 Yoran Heling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -163,20 +163,20 @@ : (a)+(b) < 0 ? 0 : (a)+(b)) /* Adds a value to the size, asize and items fields of *d and its parents */ -void addparentstats(struct dir *, int64_t, int64_t, int); +void addparentstats(struct dir *, int64_t, int64_t, uint64_t, int); /* A simple stack implemented in macros */ #define nstack_init(_s) do {\ (_s)->size = 10;\ (_s)->top = 0;\ - (_s)->list = malloc(10*sizeof(*(_s)->list));\ + (_s)->list = xmalloc(10*sizeof(*(_s)->list));\ } while(0) #define nstack_push(_s, _v) do {\ if((_s)->size <= (_s)->top) {\ (_s)->size *= 2;\ - (_s)->list = realloc((_s)->list, (_s)->size*sizeof(*(_s)->list));\ + (_s)->list = xrealloc((_s)->list, (_s)->size*sizeof(*(_s)->list));\ }\ (_s)->list[(_s)->top++] = _v;\ } while(0) @@ -186,5 +186,10 @@ #define nstack_free(_s) free((_s)->list) +/* Malloc wrappers that exit on OOM */ +void *xmalloc(); +void *xcalloc(size_t, size_t); +void *xrealloc(void *, size_t); + #endif