summaryrefslogtreecommitdiff
path: root/src/pathchk.c
AgeCommit message (Collapse)Author
2006-10-10* src/ls.c (quote_name): Use initializer rather than memset toPaul Eggert
initialize an object to zero. This is easier to read and is less likely to introduce an runtime error due to a mixup. It causes gcc -W to issue a warning, but you can work around this by appending -Wno-missing-field-initializers. * src/pathchk.c (portable_chars_only): Likewise. * src/shred.c (main): Likewise. * src/stty.c (main): Likewise. * src/tr.c (card_of_complement): Likewise. * src/wc.c (wc): Likewise.
2006-10-09Avoid a compiler warning.Jim Meyering
* src/pathchk.c (portable_chars_only): Initialize variable of type mbstate_t via memset, rather than via '{0}'. Patch from Bruno Haible.
2005-05-30(_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:Paul Eggert
Define to 256, not 255, as per modern POSIX.
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-01-10Update copyright date.Paul Eggert
2005-01-10(PORTABILITY_OPTION): New constant.Paul Eggert
(longopts, usage, main, validate_file_name): Add support for new -P option. Reject empty file names (unless -p is not specified and the current system allows empty file names). Change --portability so that is now equivalent to -p -P. Don't test whether file name is too long, if it is known to exist. (no_leading_hyphen): New function.
2004-10-18(validate_file_name): Give a more descriptiveJim Meyering
diagnostic when pathconf fails. This also avoids an unwarranted warning from gcc-3.3.5 about a format not being a string literal.
2004-10-18(AUTHORS): Add self.Paul Eggert
Change "path" to "file name" whenever possible. Remove usage comment, as it was a duplication of the code or doc. Include <wchar.h> if available. (mbrlen, mbstate_t) [! (HAVE_MBRLEN && HAVE_MBSTATE_T)]: Define. (NEED_PATHCONF_WRAPPER, PATH_MAX, PATH_MAX_FOR, NAME_MAX, pathconf_wrapper, portable_chars, dir_ok): Remove. (NAME_MAX_MINIMUM, PATH_MAX_MINIMUM): New macros. (pathconf, _PC_NAME_MAX, _PC_PATH_MAX): Define if nonexistent. (portable_chars_only): New arg FILELEN. Don't assume ASCII; we might be on an EBCDIC host. Don't assume unibyte locale in diagnostic. (component_start, component_len): New functions. (validate_file_name): Renamed from validate_path. All uses changed. Pretty much a complete rewrite. Don't make copy of file arg. Always append trailing slash to pathconf arg, just in case it's a symlink (this is pure paranoia; we don't know of any hosts where the trailing slash is required). Use size_t instead of long int when possible. Avoid need to call pathconf in most practical cases. Don't use euidaccess several times to test searchability; just use lstat once. Reword diagnostic to put the (often very long) file names last.
2004-09-21(longopts): Add --help, --version.Paul Eggert
(main): Use longopts rather than parse_long_options. (main): Don't reorder arguments, so that we can check weird file names.
2004-08-03(validate-path, main, portable_chars_only): Use bool for booleans.Paul Eggert
(portable_chars_only): Use to_uchar rather than a cast.
2004-07-25pathchk.c: Include euidaccess.h.Paul Eggert
(dir_ok): Use euidaccess, not access.
2004-06-30Use "file system" rather than "filesystem" in comments.Jim Meyering
2004-06-21(main): Standardize 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.
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
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-27(validate_path): Use %lu, not %ld.Jim Meyering
2003-07-26(validate_path): Cast strlen value to `unsigned long'Jim Meyering
so it matches `%ld' format even on 32-bit systems.
2003-07-25(validate_path): Use %ld format (not %d) for size_t value.Jim Meyering
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-07-23Don't include errno.h; system.h already does it.Jim Meyering
2003-06-17(main): Call initialize_main.Jim Meyering
2003-02-12(portable_chars_only): Remove unnecessary `const'Jim Meyering
in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
2002-12-15Remove all uses of `PARAMS'.Jim Meyering
2002-12-11(NEED_PATHCONF_WRAPPER): Undefine before defining,Jim Meyering
in case it's already defined.
2002-09-02(NEED_PATHCONF_WRAPPER): Define.Jim Meyering
(pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-05-24(validate_path): Compare the result of the function --Jim Meyering
not its (constant) address -- against zero.
2002-01-14Comment fixes to bring us up to date with respect to POSIX 1003.1-2001.Jim Meyering
In particular, POSIX.2 is now obsolete.
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-08-14(AUTHORS): Mark string for translation, since it contains the English word ↵Jim Meyering
`and'.
2001-08-12Guard the above pathconf-using definitions with `#if HAVE_PATHCONF'Jim Meyering
rather than with `#ifdef _POSIX_VERSION'.
2001-08-12(PATH_MAX_FOR): Use pathconf via wrapper.Jim Meyering
(NAME_MAX_FOR): Likewise. (pathconf_wrapper): New function. (validate_path): Declare length variables to be `long', not `int'. Adjust corresponding printf-style specs to use %ld.
2000-05-07Include "closeout.h".Jim Meyering
(main): Call atexit with close_stdout.
1999-09-02Remove xstrdup declaration.Jim Meyering
1999-08-30(longopts): Restore accidentally-removed entry for `--portability' long option.Jim Meyering
1999-08-22(validate_path): Use IF_LINT macro instead of #ifdef lint.Jim Meyering
1999-03-31(PROGRAM_NAME, AUTHORS): Define and use.Jim Meyering
1999-03-06Include long-options.h.Jim Meyering
[long_options]: Remove the "help" and "version" entries. Remove declarations of show_help and show_version. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks.
1999-01-25(usage): Remove static attribute.Jim Meyering
Move function be the first in the file.
1998-09-19update bug-reporting addressJim Meyering
1997-12-21s/__P/PARAMS/Jim Meyering
1997-12-21Don't include limits.h.Jim Meyering
1997-10-07update bug-reporting addressJim Meyering
1997-05-01indent cpp-directivesJim Meyering