2304 Commits

Author SHA1 Message Date
Bernhard Voelker
b00d14e97e build: colorize test output on capable terminals
* configure.ac (AM_INIT_AUTOMAKE): Add 'color-tests' option.
2018-03-14 20:44:14 +01:00
Bernhard Voelker
d4aac2d443 build: make --enable-silent-rules the default
* configure.ac (AM_SILENT_RULES): Use this, with it's undocumented
[yes] argument.  Those who want verbose build output may configure
with --disable-silent-rules or use "make V=1".
2018-03-14 20:44:14 +01:00
Bjarni Ingi Gislason
a0fada430a doc: fix various syntax issues in find.1
Changes:
- Avoid warning "(macro BR): only 1 argument, but more are expected".
- Change misused SI (metric) numeric prefixes to the binary ones, like
a bare "1K blocks" to "1 KB blocks".
- Protect a full stop (.) with "\&", if it has a blank (white-space)
in front of or (ignoring transparent characters to the full stop) after
it, and it does not mean an end of a sentence.
- Change the name of a macro for two fonts (e.g., BR and IR) to one
letter, if there is only one argument.
- Use a macro to change to the italic font, instead of \fI [1], if
possible.
- Remove space in the first column, if not intented.
- Move a full stop (period) and a comma outside of a quoted text, if
it is at the end of the quote and does not end a quoted sentence.
- Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front
of a name for an option.
- Split lines longer than 80 characters into two or more lines.
- Separate the sentences and subordinate clauses; each begins on a new
line. Or: Adjust space between sentences (two spaces).
- Fix the spelling of "kibi", "mebi", and "gibi".

* find/find.1: Do the above.

Patch contributed via https://sv.gnu.org/patch/?9585
Copyright-paperwork-exempt: Yes
2018-03-13 21:52:06 +01:00
Bernhard Voelker
040f20b91e maint: add remove-potcdate.sed to po/.gitignore
* po/.gitignore: Add the above entry which may remains after
running 'make distcheck'.
2018-01-01 19:27:32 +01:00
Bernhard Voelker
e0c68db5c0 maint: run 'make -C po update-po'
Mainly for changed line numbers, but also for one white-space change
in 'tree.c'.

* 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.
2018-01-01 19:27:21 +01:00
Bernhard Voelker
8705455ce0 maint: update copyright year number ranges
Run 'make update-copyright'.

* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
2018-01-01 19:27:15 +01:00
Bernhard Voelker
7a7dc443d7 build: add -Wno-unused-parameter
The following new warning sneaked in with the gnulib update in the
previous commit:
  In file included from parser.c:49:0:
  ../gl/lib/stat-time.h: In function 'stat_time_normalize':
  ../gl/lib/stat-time.h:215:47: error: unused parameter 'st' \
  [-Werror=unused-parameter]
   stat_time_normalize (int result, struct stat *st)
                                                 ^~

* configure.ac: Add the -Wno-unused-parameter option explicitly as it
is implied - and thus overridden - by the more general -Wunused option.
2018-01-01 19:27:05 +01:00
Bernhard Voelker
b755fd9252 maint: update gnulib to latest
* bootstrap: Merge from gnulib/build-aux/bootstrap.
2018-01-01 19:26:48 +01:00
Bernhard Voelker
25db51a53c find.1: document that access()-based options apply to the current user
* find/find.1 (-executable): Mention to whom the matching files are
accessible: to the current user.
(-readable): Likewise.
(-writable): Likewise.

