summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* maint: update copyright yearsJim Meyering2014-02-135-8/+5
|
* lid: avoid reading beyond end of buffer for a long nameJim Meyering2012-10-231-2/+2
| | | | | | | | | | | * libidu/idfile.h (stzncpy): Define, from coreutils. * src/lid.c (query_ambiguous_prefix): Avoid buffer overrun. Using strncpy to copy a too-long name would result in a "name" that is not NUL-terminated, yet that name would be treated as a NUL-terminated string immediately afterwards, via report_func, which attempts to print it. * libidu/fnprint.c (root_name): Use stzncpy in place of strncpy. * NEWS (Bug fixes): Mention the bug fix.
* maint: fix comment/doc typosJim Meyering2012-04-181-1/+1
| | | | | | | Found using https://github.com/lyda/misspell-check * ChangeLog-2007: As above. * NEWS: Likewise. * src/mkid.c: Likewise.
* build: work around new warning/suggestion to use "pure"Jim Meyering2012-01-311-6/+12
| | | | | | | | * src/mkid.c (check_hits): Change semantics to avoid the warning that this assert-containing function could be declared with the "pure" attribute. Instead, return 0/1, declare "pure" and let the caller perform the assertion. Rename from assert_hits. Add a comment.
* build: add const and pure attributes, per gcc recommendationJim Meyering2012-01-312-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | * src/mkid.c (ceil_log_8, ceil_log_2): Add "const" attribute. (token_hash_1, token_hash_2): Add "pure" attribute. (token_hash_cmp, token_qsort_cmp): Likewise. (count_vec_size, count_buf_size): Likewise. * libidu/idu-hash.c (round_up_2): Add "const" attribute. * libidu/scanners.h (get_language): Add "pure" attribute. * libidu/idfile.h (token_flags): Likewise. (token_count): Likewise. (member_file_qsort_compare): Likewise. (tree8_count_levels): Add "const" attribute. * libidu/walker.c (symlink_ancestry): Add "pure" attribute. (links_depth): Likewise. (file_link_hash_1): Likewise. (vector_length): Likewise. (file_link_hash_compare): Likewise. (string_in_vector): Likewise. * src/lid.c (vector_cardinality, get_radix, dtoi, otoi): Likewise. (is_regexp): Likewise. (vector_length): Remove forward decl and move function definition to precede first use.
* maint: update all copyright year number rangesJim Meyering2012-01-015-5/+5
| | | | Run "make update-copyright".
* build: exempt defid from a built-in automake checkJim Meyering2011-11-171-0/+5
| | | | | | | defid *does* support --help and --version, but only when gid is already in your shell's search path. That is not the case for the first pre-install build. * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Define.
* lid: fix a bug that made it so -o, -x, -d did not workShigio YAMAGUCHI2011-08-021-1/+3
| | | | | | * src/lid.c (radix_flag): Initialize to 0, not radix_all. (main): Map 0 to the default, radix_all. Tiny change.
* lid -F RANGE: fix a bug in handling open-ended rangesShigio YAMAGUCHI2011-05-241-3/+8
| | | | | * src/lid.c (parse_frequency_arg): lid -F 2.. would mistakenly act like "lid -F 2" and "lid -F ..2" would act like "lid F 1"
* maint: adapt to use gnulib's tight-scope rule; update gnulib to latestJim Meyering2011-05-231-27/+0
| | | | | | | * cfg.mk (_gl_TS_headers): Define. (_gl_TS_obj_files): Likewise. * src/Makefile.am (sc_tight_scope): Remove rule. * gnulib: Update to latest.
* maint: remove unused inclusion of <stddef.h>Jim Meyering2011-03-201-1/+0
| | | | | | * libidu/scanners.c: As above. * libidu/walker.c: Likewise. * src/mkid.c: Likewise.
* maint: remove two empty #if...#endif blocksJim Meyering2011-03-201-6/+0
| | | | * src/lid.c: Remove empty #if...#endif blocks.
* maint: update copyright year ranges to include 2011Jim Meyering2011-03-205-5/+5
| | | | Run "make update-copyright".
* mkid: use ftello (not ftell) and fail if an offset is 2^32 or largerJim Meyering2010-05-091-3/+12
| | | | | | | | | This is necessary because the internal layout requires that an offset be representable as a 4-byte quantity. * src/mkid.c (write_id_file): Use ftello, not ftell. The latter would fail on files larger than 4GiB. Now, we still fail for such files, but use ftello instead -- and give a diagnostic.
* maint: accommodate new syntax-check rulesJim Meyering2010-05-011-3/+1
| | | | | | | * bootstrap.conf (gnulib_modules): Add sys_ioctl * src/lid.c: Include <sys/ioctl.h> unconditionally. * libidu/xnls.h: Don't depend on HAVE_LOCALE_H. <locale.h> is always available.
* maint: remove all .cvsignore filesJim Meyering2010-01-011-7/+0
|
* maint: update all FSF copyright year lists to include 2010Jim Meyering2010-01-015-6/+8
| | | | | | Use this command: git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \ env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
* build: accommodate new syntax-check testJim Meyering2009-10-305-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | Use EXIT_FAILURE and EXIT_SUCCESS, not 1 and 0. Apply these commands: perl -pi -e 's/\berror \(1,/error (EXIT_FAILURE,/' \ $(git grep -l '\<error (1,') perl -pi -e 's/\bexit \(1\)/exit (EXIT_FAILURE)/' \ $(git grep -l '\<exit (1)') perl -pi -e 's/\bexit \(0\)/exit (EXIT_SUCCESS)/' \ $(git grep -l '\<exit (0)') * libidu/idread.c (read_id_file, maybe_read_id_file, io_read): * libidu/idu-hash.c (hash_init): * libidu/idwrite.c (io_write): * libidu/scanners.c (parse_language_map, parse_language_map_file): (read_language_map_file): * libidu/walker.c (include_languages, exclude_languages): (get_current_dir_link): * src/fid.c (usage, help_me, main): * src/fnid.c (usage, help_me, main): * src/lid.c (usage, help_me, main, report_grep, report_edit): (query_regexp): * src/mkid.c (main, assert_writeable, write_id_file): * src/xtokid.c (help_me):
* build: avoid warning exposed by gcc-4.4.1Jim Meyering2009-09-305-7/+5
| | | | | | | | * src/fid.c (help_me): Declare with noreturn attribute. * src/fnid.c (help_me): Likewise. * src/lid.c (help_me): Likewise. * src/mkid.c (help_me): Likewise. * src/xtokid.c (help_me): Likewise.
* maint: mkid, xtokid: remove unnecessary initializationJim Meyering2009-08-312-2/+0
| | | | | * src/xtokid.c (main): Don't set "skip_file" unnecessarily. * src/mkid.c (main): Likewise.
* maint: update copyright year lists to include 2009Jim Meyering2009-08-155-6/+6
|
* rename hash.? to idu-hash.? to avoid conflict with gnulib's hash.hJim Meyering2009-08-151-1/+1
| | | | | | | | | | | | | Now that gnulib's exclude module uses gnulib's hash module, which includes a hash.h file, idutils' use of a hash.h file conflicted. Rename the one here in idutils: * libidu/idu-hash.c: Rename from hash.c. * libidu/idu-hash.h: Rename from hash.h. * libidu/idfile.h: Reflect renaming. * libidu/idread.c: Likewise. * libidu/idwrite.c: Likewise. * src/mkid.c: Likewise. * libidu/Makefile.am: Likewise.
* mkid, xtokid: read and process --files0-from= input a name at a time,Jim Meyering2009-07-042-95/+150
| | | | | | | | | | | | rather than by reading the entire input into memory and *then* processing each file name. * src/mkid.c: Include "argv-iter.h", not "readtokens0.h". (main): Rewrite to use argv-iter. * src/xtokid.c: Likewise. Include <assert.h>. * bootstrap.conf (gnulib_modules): Add argv-iter. Remove readtokens0. * libidu/iduglobal.h (STREQ): Define. (bad_cast): Define.
* remove wc-related code that doesn't apply hereJim Meyering2009-07-042-22/+0
| | | | | | * src/mkid.c: Don't handle a file name of "-" specially. * src/xtokid.c: Likewise. * testsuite/files0-from: Don't test for it.
* tests: add testing framework, and tests for the new optionJim Meyering2009-07-042-2/+2
| | | | | | | | | | | | | | | | | * NEWS (New features): Mention the new option. * src/mkid.c (main): Adjust a diagnostic. * src/xtokid.c (main): Adjust a diagnostic. * bootstrap.conf (gnulib_modules): Add perl and posix_shell * build-aux/check.mk: New file, from coreutils. * testsuite/Coreutils.pm: Likewise. * testsuite/CuTmpdir.pm: Likewise. * testsuite/check.mk: Likewise. * testsuite/envvar-check: Likewise. * testsuite/files0-from: New test, based on one from coreutils. * testsuite/Makefile.am (TESTS): Add files0-from. (TESTS_ENVIRONMENT): Remove definition. Now it's in check.mk. (EXTRA_DIST): Add Coreutils.pm CuTmpdir.pm envvar-check and check.mk. Include $(srcdir)/check.mk.
* mkid, xtokid: accept a new option --files0-from=FILEPedro J. Ruiz Lopez2009-07-042-38/+216
| | | | | | | | | * bootstrap.conf (gnulib_modules): Add quote and readtokens0. * doc/idutils.texi: Document the option. * src/mkid.c (usage, FILES0_FROM_OPTION, long_options, help_me) (main): Implement. * src/xtokid.c (usage, FILES0_FROM_OPTION, long_options, help_me) (main): Likewise.
* maint: add const attribute to a few declarationsJim Meyering2009-06-071-3/+3
| | | | | | * libidu/hash.c (hash_print_stats, hash_dump): Add const. * libidu/hash.h: Likewise. * src/mkid.c (scan_files): Likewise.
* clean-up: use proper typesJim Meyering2009-04-301-3/+4
| | | | * src/fid.c (get_file_index): Use size_t for lengths, not int.
* build: suppress more warningsJim Meyering2009-04-305-10/+9
| | | | | | | | | * src/fid.c (usage): Declare with __noreturn__ attribute. * src/fnid.c (usage): Likewise. * src/lid.c (usage): Likewise. * src/mkid.c (usage): Likewise. * src/xtokid.c: (usage): Likewise. * src/mkid.c (sum_files): Remove unused macro.
* build: enable new compiler warning optionsJim Meyering2009-04-301-2/+3
| | | | | | | * src/Makefile.am (AM_CFLAGS): Define to $(WARN_CFLAGS) $(WERROR_CFLAGS). * libidu/Makefile.am (AM_CPPFLAGS): Remove bogus -I$(top_builddir)/intl (AM_CFLAGS): Define to $(WARN_CFLAGS) $(WERROR_CFLAGS). * src/Makefile.am (AM_CPPFLAGS): Remove bogus -I.../intl
* * src/lid.c: Remove duplicate inclusion of <termios.h>.Jim Meyering2008-11-301-1/+0
|
* * src/fnid.c: Remove duplicate inclusion of <errno.h>.Jim Meyering2008-11-301-1/+0
|
* accommodate gnulib header removalsPedro J. Ruiz Lopez2008-10-221-1/+1
| | | | | | | * libidu/idfile.c: Include <sys/stat.h>, not "lstat.h". * libidu/scanners.c: Likewise. * libidu/walker.c: Likewise. * src/mkid.c: Likewise.
* avoid warnings, adjust for const-correctnessJim Meyering2008-06-245-13/+20
| | | | | | | | | | | | | | * libidu/scanners.c (long_options_c, long_options_asm) (long_options_text, long_options_perl): Add initializers. * src/fid.c (long_options): Add initializers. * src/fnid.c (long_options): Add initializers. * src/lid.c (ATTRIBUTE_UNUSED): Define. (long_options): Add initializers. (report_nothing): Mark parameter as unused. (get_editor_argv, report_edit): Adjust for const-correctness. * src/mkid.c (long_options): Add initializers. (report_statistics): Don't subtract "void*" pointers. Cast to "char*". * src/xtokid.c (long_options): Add initializers.
* remove redundant "const" in declarationsJim Meyering2008-06-245-5/+5
| | | | | | | | | | * libidu/scanners.c (languages_0, long_options_c): Likewise. (long_options_asm, long_options_text, long_options_perl): Likewise. * src/fid.c (long_options): Likewise. * src/fnid.c (long_options): Likewise. * src/lid.c (long_options): Likewise. * src/mkid.c (long_options): Likewise. * src/xtokid.c (long_options): Likewise.
* sync maint.mk from coreutils, and adjust to conformJim Meyering2008-06-143-3/+3
| | | | | | | | * libidu/scanners.c (long_options_c, long_options_asm): Add "const". (long_options_text, long_options_perl): Likewise. * src/fnid.c (long_options): Likewise. * src/lid.c (long_options): Likewise. * src/xtokid.c (long_options): Likewise.
* use gnulib's progname moduleJim Meyering2008-06-045-17/+10
| | | | | | | | | | | * bootstrap.conf (gnulib_modules): Add progname. * src/mkid.c: Include "progname.h". (program_name): Remove declaration. (main): Call set_program_name rather than setting program_name. * src/fid.c: Likewise. * src/fnid.c: Likewise. * src/lid.c: Likewise. * src/xtokid.c: Likewise.
* build aid, eid, and gid as binaries (were scripts)Jim Meyering2008-05-2810-11/+48
| | | | | | | | | | | | | | * src/lid.c: Include "lid.h". (main): Set defaults based on new global, lid_mode. * src/Makefile.am (bin_PROGRAMS): Add aid, eid, gid. (dist_bin_SCRIPTS): Remove them from this list. (noinst_HEADERS, aid_SOURCES, eid_SOURCES): Define. (gid_SOURCES, lid_SOURCES): Define. * src/aid, src/eid, src/gid: Remove scripts. * src/lid-aid.c, src/lid-eid.c, src/lid-gid.c, src/lid-lid.c: * src/lid.h: New files. * man/Makefile.am (aid.1, eid.1, gid.1): Adjust dependencies. * .gitignore: Add src/aid, src/eid, src/gid.
* don't ignore pre-fclose ID-file write errorJim Meyering2008-05-221-1/+1
| | | | * src/mkid.c (write_id_file): Test ferror, too.
* detect write error on stdoutJim Meyering2008-05-205-1/+15
| | | | | | | | | | * src/fid.c: Include "closeout.h". (main): Use it via atexit. * src/fnid.c (main): Likewise. * src/lid.c (main): Likewise. * src/mkid.c (main): Likewise. * src/xtokid.c (main): Likewise. * NEWS: Mention the bug fixes.
* tighten scope in libidu/, tooJim Meyering2008-05-174-4/+5
| | | | | | | | | | | | | | | | | | Mark with "extern" the symbols that belong that way. Make the others static. * libidu/dynvec.h (dv_fill): * libidu/fnprint.c (cw_dlink): * libidu/hash.h (qsort_cmp_t): * libidu/idfile.h (io_func_t): * libidu/scanners.c (lang_args_obstack, languages_0, languages_N): (language_help_me, language_getopt, get_language): (lang_args_index): * libidu/walker.c (largest_member_file): * maint.mk (extract_char, today): * src/fid.c (long_options): * src/fnid.c (cw_dlink): * src/lid.c (cw_dlink): * src/xtokid.c (cw_dlink):
* * src/Makefile.am (sc_tight_scope): Improve.Jim Meyering2008-05-171-4/+4
|
* make more functions staticJim Meyering2008-05-171-2/+2
|
* declare many global variable to be "static"Jim Meyering2008-05-175-69/+65
| | | | | Remove the few that were thus exposed as being unused. Remove some unused prototypes.
* tests: make scope check work when $(noinst_HEADERS) is emptyJim Meyering2008-05-171-1/+1
| | | | | * src/Makefile.am (sc_tight_scope): Add /dev/null as an argument to the sed-based variable filter, in case $(noinst_HEADERS) is empty.
* Remove unused functions.Jim Meyering2008-05-171-85/+0
| | | | | * src/lid.c (linetty): Remove unused function. (file_name_wildcard): Likewise.
* * src/lid.c (strcasestr): Remove function.Jim Meyering2008-05-171-18/+0
|
* make functions staticJim Meyering2008-05-175-147/+154
|
* tests: enable scoping checkJim Meyering2008-05-171-0/+27
| | | | | * cfg.mk (local-checks-to-skip): Don't skip sc_tight_scope anymore. * src/Makefile.am (sc_tight_scope): New rule. From coreutils.
* * src/defid: Handle --help and --version.Jim Meyering2008-05-101-0/+5
|