* 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>
* 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>
* 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>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
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>
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>
* 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>
* 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>
* 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>
* 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>
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.
* 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>
* 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>
* 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>