1755 Commits

Author SHA1 Message Date
James Youngman
1f5cd46311 Prepare for release of findutils-4.5.7.
* configure.ac: Update version number.
* NEWS: Mention the translation changes.  Update version number.

Signed-off-by: James Youngman <jay@gnu.org>
v4.5.7
2010-04-03 14:40:45 +01:00
James Youngman
58ca72f90f Accelerate find/testsuite/find.posix/exec-nogaps.exp.
* find/testsuite/config/unix.exp (optimisation_levels_to_test):
New function, decides which optimisation levels we shuld run find
at for the current test.  Set $OPTIMISATION_LEVELS to control
this.
(find_start): Call optimisation_levels_to_test to determine which
optimisation levels to run find at.
* find/testsuite/find.posix/exec-nogaps.exp: Run the test only at
-O3 (but for both oldfind and ftsfind).

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 14:37:35 +01:00
James Youngman
37971fb470 Correct the format of copyright statements, and add 2010.
* lib/fdleak.h: Correct the format of the copyright statement.
* po/vi.po: Likewise.
* lib/safe-atoi.h: Likewise.
* locate/locate.c: Likewise.
* po/ca.po: Likewise.
* po/gl.po: Likewise.
* po/fi.po: Likewise.
* po/it.po: Likewise.
* po/findutils.pot: Fill in the boilerplate in the header.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 12:22:57 +01:00
James Youngman
781ac288c6 Update copyright years.
* find/defs.h: Update copyright years.
* find/finddata.c: Likewise.
* find/sharefile.h: Likewise.
* lib/buildcmd.h: Likewise.
* lib/dircallback.h: Likewise.
* lib/extendbuf.h: Likewise.
* lib/findutils-version.h: Likewise.
* lib/gnulib-version.h: Likewise.
* lib/listfile.h: Likewise.
* lib/nextelem.c: Likewise.
* lib/nextelem.h: Likewise.
* lib/printquoted.h: Likewise.
* lib/regextype.h: Likewise.
* lib/savedirinfo.h: Likewise.
* lib/strspn.c: Likewise.
* lib/waitpid.c: Likewise.
* locate/locatedb.h: Likewise.
* m4/mkinstalldirs.m4: Likewise.
* m4/noreturn.m4: Likewise.
* build-aux/check-testfiles.sh: Likewise.
* build-aux/src-sniff.py: Likewise.
* import-gnulib.sh: Likewise.
* locate/testsuite/config/unix.exp: Likewise.
* locate/updatedb.sh: Likewise.
* xargs/testsuite/config/unix.exp: Likewise.
* po/*.po: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 12:22:57 +01:00
James Youngman
ead2b68cb8 Add the update-copyright gnulib module.
* import-gnulib.config (maintainer_modules): Separate out the
modules primarily useful for maintainer activities.  Add
'update-copyright' to this.
* build-aux/.cvsignore: Ignore update-copyright, since it's
installed by gnulib.
* build-aux/.gitignore: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 12:22:57 +01:00
James Youngman
0a1c5b8287 Ignore generated files for the convenience of non-VPATH users.
* lib/.gitignore: Ignore object and archive files.
* find/.gitignore: Likewise.
* locate/.gitignore: Ignore object files.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 12:22:57 +01:00
James Youngman
fef6e5fa5d Check for accidental modifications to the wrong section of the NEWS file.
* cfg.mk (local-checks-to-skip): Remove sc_immutable_news.
(old_NEWS_hash): add existing hash (from "make update-NEWS-hash").

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:11 +01:00
James Youngman
efd6e25a4b cfg.mk: simplify variables
* cfg.mk: Append the names of checks to skip to
local-checks-to-skip rather than inventing 7 new variables.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:11 +01:00
James Youngman
238b7d525b Don't include quote.h/quotearg.h where it is not used.
* find/find.c: Don't include "quote.h", it's not used.
* find/ftsfind.c: Likewise.
* find/parser.c: Likewise.
* locate/locate.c: Likewise.
* locate/word_io.c: Likewise.
* cfg.mk (skip_dunno): Enable check sc_prohibit_quote_without_use.
* find/find.c: Don't include "quotearg.h", it's not used.
* lib/fdleak.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:11 +01:00
James Youngman
a058767687 Use set_program_name() to remember the programs' names.
* cfg.mk *skip(defer): Enable sc_program_name.  Remove the
now-unused variable skip_defer.
* find/ftsfind.c: Include "program_name.h".
(main): Call set_program_name.
* find/find.c: Include "program_name.h".
(main): Call set_program_name.
* locate/locate.c: Include "program_name.h".
(dolocate): Call set_program_name.
Remove global variable program_name.
* locate/bigram.c: Include "program_name.h".
Remove global variable "program_name".
(main): Call set_program_name.
* locate/frcode.c: Include "program_name.h".
(main): Call set_program_name.
* xargs/xargs.c (main): Call set_program_name.
Include "program_name.h".
Remove global variable program_name.
* find/finddata.c: Remove global variable program_name.
* find/defs.h: No longer need declaration of program_name.
* find/util.c: Include "program_name.h".

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:11 +01:00
James Youngman
7ad98986ff Avoid using magic numbers as exit statuses.
Avoid using magic numbers as exit statuses.
* cfg.mk (skip_defer): Enable sc_prohibit_magic_number_exit.
* doc/find-maint.texi (Security): Avoid error (1, ...) in the
example patch.
* find/find.c (main): Use exit status EXIT_FAILURE instead of 1.
(wd_sanity_check): Likewise.
(safely_chdir_lstat): Likewise.
(process_dir): Likewise.
* find/fstype.c (must_read_fs_list): Likewise.
* find/ftsfind.c (main): Likewise.
(main): Likewise.
* find/parser.c (check_option_combinations): Use exit status
EXIT_FAILURE instead of 1.
(parse_group): Likewise.
(parse_help): Use exit status EXIT_SUCCESS instead of 0.
(parse_version): Likewise.
(fnmatch_sanitycheck): Use exit status EXIT_FAILURE instead of 1.
(insert_depthspec): Likewise.
(parse_newerXY): Likewise.
(non_posix_mode): Likewise.
(parse_perm): Likewise.
(insert_regex): Likewise.
(parse_size): Likewise.
(parse_show_control_chars): Likewise.
(parse_used): Likewise.
(parse_user): Likewise.
(parse_context): Likewise.
(insert_type): Likewise.
(insert_fprintf): Likewise.
(make_segment): Likewise.
(check_path_safety): Likewise.
(new_insert_exec_ok): Likewise.
(get_relative_timestamp): Likewise.
(parse_time): Likewise.
* find/tree.c (get_expr): Use exit status EXIT_FAILURE instead of 1.
(scan_rest): Likewise.
(get_pred_cost): Likewise.
(get_pred_cost): Likewise.
(build_expression_tree): Likewise.
(get_new_pred_chk_op): Likewise.
* find/pred.c (launch): Use exit status EXIT_FAILURE instead of 1.
* find/util.c (process_debug_options): Use exit status
EXIT_SUCCESS instead of 0.
(process_optimisation_option): Use exit status EXIT_FAILURE
instead of 1.
(set_option_defaults): Likewise.
* lib/buildcmd.c (exceeds): Likewise.
(bc_do_exec): Likewise.
(bc_push_arg): Likewise.
* lib/nextelem.c: Remove test code.
* lib/safe-atoi.c (safe_atoi): Use exit status EXIT_FAILURE
instead of 1.
* lib/regextype.c (get_regex_type): Use exit status EXIT_FAILURE
instead of 1.  Include <stdlib.h>, for EXIT_FAILURE.
* locate/locate.c (set_max_db_age): Use exit status EXIT_FAILURE
instead of 1.
(set_max_db_age): Likewise.
(toolong): Likewise.
(visit_locate02_format): Likewise.
(search_one_database): Likewise.
(drop_privs): Likewise.
* locate/frcode.c (get_seclevel): Use exit status EXIT_FAILURE
instead of 1.
(outerr): Likewise.
(main): Likewise.
* locate/code.c (inerr): Use exit status EXIT_FAILURE instead of
1.
(outerr): Likewise.
* locate/word_io.c (getword): Use exit status EXIT_FAILURE instead of 1.

Use named constants for xargs exit codes.
* xargs/xargs.c (child_error): Use EXIT_SUCCESS instead of 0.
(enum XargsStatusValues): introduce named constants for the
various things that cause speicific exit codes.
(enum  ClientStatusValues): Also introduce named constants for the
child's exit status.
(get_char_oct_or_hex_escape): Use EXIT_FAILURE instead of 1.
(get_input_delimiter): Likewise.
(main): Likewise.
(read_line): Likewise.
(read_string): Likewise.
(print_args): Likewise.
(xargs_do_exec): Likewise.
(wait_for_proc): Likewise.
(wait_for_proc): Use enum XargsStatusValues for exit codes.
(parse_num): Use EXIT_FAILURE instead of 1.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:11 +01:00
James Youngman
bcc0287a0d Avoid sc_prohibit_stat_st_blocks check, since it is broken.
* cfg.mk (skip_broken_checks): Skip sc_prohibit_stat_st_blocks.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:10 +01:00
James Youngman
ff9af635b0 Enable syntax checker sc_the_the, detecting doubled 'the'.
* cfg.mk (false_positives): Enable syntax checker sc_the_the
* build-aux/src-sniff.py (checkers): Avoid false positive with
sc_the_the.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:10 +01:00
James Youngman
3ec1c93946 sc_prohibit_strcmp gives false positives when neither argument is a constant, so skip that check 2010-04-03 10:08:10 +01:00
James Youngman
77b97a0ec4 Avoid sscanf. Avoid false positives for sc_prohibit_atoi_atof.
* lib/fdleak.c (get_proc_max_fd): Use safe_atoi to do string to
int conversion, instead of sscanf.  Skip '.' and '..'.
* find/util.c (set_option_defaults): Avoid false positive with
sc_prohibit_atoi_atof.
(check_nofollow): Likewise.
* cfg.mk (skip_defer): Enable the sc_prohibit_atoi_atof check.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:10 +01:00
James Youngman
2629fdd269 Remove files which exist but have no translated messages.
* po/POTFILES.in: Remove dircallback.c, listfile.c.
* lib/listfile.c: Don't include libintl, since there are no
translated messages in this file.
* lib/dircallback.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:10 +01:00
James Youngman
6d49662c42 Remove some obsolete source files from POTFILES.in 2010-04-03 10:08:10 +01:00
James Youngman
660945c876 Move safe_atoi out into a separate module.
* find/parser.c: Include "safe-atoi.h".  Remove the body of safe_atoi.
(parse_group): pass options.err_quoting_style to safe_atoi.
(insert_depthspec): Likewise.
(parse_user): Likewise.
* lib/safe-atoi.h: New file.
* lib/safe-atoi.c: New file.  Add parameter for quoting style (to
avoid an external reference to the "options"struct).
* lib/Makefile.am (libfind_a_SOURCES): Add safe-atoi.c and
safe-atoi.h.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:08:06 +01:00
James Youngman
7027ce445a configure.ac: Quote the first argument to AC_DEFINE 2010-04-03 10:07:30 +01:00
James Youngman
aca33f8515 Avoid false positives for the sc_prohibit_test_minus_ao syntax check.
* doc/find.texi (Updating A Timestamp File): Work around a syntax
check designed to prevent the use of "test X -a Y".
* find/find.1: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:30 +01:00
James Youngman
aebcd8c049 Don't include xalloc.h where we don't use it.
* find/ftsfind.c: We don't use anything from xalloc.h, so don't

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:30 +01:00
James Youngman
aca096484c Fix some compilation unused-result and missing-declaration warnings.
Eliminate some unused function result warnings.
* lib/unused-result.h: New file, defines function attribute macro
__attribute_warn_unused_result__.
* lib/Makefile.am (EXTRA_DIST): Add unused-result.h.
* find/ftsfind.c (find): Issue a diagnostic if fts_close fails,
change return type to bool and return false for this case.  Add
__warn_unused_result__ attribute.
(process_all_startpoints): Likewise (except no need for second
diagnostic).
(main): If process_all_startpoints failed, don't do the cleanup
operations because we don't know what subdirectory we're in.

* find/util.c (fd_leak_check_is_enabled): Avoid implicit
pointer-to-int conversion.
* lib/buildcmd.c: #include <stdlib.h> for declaration of free.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:30 +01:00
James Youngman
6115892b33 Fix some space-followed-by-tab sequences.
* NEWS: Change space-tab sequences to just spaces.
* build-aux/check-testfiles.sh (main): Likewise
* build-aux/src-sniff.py (checkers): Likewise.
* find/Makefile.am: Likewise.
* find/testsuite/find.posix/sv-bug-25359.exp: Likewise.
* import-gnulib.sh (check_merge_driver): Likewise.
* m4/withfts.m4 (FIND_WITH_FTS): Likewise.
* cfg.mk (false_positives): Explain why we can't enable the
sc_space_tab check (xargs .xo test files).

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:29 +01:00
James Youngman
be821d9d87 * cfg.mk: Explain that we cannot enable the sc_texinfo_acronym
syntax check right now, since the perm.texi file uses
@acronym{GNU} but we try to keep that in sync. with coreutils.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:29 +01:00
James Youngman
3a73585e9a Mark some missed error messages for translation.
* find/parser.c (safe_atoi): Likewise.
* find/pred.c (pred_context): Likewise.
(do_fprintf): Likewise.
* xargs/xargs.c (xargs_do_exec): Translate error message.
(xargs_do_exec): Likewise.
* lib/buildcmd.c (exceeds): Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:29 +01:00
James Youngman
13a991a20a Add customisation of the behaviour of "make syntax-check".
* cfg.mk: New file; configuration file for the maintainer-makefile
provided by gnulib.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:29 +01:00
James Youngman
8d81d17769 Various coding standard fixes.
* lib/regextype.c: Don't use HAVE_CONFIG_H.
* doc/find-maint.texi: Remove RCS keywords (they were in an
example security vulnerability announcement).

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:29 +01:00
James Youngman
eea6377644 Don't define S_IS*; include <sys/stat.h> instead.
* lib/modetype.h: Remove (all it does is define S_IS*).
* lib/Makefile.am (EXTRA_DIST): Remove modetype.h.
* lib/listfile.c: Don't define S_IS* macros.
* find/pred.c: Don't include "modetype.h".
* find/parser.c: Likewise.
* find/ftsfind.c: Likewise.
* find/fstype.c: Likewise.
* find/find.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-03 10:07:17 +01:00
James Youngman
482dcb36e7 Quote the first argument of AC_DEFINE.
Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:20:29 +01:00
James Youngman
047e3fa0fb Coding standard fix: "Warning" should be "WARNING" or "warning".
* find/find.c (dirchange_is_fatal): Change "Warning" to "WARNING".
* find/ftsfind.c (consider_visiting): Likewise.
* find/pred.c (pred_newerXY): Likewise.
* find/util.c (get_statinfo): Likewise.
(hook_fstatat): Likewise.
* locate/word_io.c (decode_value): Likewise.
* xargs/xargs.c (main): Change "Warning" to "warning".
(read_line): Change "Warning" to "WARNING".
(wait_for_proc): Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:19:19 +01:00
James Youngman
731a1c7870 Remove useless if conditionals before calls to 'free'.
* lib/nextelem.c (next_element): Remove useless if-before-free.
* lib/buildcmd.c (bc_do_exec): Likewise.
* find/find.c (process_dir): Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:18:28 +01:00
James Youngman
54be05893c Avoid false-positive of GPL_version check in maint.mk.
* import-gnulib.sh (usage): Defeat the simple GPL version check
of maint.mk, since it's trying to identify GPL2 licenses.  Since
the 'rehack' script converts v2 licenses into v3, we get a false
positive for v2.  So, amusingly, we use the same hack that
maint.mk uses to avoid a false positive on itself: spurious
quotes.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:17:23 +01:00
James Youngman
bb48cc21d8 Regenerate doc/regexprops.texi
Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:16:21 +01:00
James Youngman
7bb738db58 Switch from GNU Free Documentation License 1.2 to 1.3.
* NEWS: Update GFDL version.
* README-hacking: Likewise.
* doc/find-maint.texi: Likewise.
* lib/regexprops.c: Likewise (though the license being changed is the
license for the output).

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:16:21 +01:00
James Youngman
c6cc1c1bb9 Update copyright years
Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:15:40 +01:00
James Youngman
d2eb02ad77 Change error (1, ...) to error (EXIT_FAILURE, ...).
* find/find.c: Change error (1, ...) to error (EXIT_FAILURE, ...).
* find/fstype.c: Likewise.
* find/ftsfind.c: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/tree.c: Likewise.
* find/util.c: Likewise.
* locate/code.c: Likewise.
* locate/frcode.c: Likewise.
* locate/locate.c: Likewise.
* locate/word_io.c: Likewise.
* xargs/xargs.c: Likewise.
* lib/buildcmd.c: Likewise.  Also include <stdlib.h>.
* lib/regextype.c: Likewise (both).

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:07:53 +01:00
James Youngman
3ce5495662 Assume C89 (or C99) C headers. Assume working <ctype.h>.
* xargs/xargs.c: Unconditionally include <ctype.h>.  Assume
isblank(c) is defined.  Assume memcpy() has a prototype in
<string.h>.
* import-gnulib.config (modules): Import gnulib's ctype module.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 21:06:11 +01:00
James Youngman
0584ae4132 Use the maintainer-makefile module.
* import-gnulib.config (modules): Add maintainer-makefile.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 01:47:10 +01:00
James Youngman
7c94e22158 Update copyright years
Signed-off-by: James Youngman <jay@gnu.org>
2010-04-02 01:46:32 +01:00
James Youngman
37e02b56f7 Move the -fstype NOTUSED description to the correct version
Signed-off-by: James Youngman <jay@gnu.org>
2010-04-01 21:45:04 +01:00
James Youngman
cbdfd2d86f Optimise -fstype NOTUSED to -false at -O2.
Optimise -fstype NOTUSED to -false at -O2.
* find/parser.c: Include mountlist.h.
(insert_false): New function, inserts a -false predicate.
(parse_false): Use insert_false.
(is_used_fs_type): New function, determines if any mounted
filesystem is of the named type.
(parse_fstype): At optimisation level 2 and above, -fstpe FOO
is converted to -false if no mounted filesytem is of type FOO.
* find/find.1: Document this optimisation.
* doc/find.texi (Optimisation Options): Likewise.
* NEWS: Mention this change.
2010-04-01 21:30:54 +01:00
James Youngman
64f3d9b616 Updated copyright years to add 2010.
* find/find.c: Add 2010.
* find/fstype.c: Add 2010.
* find/ftsfind.c: Add 2010.
* find/parser.c: Add 2010.
* find/pred.c: Add 2010.
* find/sharefile.c: Add 2010.
* find/testsuite/config/unix.exp: Add 2010.
* find/tree.c: Add 2010.
* find/util.c: Add 2010.
* locate/bigram.c: Add 2010.
* locate/frcode.c: Add 2010.
* xargs/xargs.c: Add 2010.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-01 00:34:20 +01:00
James Youngman
8565f667a2 Coding style fixes: space after function names.
* locate/code.c: Insert a space between function name and open parenthesis.
* locate/frcode.c: Likewise.
* locate/locate.c: Likewise.
* locate/word_io.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-01 00:15:16 +01:00
James Youngman
419e5eff64 Coding style fixes: space after function names.
* lib/buildcmd.c: Insert a space between function name and open
parenthesis.
* lib/dircallback.c: Likewise.
* lib/extendbuf.c: Likewise.
* lib/fdleak.c: Likewise.
* lib/findutils-version.c: Likewise.
* lib/forcefindlib.c: Likewise.
* lib/listfile.c: Likewise.
* lib/printquoted.c: Likewise.
* lib/qmark.c: Likewise.
* lib/regexprops.c: Likewise.
* lib/regextype.c: Likewise.
* lib/savedirinfo.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-01 00:06:23 +01:00
James Youngman
a0f8455a0b Coding style fixes: space after function names.
* xargs/xargs.c: Insert a space between function name and open parenthesis.

Signed-off-by: James Youngman <jay@gnu.org>
2010-03-31 23:54:42 +01:00
James Youngman
1dbd097704 Coding style fixes: space after function names.
* find/util.c: Insert a space between function name and open parenthesis.
* find/ftsfind.c: Likewise.
* find/fstype.c: Likewise.
* find/util.c: Likewise.
* find/tree.c: Likewise.
* find/sharefile.c: Likewise.
* find/pred.c: Likewise.
* find/parser.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-03-31 23:20:33 +01:00
James Youngman
4923104db9 Move version number on to 4.5.7-git, so that we can make test releases.
* configure.ac: Update version number.
* NEWS: Likewise.
* Makefile.am (AUTOMAKE_OPTIONS): Return to "gnits" rules.

Signed-off-by: James Youngman <jay@gnu.org>
2010-03-31 22:31:20 +01:00
James Youngman
6dbe9ec453 Prepare for release of findutils-4.5.6b (replacing findutils-4.5.6).
* configure.ac: Update version number.
* NEWS: Update version number.
* Makefile.am: switch to 'gnu' option ('gnits' forbids the 'b' suffix).

Signed-off-by: James Youngman <jay@gnu.org>
v4.5.6b
2010-03-31 00:19:55 +01:00
James Youngman
c054722450 Describe previous change
Signed-off-by: James Youngman <jay@gnu.org>
v4.5.6
2010-03-30 21:01:12 +01:00
James Youngman
391bc69a27 Prepare for release of findutils-4.5.6
* configure.ac: Update version number.
* NEWS: Update version number.

Signed-off-by: James Youngman <jay@gnu.org>
2010-03-30 21:00:45 +01:00