230 Commits

Author SHA1 Message Date
f593432309 maint: avoid sc_prohibit_always_true_header_tests failure.
* configure.ac: Check for getrlimit function directly rather than the
"sys/resource.h" header file.
* lib/fdleak.c: Include "sys/resource.h" when HAVE_GETRLIMIT is set.
(get_max_fd): s/HAVE_GETRUSAGE/HAVE_GETRLIMIT/.
2015-12-28 10:15:31 +00:00
852e4225af maint: avoid syntax-check failures
* Makefile.am (gen-ChangeLog): Replace 8 spaces by a tab to avoid
sc_makefile_TAB_only_indentation failure.
* po/POTFILES.in: Remove some entries to let sc_po_check pass.
While at it, sort the entries.
* find/print.c (do_fprintf): Remove stray semicolon to let
sc_prohibit_double_semicolon pass.
* find/util.c (digest_mode): Likewise.
* bootstrap.conf: Change comment to let sc_prohibit_doubled_word pass.
* build-aux/git-log-fix: Remove empty lines at EOF to let
sc_prohibit_empty_lines_at_EOF pass.
* find/testsuite/Makefile.am: Likewise.
* find/testsuite/sv-34079.sh: Likewise.
* find/testsuite/test_inode.sh: Likewise.
* locate/testsuite/locate.gnu/slocate.exp: Likewise.
* lib/buildcmd.c: Remove unused include of openat header to let
sc_prohibit_openat_without_use pass.
* lib/listfile.c: Likewise.
* find/util.c: Remove unused include of 'verify.h' to let
sc_prohibit_verify_without_use pass.
* xargs/xargs.c: Likewise.
* find/parser.c (insert_regex): Mark error diagnostic for translation;
found by 'make sc_unmarked_diagnostics'.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Exempt the
2 remaining sources using the possibly dangerous strncpy function
from the syntax-check.
2015-12-28 10:15:31 +00:00
Andreas Metzler
783704be4e Use the official FDL license wording in license text.
* README-hacking (footer): use the official FDL license wording as
listed in FDL's "ADDENDUM: How to use this License for your
documents". Update copyright year.
* NEWS (footer): Likewise.
* doc/find-maint.texi: Likewise.
* doc/find.texi: Likewise.
* doc/regexprops.texi: Likewise.
* lib/regexprops.c (copying): Amend the code to emit the updated
wording.  Update the copyright year.
2015-12-27 15:43:53 +00:00
James Youngman
9f640e8034 Document the functions declared in regextype.h.
* lib/regextype.h: Document the semantics of the functions
declared in this header.
2015-12-23 18:34:59 +00:00
James Youngman
771ace2582 Add copyright headers to some files which lack them.
* find/testsuite/excuses.txt: remove spurious character (a typo).
* find/testsuite/test_escape_c.sh: Add copyright header.
* find/testsuite/binary_locations.sh: Likewise.
* find/testsuite/checklists.py: Likewise.
* find/testsuite/Makefile.am: Likewise.
* find/testsuite/sv-bug-32043.sh: Likewise.
* find/testsuite/test_escapechars.sh: Likewise.
* find/testsuite/test_inode.sh: Likewise.
* xargs/testsuite/Makefile.am: Likewise.
* locate/testsuite/Makefile.am: Likewise.
* build-aux/Makefile.am: Likewise.
* doc/Makefile.am: Likewise.
* find/print.h: Likewise.
* lib/check-regexprops.sh: Likewise.
2015-11-01 14:37:12 +00:00
James Youngman
731826cc8d find: adaptive column alignment (resolves Savannah bug #45780)
* lib/listfile.c (list_file): For aligned fields, use the number
of characters output to deduce whether our current idea of the
maximum width of each field is too small.  When this happens,
increase the field width.  Keep track of the field width in a
static variable for each field.  Do this for the inode number,
number of blocks, owner, group, major and minor device numbers,
and the file size.  Use mbswidth in some places to count
characters.
* find/print.c (do_fprintf): Mention the potential portability
problems in casting ino_t to uintmax_t.
* bootstrap.conf (gnulib_modules): Add mbswidth.
* po/Makevars (XGETTEXT_OPTIONS): updated by running bootstrap.
*NEWS: Mention this bugfix.
2015-10-31 23:26:31 +00:00
James Youngman
eb61454479 Stop ignoring the now-nonexistent gnulib-version.c.
* lib/.gitignore: remove gnulib-version.c since we no longer
create it.
2015-05-10 21:15:54 +01:00
James Youngman
d5234fe96a Standardize on "initialize".
* find/exec.c (initialise_wd_for_exec): rename to
initialize_wd_for_exec, since "initialize" is the preferred form
even in UK spelling (the OED says "initialise" is a variant).
Update callers (it's a static function).  Update spelling in
comments.
* find/find.c (main): Fix missing "to" in error message and update
"initialise" to "initialize".  Update comment too.
* find/ftsfind.c (main): Update spelling in error message.
* lib/listfile.c (print_name_with_quoting): spelling change in
comment.
* find/tree.c (init_pred_perf): Likewise.
* lib/extendbuf.c (extendbuf): Likewise.
* lib/splitstring.h: Likewise.
* find/print.c (format_date): Likewise.
* doc/find-maint.texi (Tools): Update spelling.
2014-07-19 11:17:52 +01:00
James Youngman
67a87f51c6 Fix bug #42793: "Failed to write output" with -ls.
* lib/listfile.c (print_name_with_quoting): Avoid using the
variable fprintf_result before it is initialised.  I hope this
fixes Savannah bug #42793.
2014-07-19 00:46:35 +01:00
James Youngman
8acf1d2ecf Bug #35753: check the success/failure of material I/O operations.
* lib/listfile.c (list_file): Check the result of fprintf to
determine if there was an I/O error on output.  Return false (bool
instead of void) if so.
(print_name_without_quoting): Likewise.
(print_name_with_quoting): Likewise.
(print_name): Propagate the result of print_name_without_quoting
or print_name_with_quoting (and make all three functions return bool).
* find/pred.c (is_ok): Check the result of fprintf to
determine if there was an I/O error on output.  Exit fatally if
there was a problem (since we cannot expect the user to say "yes"
or "no" to a prompt they will not have seen).
* xargs/xargs.c (print_args): Check the result of fprintf and
fflush to determine if there was an I/O error on output.  Exit
fatally for the same reason as above if there is a problem.
* NEWS: Mention this bugfix (now that it is fully fixed).
2013-12-08 21:02:51 +00:00
Dmitry V. Levin
29f3173a56 find: fix potential buffer overflow in -execdir and -okdir
* lib/buildcmd.c (bc_push_arg): Take prefix length into account
to avoid state->argbuf overflow.
* NEWS: Mention this fix.
2013-09-21 22:55:43 +01:00
James Youngman
16e147b990 Don't use reserved identifiers in macro names; fix other code smells.
* build-aux/src-sniff.py (checkers): Check for #define directives
which use a macro name which is reserved.
(MakefileRegexChecker): New class which performs regex checks on
makefiles; this ensures that we don't check Makefile.in if we're
going to check Makefile.am anyway.
* lib/unused-result.h: Don't use a reserved identifier in the
macro name defined as the #include guard.
* locate/locatedb.h: Likewise.
* Makefile.am (findutils-check-smells): Don't check gnulib code.
* import-gnulib.sh (hack_gnulib_tool_output): Move the 'do' of a
for loop onto the line following the 'for' (instead of the same
line).
2013-03-31 20:25:49 +01:00
Kamil Dudka
02a26d7ce5 Fix compile-time warnings.
* find/defs.h (struct predicate): Add a missing const modifier.
* find/find.c (wd_sanity_check): Suppress a warning in #else branch.
(process_dir): Remove an unused variables and statements.
* find/pred.c (pred_context): Use const modifier in the prototype.
* lib/buildcmd.{c,h} (bc_args_exceed_testing_limit): Remove a const
modifier causing unnecessary warnings.
* xargs/xargs.c (main): Add explicit type-casts.
2013-03-26 23:46:30 +00:00
James Youngman
a917eb988f Bugfix to "make clean": do not delete header files.
* lib/Makefile.am (coverage-clean): Remove output files left
behind by gcc -fprofile-arcs -ftest-coverage by using $(RM) with a
glob pattern rather than a $(libfindtools_a_SOURCES.c=.gcno)
Makefile substitution, because the latter caused us to delete
header files entirely (their names do not end in .c).  This had
meant that it was impossible to compile findutils after "make
clean".  Bug report by David Gilbert.
* find/Makefile.am (coverage-clean): Likewise.
* xargs/Makefile.am (coverage-clean): Likewise.
* locate/Makefile.am (coverage-clean): Likewise.
* Makefile.am (coverage-clean): Likewise, but also do this in the
subdirectories whose Makefile.am files are generated by
gnulib-tool.
2013-03-24 14:09:14 +00:00
Kamil Dudka
609853e791 Avoid using 'INCLUDES =' in automake templates.
* find/Makefile.am: Use AM_CPPFLAGS instead of deprecated INCLUDES.
* lib/Makefile.am: Likewise.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
2013-02-03 23:18:23 +00:00
James Youngman
81e33db099 Remove no-longer-used files savedir.[ch].
* lib/savedirinfo.c: delete unused file.
* lib/savedirinfo.h: delete unused file.
* lib/Makefile.am (libfind_a_SOURCES): Remove savedirinfo.c.
(EXTRA_DIST): Remove savedirinfo.h.
2011-08-21 11:25:37 +01:00
James Youngman
0da37ec720 Remove test-coverage output files for "make clean".
* find/Makefile.am (CLEANFILES): Clean the .gcda and .gcdo files
which are produced by running programs that were compile with gcc
-fprofile-arcs -ftest-coverage.
* lib/Makefile.am (CLEANFILES): Likewise.
* locate/Makefile.am (CLEANFILES): Likewise.
* xargs/Makefile.am (CLEANFILES): Likewise.
2011-06-21 10:59:06 +01:00
James Youngman
dc2382e31a Fix some compiler warnings in xargs.
* xargs/xargs.c: Remove definition of the unused macro VOID.
Include error.h instead of declaring error (incorrectly).
Change the type of lineno from int to size_t.
(get_char_oct_or_hex_escape): Don't point endp unnecessarily at p,
because they have different constness.  There's no need for this,
just initialise it to NULL.
(main): Make input_file const.   Make the default arglist
non-const, to avoid a constness warning.
(main): Pass the option name as the argument to error's %s format,
as opposed to the whole struct (this was a bug, but since the name
member was the first in the struct, there were probably no
symptoms).
(main): read_args returns an int, but the only negative value it
can return is -1.  Once we know that didn't happen, assign the
value to a size_t variable to avoid signed/unsigned warnings
elsewhere.
(xargs_do_exec): Manually inhibit some unused-parameters warnings.
(print_args): Use size_t as the type of a loop variable.
(wait_for_proc): Since procs_executing is an unsigned long, use a
%lu format specifier to print it.
(increment_proc_max): Inhibit an unused-parameter warning (the
signal number).
(decrement_proc_max): Likewise.
* lib/buildcmd.h (struct buildcmd_control): Make member
replace_pat const.  Change the type of lines_per_exec to unsigned
long.
2011-06-21 10:42:45 +01:00
James Youngman
633c791d97 Use a consistent include order in header files too.
* lib/printquoted.h: Use the preferred header-file inclusion order
here too.
2011-06-20 10:26:26 +01:00
James Youngman
8becd09bb9 Use a consistent order for header-file inclusion.
* find/exec.c: Include config.h, then system headers followed by
gnulib headers and last, find-specific headers.
* find/find.c: Likewise.
* find/finddata.c: Likewise.
* find/fstype.c: Likewise.
* find/ftsfind.c: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/tree.c: Likewise.
* find/util.c: Likewise.
* lib/buildcmd.c: Likewise.
* lib/dircallback.c: Likewise.
* lib/extendbuf.c: Likewise.
* lib/fdleak.c: Likewise.
* lib/findutils-version.c: Likewise.
* lib/listfile.c: Likewise.
* lib/printquoted.c: Likewise.
* lib/qmark.c: Likewise.
* lib/regexprops.c: Likewise.
* lib/regextype.c: Likewise.
* lib/safe-atoi.c: Likewise.
* lib/savedirinfo.c: Likewise.
* lib/splitstring.c: Likewise.
* lib/test_splitstring.c: Likewise.
* lib/waitpid.c: Likewise.
* locate/bigram.c: Likewise.
* locate/code.c: Likewise.
* locate/frcode.c: Likewise.
* locate/locate.c: Likewise.
* locate/word_io.c: Likewise.
* xargs/xargs.c: Likewise.
2011-06-20 10:26:24 +01:00
James Youngman
0caac6fe3d Take gnulib-tool's advice about which header files to include.
* locate/locate.c: Include <regex.h> instead of "regex.h".
Include "fnmatch.h" instead of <fnmatch.h> (because we use
fnmatch-gnu).  Include "gettext.h".
* lib/regexprops.c: Include <regex.h> instead of "regex.h".
* find/tree.c: Include "gettext.h".  Include "fnmatch.h" instead
of <fnmatch.h> (because we use fnmatch-gnu).
* find/parser.c: Include "gettext.h" and <regex.h>.  Include
"fnmatch.h" instead of <fnmatch.h> (because we use fnmatch-gnu).
* find/pred.c: Likewise.
* find/exec.c: Include "gettext.h".
* find/find.c: Likewise.
* find/fstype.c: Likewise.
* find/ftsfind.c: Likewise.
* find/print.c: Likewise.
* lib/buildcmd.c: Likewise.
* lib/fdleak.c: Likewise.
* lib/findutils-version.c: Likewise.
* lib/regextype.c: Likewise.
* lib/safe-atoi.c: Likewise.
* find/util.c: Likewise.
* locate/bigram.c: Likewise.
* locate/code.c: Likewise.
* locate/frcode.c: Likewise.
* locate/word_io.c: Likewise.
* xargs/xargs.c: Likewise.
* find/Makefile.am: Add a comment explaining why gnulib-tool
advised us to use each library.
2011-06-20 00:39:20 +01:00
James Youngman
d8260ba1e0 Fix compiler warnings in lib/regextype.c and find/parser.c.
* lib/regextype.c (tagRegexTypeMap): make the name field const.
* find/parser.c (parse_version): instead of counting features, use
a boolean variable, nofeatures.  This avoids compiler warnings
about overflow.
2011-06-18 20:04:09 +01:00
James Youngman
f932373da8 Eliminate some compiler warnings.
* find/find.c: Remove definition of SAFE_CHDIR, which we don't
use.
* find/defs.h: Remove redundant declaration of launch.
* find/parser.c (parse_false): Cast unused arguments to void.
(parse_print0): Likewise.
(pred_context): Likewise.
(parse_newerXY): Add some parens for slightly greater clarity.
(make_segment): Avoid switch-missing-default-case warning by
turning it into an if statement.
(check_path_safety): Remove unused argument.
(insert_exec_ok): Don't pass the unwanted arugment to
check_path_safety.
(get_relative_timestamp): silence compiler warning by adding a
case for the remaining enumberation value rather than using
default.
* find/pred.c (months): the strings can be const char*, rather
than just char*.
(ctime_format): change TIME_BUF_LEN to an integer constant to
avoid signed/unsigned comparison.
(blank_rtrim): Change to new-style function definition(!) and
remove unnecessary parentheses around a return value.
* lib/buildcmd.c: Omit redundant declaration of environ.
* find/tree.c (get_expr): Make static.
(cost_assoc): make the name field const.
(prec_assoc): make the prec_name field const.
(op_assoc): make the type_name field const.
(type_name): turn into an ANSI function definition(!).
(prec_name): Likewise!  Also remove spurious parentheses around
return value.
(prec_name): Remove spurious parentheses around return value.
* lib/buildcmd.h (buildcmd_state): change types of several fields
to size_t: cmd_argc, cmd_argv_alloc, largest_successful_arg_count,
smallest_failed_arg_count.
(buildcmd_control): change types of several fields
to size_t: max_arg_count, initial_argc, lines_per_exec,
args_per_exec.
2011-06-14 23:24:54 +01:00
James Youngman
fce1865424 Split strings into fields nondestructively.
* lib/splitstring.c: New file; defines splitstring(), which will
non-destructively locate character-separated fields in a string.
* lib/splitstring.h: New file; declares splitstring.
* lib/test_splitstring.c: New file; unit test for splitstring.c.
* lib/nextelem.c: Delete (obsoleted by splitstring.c).
* lib/nextelem.h: Delete (obsoleted by splitstring.h).
* lib/Makefile.am (libfind_a_SOURCES): Add splitstring.c,
splitstring.c.  Remove nextelem.c, nextelem.h.
(check_PROGRAMS): Add test_splitstring.
(TESTS): Add test_splitstring.
(test_splitstring_SOURCES): Sources for the
test_splitstring unit test.
* locate/locate.c: Include splitstring.h rather than nextelem.h.
(dolocate): Use splitstring rather than next_element.  In places
where we need a nul-terminated string, use strndup() to create it.
Convert some space-tab sequences to regular spacing.
* find/parser.c: Include splitstring.h rather than nextelem.h.
(check_path_safety): Use splitstring rather than next_element.
* import-gnulib.config (modules): Depend on the module strndup.
* cfg.mk: Exempt lib/test_splitstring.c from calling
bindtextdomain or set_program_name.
2011-06-13 23:54:48 +01:00
James Youngman
f92ac3bc3f Enable sc_makefile_at_at_check; fix problems it identifies.
* lib/Makefile.am: Use $(FINDLIBOBJS) instead of @FINDLIBOBJS@.
* find/Makefile.am (LDADD): Use $(FINDLIBS) instead of @FINDLIBS@.
* locate/Makefile.am (updatedb): Use $(VERSION) and
$(PACKAGE_NAME) instead of @VERSION@ and @PACKAGE_NAME@.
* cfg.mk: remove sc_makefile_at_at_check from local-checks-to-skip
2011-06-12 03:24:03 +01:00
James Youngman
28e02ca086 Enable more syntax checks, eliminate useless C preprocessor parentheses
* find/defs.h: Eliminate useless parentheses in #if.
* find/find.c (safely_chdir): Likewise.
* find/pred.c: Likewise.
* lib/buildcmd.c: Likewise.
* lib/fdleak.c: Likewise
* xargs/xargs.c: Likewise.
* find/parser.c: Likewise.
(ISDIGIT): Simplify, and avoid undefining isascii.
* cfg.mk (local-checks-to-skip): Remove sc_prohibit_cvs_keyword,
since the test produces no hits anyway.  Explain why we avoid
sc_two_space_separator_in_usage. Enable the sc_useless_cpp_parens
check.
2011-06-12 02:38:09 +01:00
James Youngman
0558bb1054 Use stat-size macros in pred.c also.
* find/pred.c: Include stat-size.  Eliminate definitions of
DEV_BSIZE, ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE macros which are
now in stat-size.h (yes, this is the second set of these macros
we've removed).
(file_sparseness): Use ST_NBLOCKS and ST_NBLOCKSIZE.
* cfg.mk (local-checks-to-skip): Don't skip
sc_prohibit_stat_st_blocks, because now we no loner access the
st_blocks field of struct stat, directly.
2011-06-12 02:29:51 +01:00
James Youngman
a0c61bf45c Adopt the new gnulib module stat-size.
* lib/listfile.c: Include "stat-size.h".  Delete the DEV_BSIZE,
ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE macros which are now in
stat-size.h.
* gnulib: Update to latest.
* import-gnulib.config (modules): Add stat-size.
2011-06-11 17:07:11 +01:00
James Youngman
e338e2c9db Don't include sys/param.h where we don't need it.
* xargs/xargs.c: Don't include sys/param.h, we don't use it.
2011-06-07 23:33:54 +01:00
James Youngman
c6370aa424 Don't include "stdio-safer.h" where it is not used.
* find/parser.c: Don't include stdio-safer.h, it's not used.
* lib/findutils-version.c: Likewise.
2011-06-05 22:19:58 +01:00
James Youngman
43fc13f467 Don't include <stddef.h> where it is not used.
* lib/dircallback.c: Don't include <stddef.h>, it's not used.
* lib/extendbuf.c: Likewise.
* lib/qmark.c: Likewise.
* lib/savedirinfo.c: Likewise.
2011-06-05 22:17:54 +01:00
James Youngman
a4d18ea477 Include dirent.h uncontintionally (since gnulib provides it).
* find/pred.c: Include <dirent.h> unconditionally; gnulib provides it.
* lib/savedirinfo.c: Likewise.
2011-06-05 01:10:37 +01:00
James Youngman
acdcf95b84 gnulib already defines O_CLOEXEC.
* lib/fdleak.c: gnulib's fcntl.h always defines O_CLOEXEC, so
don't define it here.
2011-06-05 01:10:36 +01:00
James Youngman
f457e8f05e Update the copyright year in C source files.
* find/defs.h: Update copyright year.
* find/find.c: Update copyright year.
* find/finddata.c: Update copyright year.
* find/ftsfind.c: Update copyright year.
* find/parser.c: Update copyright year.
* find/pred.c: Update copyright year.
* find/sharefile.c: Update copyright year.
* find/sharefile.h: Update copyright year.
* find/tree.c: Update copyright year.
* find/util.c: Update copyright year.
* lib/buildcmd.c: Update copyright year.
* lib/buildcmd.h: Update copyright year.
* lib/dircallback.c: Update copyright year.
* lib/dircallback.h: Update copyright year.
* lib/extendbuf.c: Update copyright year.
* lib/extendbuf.h: Update copyright year.
* lib/fdleak.c: Update copyright year.
* lib/fdleak.h: Update copyright year.
* lib/findutils-version.c: Update copyright year.
* lib/findutils-version.h: Update copyright year.
* lib/forcefindlib.c: Update copyright year.
* lib/listfile.c: Update copyright year.
* lib/listfile.h: Update copyright year.
* lib/nextelem.c: Update copyright year.
* lib/nextelem.h: Update copyright year.
* lib/printquoted.c: Update copyright year.
* lib/printquoted.h: Update copyright year.
* lib/qmark.c: Update copyright year.
* lib/regexprops.c: Update copyright year.
(copying): Update copyright year in the output file, too.
* lib/regextype.c: Update copyright year.
* lib/regextype.h: Update copyright year.
* lib/safe-atoi.c: Update copyright year.
* lib/safe-atoi.h: Update copyright year.
* lib/savedirinfo.c: Update copyright year.
* lib/savedirinfo.h: Update copyright year.
* lib/unused-result.h: Update copyright year.
* lib/waitpid.c: Update copyright year.
* locate/bigram.c: Update copyright year.
* locate/code.c: Update copyright year.
* locate/frcode.c: Update copyright year.
* locate/locate.c: Update copyright year.
* locate/locatedb.h: Update copyright year.
* locate/word_io.c: Update copyright year.
* xargs/xargs.c: Update copyright year.
2011-06-04 13:19:26 +01:00
James Youngman
073e6424ae Avoid code redundancy in lib/buildcmd.c.
* lib/buildcmd.c (bc_get_arg_max): Recheck val only if we might
have changed it (i.e. when ARG_MAX is defined).
2011-06-04 00:43:38 +01:00
James Youngman
8b0f894dcf Fix a compiler warning in lib/buildcmd.c
* lib/buildcmd.c: special_terminating_arg should be const.
2011-06-04 00:40:15 +01:00
James Youngman
d13223b942 Fix compiler warnings in lib/fdleak.c
* lib/fdleak.c (visit_open_fds): Rename loop variable from i to j
to avoid shadowing.
(get_proc_max_fd): Fix definition (it's a void function, not a
traditional pre-ANSI function definition).
2011-06-04 00:38:47 +01:00
James Youngman
9ab5022447 Fix several small compiler warnings.
* lib/dircallback.c: Include dircallback.h.
* lib/dircallback.h: Correct declaration of run_in_dir.
* lib/listfile.c (file_blocksize): Use the otherwise-unused parameter.
* find/defs.h: Remove redundant declaration of variable options.
2011-06-04 00:20:28 +01:00
James Youngman
c8b2946721 Fix some compiler warnings in findutils-version.c.
* lib/findutils-version.c: include findutils-version.h.  Make
version_string const.  Don't #define N_, since we don't use it.
2011-06-04 00:20:27 +01:00
James Youngman
a80e33b1c1 Don't display a separate gnulib version.
* lib/findutils-version.c (display_findutils_version): Don't
display gnulib_version because it's no longer defined (because
there is no gnulib version separate from the findutils version,
now that gnulib is a submodule).
* import-gnulib.config: remove gnulib_version and destdir, they
are not needed any more.
* lib/Makefile.am (EXTRA_DIST): Don't distribute gnulib-version.h
or gnulib-version.c.
(BUILT_SOURCES): delete, there are no longer any built sources.
* lib/gnulib-version.h: Remove.
* locate/code.c: Don't include gnulib-version.h
* xargs/xargs.c: Don't include gnulib-version.h
2011-06-04 00:20:27 +01:00
James Youngman
f3d4ac9bb4 Remove unnecessary header checks and include guards.
* configure.ac (AC_CHECK_HEADERS): Remove checks for header files
that gnulib either assumes are always present, or provides
itself.  These include errno.h fcntl.h inttypes.h limits.h
locale.h stddef.h stdint.h stdlib.h string.h sys/types.h
unistd.h.
* lib/buildcmd.c: Remove include guard for limits.h.
* find/fstype.c: Remove include guard for sys/types.h.
* lib/savedirinfo.c: Likewise.
* find/find.c: Remove include guard for locale.h.
* find/ftsfind.c: Likewise.
2011-06-02 12:22:22 +01:00
James Youngman
d09450a94c Manage gnulib as a git submodule.
* .gitmodules: New file; manage gnulib as a submodule.  For future
compatibility with the "bootstrap" script, keep the gnulib
submodule in the gnulib directory (instead of the gnulib-git
directory as before).  This means we need to find a new directory
for the output of gnulib-tool; we will use "gl" for that.
* import-gnulib.sh (do_checkout): Replace with do_submodule.
(do_submodule): initialise and configure the gnulib module.
(main): call do_submodule instead of do_checkout.  Don't call
move_cvsdir, it's obsolete.
(move_cvsdir): delete
* Makefile.am (SUBDIRS): Rename gnulib to gl.
(ACLOCAL_AMFLAGS): Likewise.
(findutils-check-smells): Rename gnulib-git to gnulib.
* .gitignore: Rename gnulib to gl.
2011-05-30 02:00:23 +01:00
James Youngman
de53ac2607 Savannah bug #31424: Revert Interix-specific change.
Gnulib will use suacomp for solving this problem, so findutils
will not need a workaround here.
* lib/arg-max.h: Delete this file.
* lib/Makefile.am (libfind_a_SOURCES): Remove arg-max.h.
* lib/buildcmd.c: Don't include arg-max.h.
* xargs/xargs.c: Likewise.
2011-05-29 00:17:45 +01:00
James Youngman
553651bea5 Fix Savannah bug #18227 (-ls doesn't print device major/minor).
* lib/listfile.c (list_file): check HAVE_STRUCT_STAT_ST_RDEV
instead of HAVE_ST_RDEV, fixing this bug.  HAVE_ST_RDEV was
defined by the obsolete Autoconf macro AC_STRUCT_ST_RDEV, but
findutils hasn't actually called AC_STRUCT_ST_RDEV since Apr 5
2000.
* NEWS: Mention this bugfix.
2011-05-15 22:30:13 +01:00
James Youngman
cd2338d43b Change "can not" to "cannot".
* lib/buildcmd.c (bc_push_arg): "can not" -> "cannot" in message.
* find/tree.c: Likewise in a comment.
2011-04-02 21:15:20 +01:00
James Youngman
107af5aa0c Savannah bug #31424: Work around Interix bug in _SC_ARG_MAX, in which execve will fail with ENOMEM if we use a command line somewhere between ARG_MAX and _SC_ARG_MAX.
* lib/arg-max.h: New file: undefine _SC_ARG_MAX if we cannot rely
on the value that sysconf produces.
* lib/Makefile.am (libfind_a_SOURCES): Add arg-max.h.
* lib/buildcmd.c: #include arg-max.h.
* xargs/xargs.c: Likewise.
2010-10-23 12:49:37 +01:00
Kamil Dudka
443487e989 Correctly initialise variables in run_in_dir.
* lib/dircallback.c (run_in_dir): Make sure that if the callback
doesn't get run, the return value is nonzero.  Make sure that if
the directory save/restore fails, we don't overwrite errno with a
random value (and hence report some unrelated and nonexistent
error, instead of the real problem).  Restore the previous current
directory.

Signed-off-by: James Youngman <jay@gnu.org>
2010-05-07 09:29:17 +01:00
James Youngman
3102624c8a Remove support for compilers lacking prototypes.
* find/defs.h: Don't define or use the PARAMS macro.
* xargs/xargs.c: Likewise.
* locate/locatedb.h: Likewise.
* locate/frcode.c: Likewise.
* lib/buildcmd.c: Likewise.
* find/tree.c: Likewise.
* find/pred.c: Likewise.
* find/parser.c: Likewise.
* find/fstype.c: Likewise.
* find/find.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-21 10:47:42 +01:00
James Youngman
56682c9ff5 Make sure we don't open a file on a standard fd (that is, 0/1/2).
* lib/fdleak.c: Include fcntl--.h to turn calls to open into calls
to open_safer.
* find/find.c: Likewise.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-13 00:36:55 +01:00
James Youngman
61415ade1e Fix Savannah bug #29511: fails to build on kfreebsd-*
* lib/fdleak.c (get_max_fd): Don't use RLIM_SAVED_MAX or
RLIM_SAVED_CUR.  Not only are they non-portable, they aren't
useful.
* NEWS: Mention this bugfix.

Signed-off-by: James Youngman <jay@gnu.org>
2010-04-13 00:29:32 +01:00