summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* all: use die() rather than error(EXIT_FAILURE)Bernhard Voelker2017-11-1318-323/+366
| | | | | | | | | | | | | | | | | | | | | | | | | | | | die() has the advantage of being apparent to the compiler that it doesn't return, which will avoid warnings in some cases, and possibly generate better code. While at it, wrap some of the overly long error messages into a new line. * cfg.mk (sc_die_EXIT_FAILURE): A new syntax check rule to catch any new uses of error (CONSTANT, ...); * find/exec.c: Include "die.h" and use die rather than exit (EXIT_FAILURE). * find/fstype.c: Likewise. * find/ftsfind.c: Likewise. * find/oldfind.c: Likewise. * find/parser.c: Likewise. * find/pred.c: Likewise. * find/print.c: Likewise. * find/tree.c: Likewise. * find/util.c: Likewise. * lib/buildcmd.c: Likewise. * lib/listfile.c: Likewise. * lib/regextype.c: Likewise. * lib/safe-atoi.c: Likewise. * locate/frcode.c: Likewise. * locate/locate.c: Likewise. * locate/word_io.c: Likewise. * xargs/xargs.c: Likewise.
* maint: avoid unused-but-set-variable, unused-parameter warnings from GCC 7Bernhard Voelker2017-11-132-2/+5
| | | | | | | | GCC-7.2.1 complained about this occur during 'make check'. * lib/regexprops.c (menu): Remove set-but-unused-variable 'options'. * lib/test_splitstring.c (main): Avoid unused-parameter warnings for 'argc' and 'argv'.
* maint: add die.h; avoid missing-fallthrough warnings after error w/ GCC 7Bernhard Voelker2017-11-133-6/+37
| | | | | | | | | | * lib/die.h (die): New file/function from grep/coreutils. Note: this file will probably be migrated to gnulib. * lib/Makefile.am (libfind_a_SOURCES): Reference it. * xargs/xargs.c: Include die.h. (xargs_do_exec): Use die in place of error-nonzero, thus allowing the compiler to know that we do not fall through into the 0 (child) case.
* maint: avoid implicit-fallthrough warnings from GCC 7Bernhard Voelker2017-11-131-0/+0
| | | | | | | | | | | | | | | | Avoid the new warnings GCC 7 gives with the "-Werror=implicit-fallthrough=" compiler option. Since version 7, GCC requires fallthrough switch/cases to be marked by the appropriate attribute. * lib/system.h: Add new header file defining the FALLTHROUGH macro. * lib/Makefile.am (libfind_a_SOURCES): Reference it. * find/print.c (do_fprintf): Use the new macro. * xargs/xargs.c (read_line): Likewise. (xargs_do_exec): For error(3), GCC 7 doesn't know that the function does not return, and would complain about falling through into the following case. Temporarily add an abort call - this will be fixed with another commit.
* maint: avoid implicit-fallthrough warnings from GCC 7Bernhard Voelker2017-11-134-10/+53
| | | | | | | | | | | | | | | | Avoid the new warnings GCC 7 gives with the "-Werror=implicit-fallthrough=" compiler option. Since version 7, GCC requires fallthrough switch/cases to be marked by the appropriate attribute. * lib/system.h: Add new header file defining the FALLTHROUGH macro. * lib/Makefile.am (libfind_a_SOURCES): Reference it. * find/print.c (do_fprintf): Use the new macro. * xargs/xargs.c (read_line): Likewise. (xargs_do_exec): For error(3), GCC 7 doesn't know that the function does not return, and would complain about falling through into the following case. Temporarily add an abort call - this will be fixed with another commit.
* maint: avoid unused-macros warning from GCC 7Bernhard Voelker2017-11-081-14/+9
| | | | | | | | | | GCC-7.2.1 on openSUSE-Tumbleweed complains: listfile.c:56:0: error: macro "HAVE_MAJOR" is not used \ [-Werror=unused-macros] #define HAVE_MAJOR * listfile.c (major,minor): Avoid the temporary #define HAVE_MAJOR by using #else's.
* updatedb: use Copyright header of updatedb.shBernhard Voelker2017-10-302-1/+4
| | | | | | | | | | | Previously, the Copyright header output by 'updatedb --version' was not updated by 'make update-copyright', so it still showed 2010 as the Copyright year. * locate/updatedb.sh (version): Replace the Copyright header by the placeholder "@COPYRIGHT@" ... * locate/Makefile.am (updatedb): ... set here from the Copyright line extracted from 'updatedb.sh'.
* tests: cleanup files left behind by sv-52220.shBernhard Voelker2017-10-301-0/+1
| | | | | | | | | | | | | | 'make distcheck' failed with: ... ERROR: files left in build directory after distclean: ./find/testsuite/find.err ./find/testsuite/oldfind.err Makefile:2064: recipe for target 'distcleancheck' failed * find/testsuite/sv-52220.sh: Add command to remove the temporary files used for stderr output. Bug introduced in commit v4.6.0-123-gef1581e.
* maint: use an optimal-for-findutils xz compression settingBernhard Voelker2017-10-281-0/+27
| | | | | | | * cfg.mk: Set XZ_OPT = -7e (determined empirically). The compressed tarball size is identical to the default settings (-9e), but using -9e would force every decompression process to use 48 MiB more memory.
* maint: run 'make -C po update-po'Bernhard Voelker2017-10-2340-11273/+12131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mainly for changed line numbers, but also for a couple of new translation strings, and the switch to https. * po/be.po: Update via the above 'update-po' target. * po/bg.po: Likewise. * po/ca.po: Likewise. * po/cs.po: Likewise. * po/da.po: Likewise. * po/de.po: Likewise. * po/el.po: Likewise. * po/eo.po: Likewise. * po/es.po: Likewise. * po/et.po: Likewise. * po/fi.po: Likewise. * po/findutils.pot: Likewise. * po/fr.po: Likewise. * po/ga.po: Likewise. * po/gl.po: Likewise. * po/hr.po: Likewise. * po/hu.po: Likewise. * po/id.po: Likewise. * po/it.po: Likewise. * po/ja.po: Likewise. * po/ko.po: Likewise. * po/lg.po: Likewise. * po/lt.po: Likewise. * po/ms.po: Likewise. * po/nb.po: Likewise. * po/nl.po: Likewise. * po/pl.po: Likewise. * po/pt.po: Likewise. * po/pt_BR.po: Likewise. * po/ro.po: Likewise. * po/ru.po: Likewise. * po/sk.po: Likewise. * po/sl.po: Likewise. * po/sr.po: Likewise. * po/sv.po: Likewise. * po/tr.po: Likewise. * po/uk.po: Likewise. * po/vi.po: Likewise. * po/zh_CN.po: Likewise. * po/zh_TW.po: Likewise.
* all: prefer https:// URLs where possibleBernhard Voelker2017-10-2389-112/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change from http:// to https:// URLs for the following: www.gnu.org, gnu.org, savannah.gnu.org, git.sv.gnu.org, lists.gnu.org, translationproject.org, cve.mitre.org, cwe.mitre.org, xkcd.com, standards.ieee.org, and gcc.gnu.org. * COPYING: Do the above replacement. * ChangeLog-2013: Likewise. * NEWS: Likewise. * README: Likewise. * README-hacking: Likewise. * build-aux/Makefile.am: Likewise. * build-aux/check-testfiles.sh: Likewise. * build-aux/gen-changelog.sh: Likewise. * build-aux/man-lint.sh: Likewise. * build-aux/src-sniff.py: Likewise. * cfg.mk: Likewise. * configure.ac: Likewise. * doc/Makefile.am: Likewise. * doc/find-maint.texi: Likewise. * doc/find.texi: Likewise. * find/defs.h: Likewise. * find/exec.c: Likewise. * find/find.1: Likewise. * find/finddata.c: Likewise. * find/fstype.c: Likewise. * find/ftsfind.c: Likewise. * find/oldfind.c: Likewise. * find/parser.c: Likewise. * find/pred.c: Likewise. * find/print.c: Likewise. * find/print.h: Likewise. * find/sharefile.c: Likewise. * find/sharefile.h: Likewise. * find/testsuite/Makefile.am: Likewise. * find/testsuite/binary_locations.sh: Likewise. * find/testsuite/checklists.py: Likewise. * find/testsuite/config/unix.exp: Likewise. * find/testsuite/find.gnu/name-period.exp: Likewise. * find/testsuite/find.posix/depth1.exp: Likewise. * find/testsuite/sv-34079.sh: Likewise. * find/testsuite/sv-34976-execdir-fd-leak.sh: Likewise. * find/testsuite/sv-48030-exec-plus-bug.sh: Likewise. * find/testsuite/sv-48180-refuse-noop.sh: Likewise. * find/testsuite/sv-52220.sh: Likewise. * find/testsuite/sv-bug-32043.sh: Likewise. * find/testsuite/test_escape_c.sh: Likewise. * find/testsuite/test_escapechars.sh: Likewise. * find/testsuite/test_inode.sh: Likewise. * find/testsuite/test_type-list.sh: Likewise. * find/tree.c: Likewise. * find/util.c: Likewise. * gnulib-local/lib/gcc-function-attributes.h: Likewise. * lib/bugreports.c: Likewise. * lib/bugreports.h: Likewise. * lib/buildcmd.c: Likewise. * lib/buildcmd.h: Likewise. * lib/check-regexprops.sh: Likewise. * lib/dircallback.c: Likewise. * lib/dircallback.h: Likewise. * lib/extendbuf.c: Likewise. * lib/extendbuf.h: Likewise. * lib/fdleak.c: Likewise. * lib/fdleak.h: Likewise. * lib/findutils-version.c: Likewise. * lib/findutils-version.h: Likewise. * lib/listfile.c: Likewise. * lib/listfile.h: Likewise. * lib/printquoted.c: Likewise. * lib/printquoted.h: Likewise. * lib/qmark.c: Likewise. * lib/regexprops.c: Likewise. * lib/regextype.c: Likewise. * lib/regextype.h: Likewise. * lib/safe-atoi.c: Likewise. * lib/safe-atoi.h: Likewise. * lib/splitstring.c: Likewise. * lib/splitstring.h: Likewise. * lib/test_splitstring.c: Likewise. * lib/unused-result.h: Likewise. * locate/frcode.c: Likewise. * locate/locate.1: Likewise. * locate/locate.c: Likewise. * locate/locatedb.5: Likewise. * locate/locatedb.h: Likewise. * locate/testsuite/Makefile.am: Likewise. * locate/testsuite/config/unix.exp: Likewise. * locate/updatedb.1: Likewise. * locate/updatedb.sh: Likewise. * locate/word_io.c: Likewise. * po/fetch-po-files: Likewise. * xargs/testsuite/Makefile.am: Likewise. * xargs/testsuite/config/unix.exp: Likewise. * xargs/xargs.1: Likewise. * xargs/xargs.c: Likewise.
* doc: add copyright section to man pagesBernhard Voelker2017-10-235-0/+37
| | | | | | | | | * find/find.1: Add copyright section, deriving first copyright year from the corresponding *.c file. * locate/locate.1: Likewise. * locate/locatedb.5: Likewise. * locate/updatedb.1: Likewise. * xargs/xargs.1: Likewise.
* maint: add copyright header to more filesBernhard Voelker2017-10-238-0/+117
| | | | | | | | | | | | * Makefile.am: Add copyright header. * README: Likewise. * TODO: Likewise. * doc/perm.texi: Likewise; use 1994-2017 as Kevin brought it into findutils from coreutils. * find/Makefile.am: Add copyright header. * lib/Makefile.am: Likewise. * locate/Makefile.am: Likewise. * xargs/Makefile.am: Likewise.
* maint: align copyright header lineBernhard Voelker2017-10-234-4/+4
| | | | | | | * lib/extendbuf.c: s/Copyright/Copyright (C)/ * lib/printquoted.h: Likewise. * lib/regextype.c: Likewise. * lib/regextype.h: Likewise.
* maint: update copyright year number rangesBernhard Voelker2017-10-23123-168/+139
| | | | | | | | | | | | | | | | | | Better late than never: run 'make update-copyright'. * cfg.mk (update-copyright-env): Change UPDATE_COPYRIGHT_USE_INTERVALS from 1 to 2 to get a minimal containing range of years; also set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to 79 characters. * .x-update-copyright: Add an entry for bootstrap which comes from gnulib. * lib/qmark.c: While at it, fix a typo: s/courutils/coreutils/. * lib/regexprops.c (copying): Update the text so that the copyright years match the result of "make update-copyright". * po/fi.po: Change copyright header so that "make update-copyright" can pick it up: s/©/(C)/ * po/it.po: Likewise. * po/vi.po: Likewise. * All other files: Update copyright years via the above make run.
* gnulib: update to latestBernhard Voelker2017-10-223-6/+6
| | | | | * bootstrap: Merge from gnulib/build-aux/. * bootstrap.conf: Likewise.
* find: avoid segfault with -D without argumentBernhard Voelker2017-10-224-1/+71
| | | | | | | | | | | | | | | On some platforms, 'find -D' without any further argument crashed. * find/util.c (process_leading_options): Output an error diagnostic when the -D option is the last argument. Previously, 'find -D' without any further arguments crashed on some platforms where the following strtok_r does not expect a NULL pointer argument in the first call. * NEWS (Bug Fixes): Mention the fix. * find/testsuite/sv-52220.sh: Add a test. * find/testsuite/Makefile.am (test_shell_progs): Reference the test. Fixes https://savannah.gnu.org/bugs/?52220
* maint: fix typos in commmentsBernhard Voelker2017-10-102-2/+2
| | | | | * find/fstype.c: s/unneccessary/unnecessary/ * xargs/xargs.c: s/utliity/utility/
* find.1: improve explanation in the NON-BUGS sectionBernhard Voelker2017-09-141-7/+13
| | | | | | * find/find.1 (NON-BUGS): Update the sample error diagnostic to match the latest code of the unquoted pattern example for the -name predicate. Also improve the explanation about what is happening in that case.
* tests: test more printf format specifiersAndreas Metzler2017-09-082-1/+7
| | | | | | | * find/testsuite/find.gnu/printf.exp: Add coverage for %T* (limited to strftime sequences mandated by POSIX), %M, %t, %y, and %Y. Run this test with TZ=UTC. (Latter fix by Bernhard Voelker.) * find/testsuite/find.gnu/printf.xo: Likewise.
* intl: update Brazilian Portuguese, Slovak, Dutch translations.James Youngman2017-09-033-2880/+2505
| | | | | | * po/pt_BR.po: Update Brazilian Portuguese translation. * po/sk.po: Update Slovak translation. * po/nl.po: Update Dutch translation.
* find: avoid buffer-overflow with -printf '%T+'Bernhard Voelker2017-08-281-1/+1
| | | | | | | | | | | | * find/print.c (format_date): Increase size of local variable FMT to match the longest possible content. Fixes https://bugs.debian.org/873032 reported upstream by Andreas Metzler in https://savannah.gnu.org/bugs/?51841; fix proposed by Kamil Dudka. Bug introduced in commit v4.6.0-111-g95816b2, so no released version ever saw this; therefore not adding a NEWS entry.
* maint: fix typo in commentBernhard Voelker2017-08-281-1/+1
| | | | | | | | * locate/locate.c (dolocate): Change a double comma to a single one: s/,,/,/ Reported by Reuben Thomas in http://lists.gnu.org/archive/html/bug-findutils/2017-08/msg00023.html
* doc: add a NEWS entry for the previous commitBernhard Voelker2017-08-181-0/+4
| | | | * NEWS (Improvements): Add an entry for v4.6.0-115-g9530e31.
* find: give helpful hint for unquoted patterns errorsAssaf Gordon2017-08-171-1/+7
| | | | | | | | | | | | | | | | | | | Try to detect cases where the user provided an unquoted shell-glob pattern (which was expanded by the shell before calling find(1), resulting in an invalid usage). $ touch a.txt b.txt c.txt $ find -name *.txt find: paths must precede expression: `b.txt' find: possible unquoted pattern after predicate `-name'? Continuation of https://savannah.gnu.org/bugs/?51711 https://lists.gnu.org/archive/html/bug-findutils/2017-08/msg00000.html https://git.sv.gnu.org/cgit/findutils.git/commit/?id=50a7c5d1f572 * find/tree.c (build_expression_tree): If the offending argument is an existing file, print a hint with the last (valid) predicate.
* find: avoid usage() in more error casesBernhard Voelker2017-08-102-12/+8
| | | | | | | | | | | | | | | | | | | | | When the user passes a bad command line, then find(1) outputs the error message followed by a short usage() text, e.g. (wrapped): $ find . -name a* b* find: paths must precede expression: bfile Usage: find [-H] [-L] [-P] [-Olevel] \ [-D help|tree|search|stat|rates|opt|exec] [path...] [expression] Omit the usage() text in more cases like this in order to make the error diagnostic more eye-catching. * find/tree.c (build_expression_tree): Exit with EXIT_FAILURE immediately in more cases, i.e., without outputting also a short usage() text. While at it, add quotes around the offending argument in one another place. * NEWS (Improvements): Mention the fix. Reported in https://savannah.gnu.org/bugs/?51711
* po/*.po: update line numbers.James Youngman2017-07-2940-6245/+6812
|
* gnulib: update to f42d5af5ba76970309c5704db1c229143043bcc0.James Youngman2017-07-292-0/+1
| | | | * build-aux/.gitignore: arg-nonnull.h, ar-lib, c++defs.h.
* find: avoid strftime's non-portable %F specifier.James Youngman2017-07-231-1/+5
| | | | | | | * find/print.c (format_date): Avoid passing %F to strftime since some implementation lack it. Pass the synonymous %Y-%m-%d instead. This fixes a bug manifesting on HP Tru64 UNIX V5.1B. Reported by Steven M. Schweda <sms@antinode.info>.
* ChangeLog: fix some incorrectly-formatted messages.James Youngman2017-07-232-0/+11
| | | | | | | | * build-aux/git-log-fix: Ignore a recent incorrectly-formatted change-log message (5e56fe96bc5cf5c0b616dc0251dddebb7e480074) which is replaced by another (f146a243400c211a19c9b76e5f598b6d7c57b1b0). Also don't copy the resulting merge commit message into the ChangeLog.
* Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/findutilsJames Youngman2017-07-230-0/+0
|\
| * 2017-07-23 James Youngman <jay@gnu.org>James Youngman2017-07-231-5/+0
| | | | | | | | | | * locate/locate.c (search_one_database): Remove warning about support for slocate databases being new.
* | locate: don't warn about slocate databases any more.James Youngman2017-07-231-5/+0
|/ | | | | * locate/locate.c (search_one_database): Remove warning about support for slocate databases being new.
* doc: update the "STANDARDS CONFORMANCE" section in find.1Bernhard Voelker2017-06-291-17/+6
| | | | | | | * find/find.1 (STANDARDS CONFORMANCE): Change the reference to the POSIX standard from the 2003 Edition to the 2016 Edition. In the list of supported primaries, add the missing ones: -exec, -ok and -path. Remove the stray duplicates from the list.
* doc: clarify 'find -size' values prefixed with '+' and '-'Bernhard Voelker2017-06-292-2/+4
| | | | | | | * doc/find.texi (node Size): Add a sentence to make even clearer that values prefixed with '+' or '-' do not find files with an exact match of N in file size. * find/find.1 (-size): Likewise.
* doc: fix explanation of 'find -size' exampleBernhard Voelker2017-06-292-2/+2
| | | | | | | | 'find -size -1048576c' also matches empty files. * doc/find.texi (node Size): Change "1 to 1,048,575 bytes" to "0 to 1,048,575 bytes". * find/find.1 (-size): Likewise.
* doc: use correct IEC unit prefixes in the documentation of 'find -size'Bernhard Voelker2017-06-294-12/+19
| | | | | | | | | | | | | | | | | | | | | | | find(1) uses binary-based units for the suffixes 'k', 'M', and 'G' of the argument of the '-size' option: 1024, 1024*1024 and 1024^3. Therefore, the documentation should use the correct IEC prefixes kibibyte, mebibyte and gibibyte respectively (or their abbreviations 'KiB', 'MiB' and 'GiB'). * doc/find.texi (node Overview): Change 'Kilobytes' to the shorter but correct 'KiB'. (node Size): Use the above mentioned, correct IEC prefixes. While at it, move the 'w' suffix up to match the man page. * find/find.1 (-size): Likewise. * find/parser.c (parse_size): Also change to IEX prefixes in some comments for consistency. * NEWS (Bug fixes): Mention the fix. See also: https://en.wikipedia.org/wiki/Binary_prefix Reported by Andreas Metzler in https://savannah.gnu.org/bugs/?51304
* doc: drop workarounds for missing xargs -o optionAndreas Metzler2017-06-092-15/+4
| | | | | | | * doc/find.texi (Multiple Files): Mention the new --open-tty option to be used as an alternative. (Safe File Name Handling): Likewise. * xargs/xargs.1 (EXAMPLES): Remove the tty redirection example.
* xargs: add -o, --open-tty optionBernhard Voelker2017-06-095-35/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | This option is available in the xargs implementation of FreeBSD, NetBSD, OpenBSD and in the Apple variant. Add it for compatibility. * xargs/xargs.c (open_tty): Add static flag for the new option. (longopts): Add member. (main): Handle the 'o' case in the getopt_long() loop. (prep_child_for_exec): Redirect stdin of the child to /dev/tty when the -o option is given. Furthermore, move the just-opened file descriptor to STDIN_FILENO. (usage): Document the new option. * bootstrap.conf (gnulib_modules): Add dup2. * xargs/xargs.1 (SYNOPSIS): Replace the too-long list of options by "[options]" - they are listed later anyway. (OPTIONS): Document the new option. (STANDARDS CONFORMANCE): Mention that the -o option is an extension. * doc/find.texi (xargs options): Document the new option. (Invoking the shell from xargs): Amend the explanation of the redirection example with a note about the -o option. (Viewing And Editing): Likewise. (Error Messages From xargs): Add the message when dup2() fails. (NEWS): Mention the new option. Fixes http://savannah.gnu.org/bugs/?51151
* doc: fix some -perm examples in find.infoBernhard Voelker2017-04-132-6/+14
| | | | | | | | | | | | * doc/find.texi (Mode Bits): Fix the description of the -perm examples which search for the "022" mode bits: the match is for the file's group and 'other' mode bits instead of for user and group. While at it, remove a superfluous ';' in the adjacent example. Bug introduced when adding the -perm examples in FINDUTILS-4.2.11. * NEWS: Mention the fix. Reported by Jacob Nevins <0jacobnk.gnu@chiark.greenend.org.uk> in http://savannah.gnu.org/bugs/?50758
* doc: clarify that -links counts hard links in find.1Bernhard Voelker2017-03-131-1/+1
| | | | | | | * find/find.1 (TESTS): Mention that -links tests the number of "hard links", not just "links". Reported by Dan Jacobson <jidanni@jidanni.org>.
* find: fix -printf '%h' for arguments with one or more trailing slashesBernhard Voelker2017-02-204-12/+181
| | | | | | | | | | | | | | | | | | | | | | Previously, find would output the pathname name for the '%h' format when that was passed with a trailing slash: $ mkdir foo $ find foo/ -printf '%h/%f\n' foo/foo/ * find/print.c (do_fprintf -> 'h'): Strip trailing slashes, i.e. any number of directory separators, unless this is the root "/" directory. * find/testsuite/find.gnu/printf-h.exp: Enhance test with various combinations of "/", "./", "foo/", "./foo", "./foolink/", etc. * find/testsuite/find.gnu/printf-h.xo: Add the expected output for the above new test cases. * NEWS: Mention the fix. Bug introduced in commit FINDUTILS_4_2_18-1-6-g0fd15a4. Reported by Tavian Barnes <tavianator@gmail.com> in https://savannah.gnu.org/bugs/?50259
* maint: add the bug number #50326 to NEWSBernhard Voelker2017-02-161-2/+2
| | | | | | * NEWS (Bug Fixes): Add the above bug number to the NEWS entry of commit v4.6.0-90-gc155689, now as this issue is also reported as a bug.
* gnulib: update to latestBernhard Voelker2017-02-161-0/+0
| | | | * gnulib: Do the above.
* maint: improve readability of fstype.cBernhard Voelker2017-02-081-8/+11
| | | | | | | * find/fstype.c (fstype_known): Move variable from global context ... (filesystem_type): ... here, and pass it on explicitly by reference to file_system_type_uncached(). (file_system_type_uncached): Add fstype_known as parameter.
* find: avoid unneccessary reading of the mount listBernhard Voelker2017-02-061-3/+27
| | | | | | | | | | | | Add a static cache for mount list to fstype.c. * find/fstype.c (get_file_system_list): Add wrapper around GNULIB's read_file_system_list function with a static cache to avoid multiple invocations of that GNULIB function. Still re-read the list if the first invocation didn't include the ME_TYPE members. (is_used_fs_type): Use the above new wrapper. (file_system_type_uncached): Likewise, and do not free the list here anymore because this is now done in get_file_system_list() as needed.
* maint: move is_used_fs_type to fstype.cBernhard Voelker2017-02-063-30/+30
| | | | | | * find/parser.c (is_used_fs_type): Move to ... * find/fstype.c: ... here. * find/defs.h (is_used_fs_type): Add declaration.
* maint: inline now last use of must_read_fs_listBernhard Voelker2017-02-061-19/+10
| | | | | | * find/fstype.c (must_read_fs_list): Remove function and inline body ... (file_system_type_uncached): ... here where its last use was. (get_mounted_devices): Remove it from a comment.
* maint: remove unused get_mounted_filesystemsBernhard Voelker2017-02-062-39/+0
| | | | | * find/fstype.c (get_mounted_filesystems): Remove unused function ... * find/defs.h (get_mounted_filesystems): ... and its declaration.
* find: fix memory leak in mount list handlingGoffredo Baroncelli2017-02-062-8/+4
| | | | | | | | | | | | | | | The following gnulib commit added the structure member me_mntroot which our free_file_system_list function didn't consider, thus leading to a memory leak: http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=c6148bca89e9 * find/fstype.c (free_file_system_list): Use gnulib's free_mount_entry function to free the mount list instead of free()ing all members here manually. * NEWS (Bug Fixes): Mention the fix. Reported in http://lists.gnu.org/archive/html/findutils-patches/2016-12/msg00000.html