Reported by 積丹尼 Dan Jacobson <jidanni@jidanni.org> in
https://lists.gnu.org/r/bug-findutils/2017-12/msg00017.html
2018-01-01 19:11:34 +01:00
Bernhard Voelker
2c3dde5afc maint: remove bootstrap from distribution
* Makefile.am (EXTRA_DIST): Remove bootstrap.
2017-11-17 19:53:01 +01:00
James Youngman
1b53838ddf regexprops: don't mention regex dialects we're not going to document.
* lib/regextype.c (get_regex_type_synonym): don't return regex
dialect Y as a synonym of dialect X, if we're not in fact going to
include X.  Accept a CONTEXT parameter in order to identify this
situation.  This ensures that the bug fixed in commit
e2c673cbcdc325a3a2e9dd02169bb4a42c61bc48 stays fixed for any
permutation of regex_map.
* lib/regextype.h: update prototype of get_regex_type_synonym.
* lib/regexprops.c (describe_all): Pass the new context parameter.
* doc/regexprops.texi: regenerate this file.
2017-11-14 22:22:36 +00:00
James Youngman
e2c673cbcd regexprops: fix dangling reference to the `ed' regular expression dialect.
* lib/regextype.c (regex_map): Permute the entries to list POSIX
dialects before other ones, so that we don't end up with a
dangling reference to `ed' regular expressions when
context=findutils.  Remove trailing white space from the output.
* doc/regexprops.texi: Regenerate this file, so that we no longer
have a dangling reference to the `ed' dialect.
* doc/find.texi (Regular Expressions): Point out the difference
between Emacs regular expressions and findutils regular
expressions: in findutils "." will match newline.
* find/find.1: Likewise.
* locate/locate.1: Likewise.  Also document the --regextype option.
2017-11-14 13:43:32 +00:00
James Youngman
e34eaa2695 po: delete po/remove-potcdate.sed so that "make distcheck" works.
* po/remove-potcdate.sed: the presence of this generated file
causes "make distcheck" to fail on VPATH builds.  Deleting it
fixes this.
2017-11-14 13:42:37 +00:00
Bernhard Voelker
1063a3667e maint: shorten https://lists.gnu.org/archive/html/... links
Each /archive/html/ part can be replace with /r/.
Run this to induce the change:
git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g'
* README: Perform that substitution.
* find/testsuite/find.posix/depth1.exp: Likewise.
* gnulib-local/lib/gcc-function-attributes.h
2017-11-13 18:40:29 +01:00
Bernhard Voelker
d43734ced4 maint: include the module year2038 from gnulib
* bootstrap.conf (gnulib_modules): Add 'year2038' to ensure that time_t
is 64-bit (and thus works after 2038).

Suggested by Bruno Haible in
https://lists.gnu.org/r/bug-gnulib/2017-11/msg00022.html
2017-11-13 18:40:29 +01:00
Bernhard Voelker
8c40dd213b maint: update gnulib to latest
* gnulib: Update - mainly for the recent year2038 changes.
* bootstrap: Update from gnulib/build-aux/bootstrap.
2017-11-13 18:40:29 +01:00
Bernhard Voelker
2de2618e5e maint: document the https change in NEWS
* NEWS (Documentation Changes): Mention the switch from http to https
done in commit 2cb10332.
2017-11-13 18:40:29 +01:00
Bernhard Voelker
aa742e34b8 all: use die() rather than error(EXIT_FAILURE)
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.
2017-11-13 18:40:29 +01:00
Bernhard Voelker
ff4701b4ef maint: avoid unused-but-set-variable, unused-parameter warnings from GCC 7
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'.
2017-11-13 18:40:29 +01:00
Bernhard Voelker
cd61e9f7ac maint: add die.h; avoid missing-fallthrough warnings after error w/ GCC 7
* 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.
2017-11-13 18:40:29 +01:00
Bernhard Voelker
cf66ca4c83 maint: avoid implicit-fallthrough warnings from GCC 7
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.
2017-11-13 18:40:29 +01:00
Bernhard Voelker
05da1fa358 maint: avoid implicit-fallthrough warnings from GCC 7
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.
2017-11-13 18:38:08 +01:00
Bernhard Voelker
3876904855 maint: avoid unused-macros warning from GCC 7
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.
2017-11-08 00:32:39 +01:00
Bernhard Voelker
6d186665f5 updatedb: use Copyright header of updatedb.sh
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'.
2017-10-30 21:18:49 +01:00
Bernhard Voelker
657d602689 tests: cleanup files left behind by sv-52220.sh
'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.
2017-10-30 18:54:10 +01:00
Bernhard Voelker
da920ee0a7 maint: use an optimal-for-findutils xz compression setting
* 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.
2017-10-28 15:53:11 +02:00
Bernhard Voelker
43f0b3601d maint: run 'make -C po update-po'
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.
2017-10-23 00:57:57 +02:00
Bernhard Voelker
2cb10332af all: prefer https:// URLs where possible
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.
2017-10-23 00:57:57 +02:00
Bernhard Voelker
079eb4cdb6 doc: add copyright section to man pages
* 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.
2017-10-23 00:57:57 +02:00
Bernhard Voelker
0548a502cd maint: add copyright header to more files
* 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.
2017-10-23 00:57:57 +02:00
Bernhard Voelker
4625495c48 maint: align copyright header line
* lib/extendbuf.c: s/Copyright/Copyright (C)/
* lib/printquoted.h: Likewise.
* lib/regextype.c: Likewise.
* lib/regextype.h: Likewise.
2017-10-23 00:57:35 +02:00
Bernhard Voelker
77651af6a8 maint: update copyright year number ranges
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.
2017-10-23 00:45:18 +02:00
Bernhard Voelker
64f5f93900 gnulib: update to latest
* bootstrap: Merge from gnulib/build-aux/.
* bootstrap.conf: Likewise.
2017-10-22 20:56:44 +02:00
Bernhard Voelker
ef1581ea51 find: avoid segfault with -D without argument
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
2017-10-22 20:50:50 +02:00
Bernhard Voelker
77e4a7f17f maint: fix typos in commments
* find/fstype.c: s/unneccessary/unnecessary/
* xargs/xargs.c: s/utliity/utility/
2017-10-10 07:34:54 +02:00
Bernhard Voelker
abb69e6ade find.1: improve explanation in the NON-BUGS section
* 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.
2017-09-14 00:50:10 +02:00
Andreas Metzler
bcf55b0fff tests: test more printf format specifiers
* 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.
2017-09-08 21:59:17 +02:00
James Youngman
41dd17cb87 intl: update Brazilian Portuguese, Slovak, Dutch translations.
* po/pt_BR.po: Update Brazilian Portuguese translation.
* po/sk.po: Update Slovak translation.
* po/nl.po: Update Dutch translation.
2017-09-03 12:46:10 +01:00
Bernhard Voelker
febde26dd0 find: avoid buffer-overflow with -printf '%T+'
* 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.
2017-08-28 23:15:12 +02:00
Bernhard Voelker
971d3422b6 maint: fix typo in comment
* 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
2017-08-28 22:46:24 +02:00
Bernhard Voelker
a8fc03d980 doc: add a NEWS entry for the previous commit
* NEWS (Improvements): Add an entry for v4.6.0-115-g9530e31.
2017-08-18 20:43:39 +02:00
Assaf Gordon
9530e31f6d find: give helpful hint for unquoted patterns errors
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.
2017-08-17 08:14:52 +02:00
Bernhard Voelker
50a7c5d1f5 find: avoid usage() in more error cases
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
2017-08-10 08:45:56 +02:00
James Youngman
808d8aa612 po/*.po: update line numbers. 2017-07-29 13:13:16 +01:00
James Youngman
79e8e03cda gnulib: update to f42d5af5ba76970309c5704db1c229143043bcc0.
* build-aux/.gitignore: arg-nonnull.h, ar-lib, c++defs.h.
2017-07-29 13:03:15 +01:00
James Youngman
95816b29d4 find: avoid strftime's non-portable %F specifier.
* 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>.
2017-07-23 22:19:42 +01:00
James Youngman
f1f03e0c47 ChangeLog: fix some incorrectly-formatted messages.
* 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.
2017-07-23 21:05:17 +01:00
James Youngman
3e94355b19 Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/findutils 2017-07-23 20:39:10 +01:00
James Youngman
f146a24340 locate: don't warn about slocate databases any more.
* locate/locate.c (search_one_database): Remove warning about
support for slocate databases being new.
2017-07-23 20:38:12 +01:00
James Youngman
5e56fe96bc 2017-07-23 James Youngman <jay@gnu.org>
* locate/locate.c (search_one_database): Remove warning about
	support for slocate databases being new.
2017-07-23 20:36:32 +01:00