2293 Commits

Author SHA1 Message Date
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
Bernhard Voelker
0e74f89b5c doc: update the "STANDARDS CONFORMANCE" section in find.1
* 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.
2017-06-29 19:02:08 +02:00
Bernhard Voelker
e4d77529d7 doc: clarify 'find -size' values prefixed with '+' and '-'
* 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.
2017-06-29 18:50:29 +02:00
Bernhard Voelker
d2f3e014a0 doc: fix explanation of 'find -size' example
'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.
2017-06-29 18:36:23 +02:00
Bernhard Voelker
79bc9191c7 doc: use correct IEC unit prefixes in the documentation of 'find -size'
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
2017-06-29 18:31:07 +02:00
Andreas Metzler
3e4bb112ae doc: drop workarounds for missing xargs -o option
* 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.
2017-06-09 00:44:42 +02:00
Bernhard Voelker
40cd25147b xargs: add -o, --open-tty option
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
2017-06-09 00:44:42 +02:00
Bernhard Voelker
6dfd05ca58 doc: fix some -perm examples in find.info
* 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
2017-04-13 08:41:20 +02:00
Bernhard Voelker
11a050cdb0 doc: clarify that -links counts hard links in find.1
* find/find.1 (TESTS): Mention that -links tests the number of
"hard links", not just "links".

Reported by Dan Jacobson <jidanni@jidanni.org>.
2017-03-13 08:12:11 +01:00
Bernhard Voelker
2a6129bfcc find: fix -printf '%h' for arguments with one or more trailing slashes
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
2017-02-20 18:54:08 +01:00
Bernhard Voelker
9d849f77d5 maint: add the bug number #50326 to NEWS
* 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.
2017-02-16 18:57:06 +01:00
Bernhard Voelker
f256654b5b gnulib: update to latest
* gnulib: Do the above.
2017-02-16 18:43:03 +01:00