summaryrefslogtreecommitdiff
path: root/src/test.c
AgeCommit message (Collapse)Author
2004-11-14(usage): Put the description of `[-n] STRING'Jim Meyering
on two lines, one for `-n STRING' and one for `STRING' so that help2man properly escapes the `-'. Otherwise, the hyphen is rendered inappropriately in UTF-8 locales.
2004-09-09(usage): Document -r, -w, -x more carefully.Paul Eggert
2004-09-09(usage): Mention that -h and -L don't dereference.Paul Eggert
2004-09-09(usage): Document "test" (with no args) and "[ ]".Paul Eggert
2004-09-06Sort options in usage message.Paul Eggert
2004-08-03(TRUE, FALSE, SHELL_BOOLEAN, TRUTH_OR, TRUTH_AND):Paul Eggert
Remove. All uses replaced by C99 boolean primitives. (TEST_TRUE, TEST_FALSE): New constants, for readability. (test_unop, binop, unary_operator, binary_operator, two_arguments, three_arguments, posixtest, expr, term, and, or, is_int, age_of, one_argument, main): Use bool for booleans. (advance, unary_advance): Now inline procedures rather than a macros. (is_int): Renamed from isint, to avoid namespace clash with ctype.h. (term, and, or): When it's easy, loop instead of recursing. (term): Avoid integer overflow if there are INT_MAX-3 args (!). (binary_operator, unary_operator): Simplify by systematically rewriting true==FOO to FOO (where FOO is a boolean). (unary_operator): Don't consider a file to be a regular file merely because its mode&S_IFMT is zero. Just use S_ISREG. Remove unnecessary casts. Remove ifdefs for things like S_ISSOCK that are no longer needed, since stat-macros.h always defines them now.
2004-07-25(R_OK, W_OK, X_OK, FOK): Remove; system.h defines them.Paul Eggert
(eaccess): Remove. All users changed to use euidaccess instead.
2004-06-22(usage): Correct description of `-t FD'. The fileJim Meyering
descriptor, FD, is no longer optional. Reported by Ton Nijkes.
2004-06-21Standardize on the diagnostics given when someone givesJim Meyering
too few operands ("missing operand after `xxx'") or too many operands ("extra operand `xxx'"). Include "quote.h" and/or "error.h" if it wasn't already being included. (beyond, main): Likewise.
2004-06-01(binary_operator, and, or, main):Jim Meyering
Prefer the notation `STREQ (a, b)' over `!strcmp (a, b)' and `STREQ (a, b)' over `strcmp (a, b) == 0'.
2004-01-22(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(main): Use initialize_exit_failure rather than setting exit_failure directly; this optimizes away redundant assignments.
2003-11-05Cast NULL to `(char *)' in call to variadic function,Jim Meyering
parse_long_options, so that it works even on systems for which sizeof char* != sizeof int.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-07-26Include exitfail.h.Jim Meyering
(TEST_FAILURE): New constant, used for exit status if 'test' fails. (test-syntax_error): Use it. (binary_operator): Now takes bool arg specifying whether left operand is -l ARG, so that caller determines this rather than us. All uses changed. (term): Use posixtest to evaluate parenthesized subexpressions. (unary_operator, one_argument): Remove support for -t without operand. (one_argument): Take argument from argv[pos]. (one_argument, two_arguments, three_arguments): Advance pos. All callers changed. (three_arguments): Look for binary ops before "!". Then look for parenthesized one_argument expressions, instead of trusting expr () to do the right thing. (posixtest): Now takes number of args. All callers changed. Treat "( A B )" like "A B". (main): Set exit_failure to TEST_FAILURE. Don't depend on POSIXLY_CORRECT, as we now conform to POSIX by default. (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include limits.h or error.h.
2003-07-16(integer_expected_error): Improve diagnostic -- now,Jim Meyering
it also matches the one from bash's builtin test. (binary_operator): Add \n at end of diagnostic.
2003-07-16(AUTHORS): Replace 3-letter usernames with the actualJim Meyering
names of authors that I just found in bash's builtins/test.def.
2003-07-16Running `[' with no arguments would evoke a segfault.Jim Meyering
(main) [LBRACKET]: Move initialization of argv to precede potential use via test_syntax_error.
2003-07-06Add support for a "[" that conforms to the GNU coding standards,Jim Meyering
i.e., that does not depend on its name. (LBRACKET): Define to 0 if not defined. (main): Use LBRACKET rather than argv[0]. ---------- (one_argument): Do not check for -t if POSIXLY_CORRECT. (main): Do not recognize --help or --version if POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly. Do not bother testing that margv[margc] is non-null.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-06-02[!TEST_STANDALONE]: Remove #if-0'd block.Jim Meyering
(STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2003-04-11Remove SPC in SPC-TAB sequence.Jim Meyering
2003-02-10add comments and fix dumb typosJim Meyering
2003-02-10Don't include group-member.h.Jim Meyering
Include euidaccess.h. (eaccess): Rewrite function to set the real uid and gid temporarily to the effective uid and gid, then invoke 'access', and then set the real uid and gid back. On systems that lack setreuid or setregid, fall back on the kludges in euidaccess. Before, it would not work for e.g., files with ACLs, files that were marked immutable, or on file systems mounted read-only.
2003-02-09(test_stat): Remove function. It's job is done (onlyJim Meyering
when necessary) by the wrapper in lib/stat.c.
2002-12-15Remove all uses of `PARAMS'.Jim Meyering
2002-09-25(eaccess): Change type of local `euid' from int to uid_tJim Meyering
and add a cast, to avoid a warning about `signed and unsigned type in conditional expression'.
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-04-28(integer_expected_error): Add `const' to paramaterJim Meyering
declarations to avoid new warning from gcc.
2002-04-28(test_syntax_error): Add `const' to paramaterJim Meyering
declarations to avoid new warning from gcc.
2002-03-25update copyrightJim Meyering
2002-03-25(age_of): Return -1 and 0 rather than 0 and 1.Jim Meyering
Might as well keep it simple, and like bash. (binary_operator): Fix bug with -nt and -ot, when one of the files did not exist. We want to be compatible with the ksh93 documentation, and with Bash.
2001-12-15Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions. Split --help output into smaller pieces. Use fputs, not printf.
2001-11-25(usage): Indent --help and --version strings to start in the 7th column.Jim Meyering
2001-09-16(usage): Describe -h option.Jim Meyering
From Michael Stone. http://bugs.debian.org/99272
2001-09-09(binary_operator): Correct typo in diagnostic.Jim Meyering
From Jochen Hein.
2001-08-18(binary_operator): Move declarations of lt,rt `down'Jim Meyering
into the scopes where they're actually used. (unary_operator): Likewise for `fd'.
2001-08-18(isint, binary_operator, unary_operator):Jim Meyering
Use intmax_t for argument integers, not long. (age_of, binary_operator): Use time_t for times, not long. (unary_operator): If N is out of int range, -t N now returns false.
2001-08-14(AUTHORS): Mark string for translation, since it contains the English word ↵Jim Meyering
`and'.
2000-05-07Include "closeout.h".Jim Meyering
(main): Call atexit with close_stdout.
1999-08-22Use ATTRIBUTE_NORETURN instead of NO_RETURN_ATTRIBUTE.Jim Meyering
1999-03-29PROGRAM_NAME: rename from COMMAND_NAMEJim Meyering
1999-03-04(main): Include author name argument in call to parse_long_options.Jim Meyering
1999-02-16update copyright datesJim Meyering
1999-01-25(usage): Remove static attribute.Jim Meyering
1998-09-19update bug-reporting addressJim Meyering