summaryrefslogtreecommitdiff
path: root/src/expr.c
AgeCommit message (Collapse)Author
2017-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2016-10-16maint: we use die; remove now-unnecessary uses of abortJim Meyering
* src/expr.c (integer_overflow): Remove an abort-after-die. * src/paste.c (write_error): Likewise. * src/sort.c (badfieldspec): Likewise. * src/tr.c (string2_extend): Likewise. Also remove a few break statements, each after an abort.
2016-10-16all: use die() rather than error(EXIT_FAILURE)Pádraig Brady
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. * cfg.mk (sc_die_EXIT_FAILURE): A new syntax check rule to catch any new uses of error (CONSTANT, ...);
2016-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2015-11-04all: avoid quoting file names when possiblePádraig Brady
Quote file names using the "shell-escape" or "shell-escape-always" methods, which quote as appropriate for most shells, and better support copy and paste of presented names. The "always" variant is used when the file name is embedded in an error message with surrounding spaces. * cfg.mk (sc_error_shell_quotes): A new syntax check rule to suggest quotef() where appropriate. (sc_error_shell_always_quotes): Likewise for quoteaf(). * src/system.h (quotef): A new define to apply shell quoting when needed. I.E. when shell character or ':' is present. (quoteaf): Likewise, but always quote. * src/*.c: Use quotef() and quoteaf() rather than quote() where appropriate. * tests/: Adjust accordingly.
2015-10-27all: quote string arguments in error messagesPádraig Brady
These strings are often file names or other user specified parameters, which can give confusing errors in the presence of unexpected characters for example. * cfg.mk (sc_error_quotes): A new syntax check rule. * src/*.c: Wrap error() string arguments with quote(). * tests/: Adjust accordingly. * NEWS: Mention the improvement.
2015-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * tests/sample-test: Adjust to use the single most recent year. * tests/du/bind-mount-dir-cycle-v2.sh: Fix case in copyright message, so that year is updated automatically in future.
2014-09-19doc: output correct --help references with --program-prefixPádraig Brady
* src/system.h (emit_ancillary_info): Take the invariant PROGRAM_NAME as a parameter, so that consistent references are made to online docs and texinfo nodes, when a --program-prefix is in place. Note the man pages don't need this fix as they're generated before the program prefix is used. * NEWS: Mention the improvements in references to online documentation.
2014-09-08maint: prefer 'return status;' to 'exit (status);' in 'main'Paul Eggert
* build-aux/gen-single-binary.sh: Don't use ATTRIBUTE_NORETURN for main functions. * src/base64.c, src/basename.c, src/cat.c, src/chcon.c, src/chgrp.c: * src/chmod.c, src/chown.c, src/chroot.c, src/cksum.c, src/comm.c: * src/cp.c, src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c: * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c: * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c: * src/getlimits.c, src/groups.c, src/head.c, src/hostid.c: * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c: * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/make-prime-list.c: * src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mktemp.c: * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/nproc.c: * src/numfmt.c, src/od.c, src/paste.c, src/pathchk.c, src/pinky.c: * src/pr.c, src/printenv.c, src/printf.c, src/ptx.c, src/pwd.c: * src/readlink.c, src/realpath.c, src/rm.c, src/rmdir.c, src/runcon.c: * src/seq.c, src/shred.c, src/shuf.c, src/sleep.c, src/sort.c: * src/split.c, src/stat.c, src/stdbuf.c, src/stty.c, src/sum.c: * src/sync.c, src/tac.c, src/tail.c, src/tee.c, src/timeout.c: * src/touch.c, src/tr.c, src/true.c, src/truncate.c, src/tsort.c: * src/tty.c, src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c: * src/uptime.c, src/users.c, src/wc.c, src/who.c, src/whoami.c: In 'main' functions, Prefer 'return status;' to 'exit (status);'. * src/coreutils-arch.c (_single_binary_main_uname) (_single_binary_main_arch): * src/coreutils-dir.c, src/coreutils-vdir.c (_single_binary_main_ls) (_single_binary_main_dir, _single_binary_main_vdir): Omit ATTRIBUTE_NORETURN. Return a value. * src/coreutils.c (SINGLE_BINARY_PROGRAM): Omit ATTRIBUTE_NORETURN. (launch_program): Now static. * src/dd.c (finish_up): New function. (quit, main): Use it. * src/getlimits.c (main): Return a proper exit status. * src/test.c (test_main_return): New macro. (main): Use it. * src/logname.c, src/nohup.c, src/whoami.c: Use 'error' to simplify exit status in 'main' function. * src/yes.c (main): Use 'return' rather than 'error' to exit, so that GCC doesn't suggest ATTRIBUTE_NORETURN.
2014-01-02maint: update all copyright year number rangesBernhard Voelker
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2013-05-18maint: port --enable-gcc-warnings to clangPaul Eggert
* configure.ac: If clang, add -Wno-format-extra-args and -Wno-tautological-constant-out-of-range-compare. * gl/lib/rand-isaac.c (ind): * gl/lib/randread.c (readisaac): * src/ls.c (dev_ino_push, dev_ino_pop): * src/sort.c (buffer_linelim): * src/system.h (is_nul): * src/tail.c (tail_forever_inotify): Rewrite to avoid casts that clang dislikes. It's good to avoid casts anyway. * src/expr.c (integer_overflow): Declare only if it exists. (die): Remove; unused. * src/ls.c (dev_ino_push): New function, replacing ... (DEV_INO_PUSH): ... this removed macro. All uses changed. (decode_switches): Rewrite "str"+i to &str[i].
2013-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2012-05-08maint: fix common spelling errorsKevin Lyda
These were identified using: https://github.com/lyda/misspell-check executed like: git ls-files | misspellings -f - * src/cat.c: Correct a spelling error. * src/comm.c: Likewise. * src/expr.c: Likewise. * src/pr.c: Likewise. * src/tac.c: Likewise. * src/test.c: Likewise. * src/ChangeLog-2005: Likewise. * src/ChangeLog-2007: Likewise. * src/NEWS: Likewise. * src/doc/coreutils.texi: Likewise. * src/lib/ChangeLog-2007: Likewise. * src/man/help2man: Likewise. * src/old/fileutils/ChangeLog-1997: Likewise. * src/old/fileutils/NEWS: Likewise. * src/old/sh-utils/ChangeLog.0: Likewise. * src/old/textutils/ChangeLog: Likewise. * src/tests/misc/comm: Likewise. * src/tests/misc/uniq: Likewise. * src/tests/mv/dir2dir: Likewise. * src/cfg.mk (old_NEWS_hash): update with `make update-NEWS-hash`
2012-01-27maint: use single copyright year rangeJim Meyering
Run "make update-copyright".
2012-01-09maint: src/*.c: change remaining quotes (without embedded spaces)Jim Meyering
Run this (twice): git grep -E -l '`[^ ]+'\' src/*.c \ |xargs perl -pi -e 's/`([^ ]+'\'')/'\''$1/'
2012-01-09maint: convert `...' to '...' in --help outputJim Meyering
All affected lines end with \ or \n\, so run this command until it produces no new changes (4 times): git grep -E -l '`[^ ]+'\''.*\\' src \ |xargs perl -pi -e 's/`([^ ]+'\''.*\\)/'\''$1/'
2012-01-07maint: use new emit_try_help in place of equivalent fprintfJim Meyering
Run this command: perl -0777 -pi -e \ 's/fprintf \(stderr, _\("Try `%s --help.*\n.*;/emit_try_help ();/m'\ src/*.c
2012-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2011-07-02maint: use "const" and "pure" function attributes where possibleJim Meyering
* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const, -Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn. (GNULIB_WARN_CFLAGS): But do not add them here... yet. * src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s). * src/copy.c (is_ancestor, valid_options): Likewise. * src/copy.h (chown_failure_ok): Likewise. * src/dd.c (operand_matches, operand_is): Likewise. * src/df.c (selected_fstype, excluded_fstype): Likewise. * src/expr.c (null looks_like_integer): Likewise. * src/md5sum.c (hex_digits): Likewise. * src/od.c (get_lcm): Likewise. * src/pathchk.c (component_start, component_len): Likewise. * src/pinky.c (count_ampersands): Likewise. * src/pr.c (cols_ready_to_print): Likewise. * src/ptx.c (search_table): Likewise. * src/sort.c (find_unit_order): Likewise. * src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise. * src/system.h (gcd, lcm): Likewise. * src/tr.c (is_char_class_member, look_up_char_class): Likewise. (star_digits_closebracket): Likewise. * src/uniq.c (find_field): Likewise. * src/wc.c (compute_number_width): Likewise. * lib/xfts.h (cycle_warning_required): Likewise. * gl/lib/randint.h (randint_get_source): Likewise. * gl/lib/randperm.c (ceil_lg): Likewise. * gl/lib/randperm.h (randperm_bound): Likewise. * lib/strnumcmp.h (strintcmp): Likewise.
2011-05-26maint: accommodate gcc's -Wstrict-overflow optionJim Meyering
* src/factor.c (factor_using_pollard_rho): Change type of "i" to unsigned to avoid warning from gcc's -Wstrict-overflow. * src/expr.c: Use an unsigned intermediate. * src/dircolors.c (main): Reorder operations to avoid the risk of pointer overflow. * src/tr.c (squeeze_filter): Change NOT_A_CHAR from an anonymous "enum" to an "int", to avoid this warning: tr.c:1624:10: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] * src/pr.c (main): Make index "i" unsigned.
2011-05-19maint: correct typos involving misuse of "a" and "an"Jim Meyering
* NEWS: "an misleading" * src/expr.c: "a integer * src/ptx.c (find_occurs_in_text): "a end" * src/shred.c (do_wipefd): "a infinite" * src/sort.c (SUBTHREAD_LINES_HEURISTIC): "an dual-core" (compare_random): "an checksum" * cfg.mk (old_NEWS_hash): Update, since the typo was in old news.
2011-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2010-05-31maint: make spacing around "=" consistent, even in IF_LINTJim Meyering
E.g., - size_t desired_width IF_LINT (= 0); + size_t desired_width IF_LINT ( = 0); Use this command: g grep -l IF_LINT | grep '\.[ch]$' \ | xargs perl -pi -e 's/(IF_LINT \()= /$1 = /'
2010-02-25expr: clarify error messageEric Blake
* src/expr.c (eval4, eval3): Clarify that expr expects integers, and not the broader category of numbers. * tests/misc/expr: Update test accordingly. Suggested by Dan Jacobson.
2010-01-01maint: update all FSF copyright year lists to include 2010Jim Meyering
Use this command: git ls-files | grep -v COPYING \ | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \ build-aux/update-copyright
2009-09-23maint: Use logical rather than bitwise operators on boolsPádraig Brady
This is because bitwise operators are: - confusing and inconsistent in a boolean context - non short circuiting - brittle in C89 where bool can be an int (so > 1)
2009-09-23maint: expr: avoid compiler warnings without GMPPádraig Brady
* src/expr.c (mpz_clear, mpz_get_str, mpz_out_str) [!HAVE_GMP]: Reference unused arguments.
2009-09-21doc: mention the texinfo documentation in --helpPádraig Brady
* src/system.h: Rename emit_bug_reporting_address() to emit_ancillary_info() and update it to not print the translation project address in en_* locales, and _do_ print it in the 'C' (and other) locales so that it's included in the default man page. Also mention how to invoke the texinfo documentation for each command. Also move the "hard-locale.h" include to the 8 files that now use it. * man/help2man: Strip the newly added texinfo reference from the --help output as a more verbose version is already added by help2man. Suggestion from C de-Avillez
2009-08-25global: convert indentation-TABs to spacesJim Meyering
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2008-10-20expr: Fixup authorsPádraig Brady
* src/expr.c: Standardise the format of AUTHORS to that used in other utils with multiple authors. Also add Paul Eggert since he basically rewrote it with his bignum fixes. * AUTHORS (expr): Add Paul Eggert.
2008-10-15expr: remove --bignum and --no-bignum optionsPaul Eggert
* doc/coreutils.texi (expr invocation): Remove the --bignum and --no-bignum options. They weren't really needed, and they broke longstanding (albeit nonportable) scripts. * src/expr.c: Don't include <assert.h>. Include "inttostr.h", "long-options.h", "verify.h". Check at compile-time that size_t fits in unsigned long int, as the code assumes this in several places. (HAVE_GMP): Define to 0 if not defined, for convenience. (mpz_t, mpz_clear, mpz_init_set_ui, mpz_init_set_str, mpz_add): (mpz_sub, mpz_mul, mpz_tdiv_q, mpz_tdiv_r, mpz_get_str, mpz_sgn): (mpz_fits_ulong_p, mpz_get_ui, mpz_out_str): Supply substitutes when !HAVE_GMP, which work well enough for expr's purposes. (mp_integer): Remove. All integers are gmp, if gmp is available. (struct valinfo): Remove 'z' member; no longer needed. The 'i' member is always of type mpz_t. (enum arithmetic_mode, MP_NEVER, MP_ALWAYS, MP_AUTO, mode): Remove; no longer needed. (usage): Remove documentation of --bignum and --no-bignum. (integer_overflow): Abort if error misbehaves, to pacify GCC. Restore old message on arithmetic overflow, to be conservative. (die): Omit exit_status parameter; not needed (is always EXPR_FAILURE). (string_too_long, USE_BIGNUM, NO_USE_BIGNUM, long_options): Remove; no longer needed. (main): Don't use getopt_long; this breaks old nonportable scripts. (int_value): Arg is unsigned, in case we have strings whose length exceeds LONG_MAX (!). (int_value, freev, printv, null, tostring, toarith): (eval6, eval4, eval3): Always use mpz_ functions, to simplify the code. (substr_value): Remove; no longer needed. (getsize): Simplify the API: one arg rather than 3. Don't assume unsigned long int fits in size_t. (promote, domult, dodivide, doadd): Remove; no longer needed. * tests/misc/expr: Don't use --bignum to test for bignum support. Instead, use big numbers to test this.
2008-10-15expr: don't interpret argv[0] as an operandJim Meyering
* src/expr.c (main): Given a first argument like -22 (negative, with two or more digits), expr would decrement optind to 0 and then attempt to evaluate argv[0].
2008-08-14"expr --bignum 1" now fails when expr is built without libgmpJim Meyering
* src/expr.c (main): When --bignum is requested, yet expr was built without libgmp, exit nonzero (3) in addition to giving a diagnostic.
2008-08-09expr: avoid compiler warningsJim Meyering
* src/expr.c (die): New "noreturn" function to wrap one-arg use of error (string_too_long): Use die rather than error. (toint): Remove definition of now-unused function. (eval6): Remove a little duplication. Use die rather than error. (dodivide): Remove declaration of now-unused variable.
2008-08-06expr: support arbitrary-precision arithmeticJames Youngman
* src/Makefile.am (expr_LDADD): Link expr against GNU MP. * doc/coreutils.texi (expr invocation): Describe --bignum, --no-bignum. Explain the new arbitrary-precision functionality. * NEWS: Indicate that arbitrary-precision arithmetic is now supported in expr. * src/expr.c (enum valtype): Added mp_integer, signifying a GNU MP number. (usage): Document the new options --bignum and --no-bignum which force and prohibit the use of arbitrary-precision arithmetic, respectively. (long_options): data structure for getopt_long, which we need to use to parse the options mentioned above. (main): parse these options with getopt_long instead of parse_long_options. (valinfo): Downgrade the numeric member of the union from intmax_t to signed long, since MP lacks functions for promoting an intmax_t to an arbitrary-precision quantity. (enum arithmetic_mode): Represents the current choice between --bignum, --no-bignum and the default (automatically switch from one to the other if needed). (integer_overflow): issue a more explicit error message indicating that MP is not available. (string_too_long): new function, emits a fatal error message for the case where an argument to the 'index' expression is too long for a string offset to be represented. (int_value): With --bignum, create the value as mp_integer rather than plain integer. (substr_value): factored out of eval6; implements "substr". (freev): also destroy mp_integer values. Check that no mp_integer values exist if --no-bignum was specified. (printv, null, tostring): support mp_integer. (toint): new funtion for converting from string or mp_integer to integer. (getsize): extracts a size_t value from a VALUE object; used to implement substr. (promote): promotes a value from integer to mp_integer. (domult, dodivide): functions for multiplication and division, factored out of eval4. (doadd): addition/subraction function, factpred out of eval3. (eval3): support mp_integer types; call doadd. (eval4): support mp_integer types; call domult, dodivide. (eval6): support mp_integer offsets and lengths for "substr" and "index". * TODO: Mention that expr supports arbitrary-precision arithmetic, and suggest that this might also be a good idea for seq. * AUTHORS (expr): Add James Youngman.
2008-06-27factor out time_t-to-string conversion idiomJim Meyering
* src/system.h: Include "inttostr.h". (timetostr): New function, factored out of... * src/date.c (show_date): Use timetostr. * src/du.c (show_date): Likewise. * src/ls.c (print_long_format): Likewise. * src/pinky.c (time_string): Likewise. * src/stat.c (human_time): Likewise. * src/*.c: Don't include inttostr.h, since system.h does. * src/c99-to-c89.diff: Adjust offsets.
2008-06-08standardize some error messagesBo Borgerson
* maint.mk: (sc_error_message_warn_fatal, sc_error_message_uppercase): (sc_error_message_period): Add automatic checks for non-standard error messages. * .x-sc_error_message_uppercase: explicit exclusion for this check * src/cp.c: Standardize some error messages. * src/date.c: Likewise. * src/dircolors.c: Likewise. * src/du.c: Likewise. * src/expr.c: Likewise. * src/install.c: Likewise. * src/join.c: Likewise. * src/ln.c: Likewise. * src/mv.c: Likewise. * src/od.c: Likewise. * src/pr.c: Likewise. * src/split.c: Likewise. * src/truncate.c: Likewise. * src/wc.c: Likewise. * tests/du/files0-from: Expect new error message. * tests/misc/join: Likewise. * tests/misc/split-a: Likewise. * tests/misc/wc-files0-from: Likewise. * tests/misc/xstrtol: Likewise. * lib/xmemxfrm.c: Likewise.
2008-06-03use gnulib's progname moduleJim Meyering
* bootstrap.conf (gnulib_modules): Add progname. * src/*.c (program_name): Remove declaration. * (main): Call set_program_name rather than setting program_name. * src/nice.c (main): Cast program_name to "(char *)". * src/prog-fprintf.c: Include "system.h" * src/system.h: Include "progname.h". * maint.mk (sc_program_name): Adjust rule. Suggestion from Eric Blake.
2008-06-02declare program_name consistentlyJim Meyering
* src/base64.c: Likewise. * src/basename.c: Likewise. * src/cat.c: Likewise. * src/chcon.c: Likewise. * src/chgrp.c: Likewise. * src/chmod.c: Likewise. * src/chown.c: Likewise. * src/chroot.c: Likewise. * src/cksum.c: Likewise. * src/comm.c: Likewise. * src/cp.c: Likewise. * src/csplit.c: Likewise. * src/cut.c: Likewise. * src/date.c: Likewise. * src/dd.c: Likewise. * src/df.c: Likewise. * src/dircolors.c: Likewise. * src/dirname.c: Likewise. * src/du.c: Likewise. * src/echo.c: Likewise. * src/env.c: Likewise. * src/expand.c: Likewise. * src/expr.c: Likewise. * src/factor.c: Likewise. * src/fmt.c: Likewise. * src/fold.c: Likewise. * src/groups.c: Likewise. * src/head.c: Likewise. * src/hostid.c: Likewise. * src/hostname.c: Likewise. * src/id.c: Likewise. * src/install.c: Likewise. * src/join.c: Likewise. * src/kill.c: Likewise. * src/link.c: Likewise. * src/ln.c: Likewise. * src/logname.c: Likewise. * src/ls.c: Likewise. * src/md5sum.c: Likewise. * src/mkdir.c: Likewise. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise. * src/mktemp.c: Likewise. * src/mv.c: Likewise. * src/nice.c: Likewise. * src/nl.c: Likewise. * src/nohup.c: Likewise. * src/od.c: Likewise. * src/paste.c: Likewise. * src/pathchk.c: Likewise. * src/pinky.c: Likewise. * src/pr.c: Likewise. * src/printenv.c: Likewise. * src/printf.c: Likewise. * src/ptx.c: Likewise. * src/pwd.c: Likewise. * src/readlink.c: Likewise. * src/rm.c: Likewise. * src/rmdir.c: Likewise. * src/runcon.c: Likewise. * src/seq.c: Likewise. * src/setuidgid.c: Likewise. * src/shuf.c: Likewise. * src/sleep.c: Likewise. * src/sort.c: Likewise. * src/split.c: Likewise. * src/stat.c: Likewise. * src/stty.c: Likewise. * src/su.c: Likewise. * src/sum.c: Likewise. * src/sync.c: Likewise. * src/tac.c: Likewise. * src/tail.c: Likewise. * src/tee.c: Likewise. * src/test.c: Likewise. * src/timeout.c: Likewise. * src/touch.c: Likewise. * src/tr.c: Likewise. * src/true.c: Likewise. * src/tsort.c: Likewise. * src/tty.c: Likewise. * src/uname.c: Likewise. * src/unexpand.c: Likewise. * src/uniq.c: Likewise. * src/unlink.c: Likewise. * src/uptime.c: Likewise. * src/users.c: Likewise. * src/wc.c: Likewise. * src/who.c: Likewise. * src/whoami.c: Likewise. * src/yes.c: Likewise.
2008-05-26adjust copyright datesJim Meyering
2008-05-26convert single-author programs to use proper_nameJim Meyering
g grep -E -l 'define AUTHORS "[^,]+"$'|xargs perl -pi -e \ 's/(define AUTHORS) ("[^,]+")$/$1 proper_name ($2)/'
2007-10-25Tell xgettext that "ARG1 % ARG2" is not a C format string.Micah Cowan
* src/expr.c (usage): Add a comment to override xgettext's default behavior, which would classify "ARG1 % ARG2" as a fprintf-style format string.
2007-08-30Use PACKAGE_NAME instead of GNU_PACKAGE.Eric Blake
* src/Makefile.am (.sh, uninstall-local): Adjust all users of hand-rolled GNU_PACKAGE to instead use autoconf-provided PACKAGE_NAME. * src/basename.c (main): Likewise. * src/chroot.c (main): Likewise. * src/dirname.c (main): Likewise. * src/echo.c (main): Likewise. * src/expr.c (main): Likewise. * src/factor.c (main): Likewise. * src/groups.sh (version): Likewise. Also, reflect change in --version output due to GPLv3. * src/hostid.c (main): Likewise. * src/hostname.c (main): Likewise. * src/link.c (main): Likewise. * src/logname.c (main): Likewise. * src/nice.c (main): Likewise. * src/nohup.c (main): Likewise. * src/printenv.c (main): Likewise. * src/printf.c (main): Likewise. * src/pwd.c (main): Likewise. * src/setuidgid.c (main): Likewise. * src/sleep.c (main): Likewise. * src/system.h (case_GETOPT_VERSION_CHAR): Likewise. * src/test.c (main): Likewise. * src/true.c (main): Likewise. * src/unlink.c (main): Likewise. * src/uptime.c (main): Likewise. * src/users.c (main): Likewise. * src/whoami.c (main): Likewise. * src/yes.c (main): Likewise. * configure.ac (AC_CHECK_DECLS): No need to check strtoimax, strtoumax, since gnulib does this.
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-06-15Don't include "quote.h" when it is not used.Jim Meyering
* src/md5sum.c: Remove unnecessary inclusion of "quote.h". * src/expr.c: Likewise. * src/shred.c: Likewise. * Makefile.maint (sc_prohibit_quote_without_use): New rule. * src/c99-to-c89.diff: Adjust offsets.
2007-03-28Help translators include translation team's web or email address.Jim Meyering
* src/system.h (emit_bug_reporting_address): New function. * src/base64.c: Use it rather than a literal printf. * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c: * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c: * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c: * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c: * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c: * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c: * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c: * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c: * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c: * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c: * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c: * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c: * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c: * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c: * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c: * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c: * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c: * src/who.c, src/whoami.c, src/yes.c: Likewise.
2007-01-11Avoid a leak in expr's implementation of the ":" (match) operator.Jim Meyering
* src/expr.c (docolon): Free the regexp buffer using regfree, rather than doing it manually, being careful to set fastmap to NULL first. Free any re_regs.start and .end members, if necessary.
2006-10-25* src/cat.c (infile): Add "const" to declaration.Jim Meyering
* src/csplit.c (prefix): Likewise. * src/printf.c (cfcc_msg): Likewise. * src/tail.c (valid_file_spec): Likewise. * src/cut.c (cut_file): Likewise, for a parameter. * src/expr.c (str_value): Likewise. * src/fold.c (fold_file): Likewise. * src/pr.c (init_header): Likewise. * src/dircolors.c (dc_parse_stream): Likewise, for a local. * src/tr.c (make_printable_str): Likewise. * src/nl.c (body_type, header_type, footer_type, current_type): (separator_str, build_type_arg, nl_file): Likewise, for many. * src/paste.c (main): Don't assign a read-only string to 'optarg'. * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.