summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2004-07-28Remove comments, trailing white space, and emptyPaul Eggert
lines from the output strings, to save space. Use a narrower type like 'unsigned char' for line lengths, if that will do. Make the output variables static, not extern.
2004-07-28chown/chgrp cleanup.Paul Eggert
2004-07-28(chown_files): Return true/false, not 0/-1, since we don't set errno.Paul Eggert
2004-07-28Include inttostr.h.Paul Eggert
(UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove. (gid_to_name, uid_to_name): Use imaxtostr/umaxtostr instead of uint_to_string). (describe_change): Instead of an int flag, use a char * auxiliary; this avoids the need for casts. Assume free (NULL) works. (change_file_owner): Return true/false, not 0/-1, since we don't set errno. All callers changed. Use bool when appropriate. (chown_files): Likewise.
2004-07-28(main): int -> bool when appropriate.Paul Eggert
2004-07-28(parse_group): Require base 10 when parsing groups as integers.Paul Eggert
(main): int -> bool when appropriate.
2004-07-28userspec.c cleanup, e.g. for "chown 010 file".Paul Eggert
2004-07-28Include <stdbool.h>, "inttostr.h".Paul Eggert
(V_STRDUP): Don't assume the string's length fits in int. (ISDIGIT): unsigned -> unsigned int (is_number): Define only ifdef __DJGPP__; not needed elsewhere. Use bool instead of int where appropriate. Do not allow empty strings. (parse_user_spec): Parse numbers as decimal integers, even if they have a leading 0. Don't assume uids and gids fit in int.
2004-07-28Test for "chown 010 file".Paul Eggert
2004-07-28Test for proper handling of uids likePaul Eggert
"010", which must be parsed as decimal.
2004-07-28Regenerate.Paul Eggert
2004-07-28memchr and memrchr portability fixes.Paul Eggert
2004-07-28Include <stddef.h>, not <stdlib.h> and <sys/types.h>.Paul Eggert
(LONG_MAX_32_BITS): Remove. Include <inttypes.h> and <stdint.h> if available. (alignof, UNALIGNEDP): New macro, portable to all C89 hosts. (__memrchr): Don't assume unsigned long int is either 4 or 8 bytes; let it be any number of bytes greater than or equal to 4.
2004-07-28Include <stddef.h>, not <stdlib.h> and <sys/types.h>.Paul Eggert
(LONG_MAX_32_BITS): Remove. Include <inttypes.h> and <stdint.h> if available. (alignof, UNALIGNEDP): New macro, portable to all C89 hosts. (__memchr): Don't assume unsigned long int is either 4 or 8 bytes; let it be any number of bytes greater than or equal to 4. * memrchr.c: Likewise, with __memrchr.
2004-07-28md5, sha1 cleanups; getugroups change.Paul Eggert
2004-07-28md5, sha1 cleanups.Paul Eggert
2004-07-28(gl_SHA): Require AC_C_BIGENDIAN.Paul Eggert
2004-07-28(gl_MD5): Do not require AC_C_INLINE, since it doesn'tPaul Eggert
use inline any more. Require AC_C_BIGENDIAN, though.
2004-07-28Don't include <sys/types.h> or <stdlib.h>; <stddef.h>Paul Eggert
suffices with C89 or better. (alignof): New macro, portable to all C89 hosts. (UNALIGNED): Use it. Use uintptr_t if available, and assume everything is unaligned otherwise; this is more portable than assuming 'unsigned long int' will always work.
2004-07-28Include <stdint.h> if HAVE_STDINT_H || _LIBC, notPaul Eggert
ifdef _LIBC. (md5_uint32): Use uint32_t if available. Simplify fallback ifdefs.
2004-07-28Include <errno.h>.Paul Eggert
(EOVERFLOW): Define if not defined. (getgroups): Return -1 with errno=EOVERFLOW if an integer overflow occurs.
2004-07-28Regenerate.Paul Eggert
2004-07-28Don't assume that Perl's getpwd agrees with ours.Paul Eggert
2004-07-28Don't assume that Perl's getpwd agrees with ourPaul Eggert
pwd when there are multiple names for the working directory (which can happen with an automounter, sigh).
2004-07-28In src/Makefile.am, don't have 'groups' or 'localedir.h' depend on Makefile.Paul Eggert
2004-07-28this causes Solaris 8 'make' to refuse to build "groups".Paul Eggert
(localedir.h): Don't depend on Makefile: this causes Solaris 8 'make' to build localedir.h unnecessarily. The dependence on Makefile is ineffective anyway, since $(localedir) might change even if Makefile hasn't.
2004-07-28* src/remove.c (remove_dir): If we can't save the state of thePaul Eggert
working directory, pretend we started from "/", not ".".
2004-07-28(remove_dir): If we can't save the state of thePaul Eggert
working directory, pretend we started from "/", not ".". This avoids a bug on hosts like Solaris that don't let you remove the working directory.
2004-07-28In src/printf.c, declare strtoimax and strtoumax if not already declared.Paul Eggert
2004-07-28(strtiomax, strtoumax): Declare if not alreadyPaul Eggert
declared: this fixes a portability bug with Solaris 8 + GCC. (STRTOX): Parenthesize use of macro arg as expression. (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary parentheses.
2004-07-28Check for declaration of strtoumax, for src/printf.c.Paul Eggert
2004-07-28Regenerate.Paul Eggert
2004-07-28Get eaccess from libgen if available; that's where it is on Solaris 9.Paul Eggert
2004-07-28(cp_LDADD, ginstall_LDADD, mv_LDADD,Paul Eggert
pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess.
2004-07-28(gl_PREREQ_EUIDACCESS): Don't bother checking forPaul Eggert
unistd.h, as autoconf does this for us. Check for libgen.h. Also look for eaccess within -lgen, which is where it is in Solaris. Set LIB_EACCESS accordingly.
2004-07-28euidaccess.c [HAVE_LIBGEN_H]: Include <libgen.h>, forPaul Eggert
eaccess on Solaris and SVR4-like systems. (euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
2004-07-28cycle-check integer overflow fixup.Paul Eggert
2004-07-28Remove now-inaccurate comment about the filesPaul Eggert
you need to include first. You don't need to include any files other than the usual config.h. Include <inttypes.h> and <stdint.h> if available, for uintmax_t. Remove 'struct stat;' not needed since we know sys/stat.h has been included by dev-ino.h. (struct cycle_check_state): Change chdir_counter to uintmax_t, not size_t, since it isn't limited by object sizes. Change magic from long unsigned int to int; that's good enough for our use.
2004-07-28(is_zero_or_power_of_two): Renamed fromPaul Eggert
is_power_of_two, to reflect better what it really does. All uses changed. Arg is now uintmax_t, not unsigned int (it should have been unsigned long int -- that was a bug). (cycle_check): Check for integer overflow in cycle count, and report a cycle if that happens, as it must be a cycle by this point.
2004-07-28Don't assume that we can remove the working directory in tests.Paul Eggert
2004-07-27Regenerate.Paul Eggert
2004-07-27Merged into backupfile.c.Paul Eggert
2004-07-27backupfile integer overflow fixupsPaul Eggert
2004-07-27backupfile integer overflow fixupsPaul Eggert
2004-07-27(do_link): find_backup_file_name no longer returns NULL, so don'tPaul Eggert
bother to check for this.
2004-07-27(do_copy): find_backup_file_name no longer returns NULL, so don'tPaul Eggert
bother to check for this.
2004-07-27(copy_internal): find_backup_file_name no longerPaul Eggert
returns NULL, so don't bother to check for this.
2004-07-27(gl_BACKUPFILE): AC_REQUIREPaul Eggert
gl_CHECK_TYPE_STRUCT_DIRENT_D_INO instead of invoking it directly. Do not require AC_FUNC_CLOSEDIR_VOID.
2004-07-27backupfile.c rewrite to avoid arbitrary limits on lengths ofPaul Eggert
numeric backup extensions. Include "backupfile.h" first. Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h. (CLOSEDIR, INT_STRLEN_BOUND): Remove. (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro. (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro. (NAME_MAX_MAXIMUM): New macro. Unlike the old addext.c, we also look at _XOPEN_NAME_MAX, for better performance on modern hosts that support only file names of length 255 or more. (ISDIGIT): unsigned -> unsigned int (max_backup_version, version_number): Remove. (check_extension): New function. Similar to the old addext, but static, assumes that the extension has already been added, and a bit more careful on DOS hosts. (numbered_backup): New function. It does what max_backup_version and version_number used to do, but it doesn't use integer arithmetic to calculate extensions so it doesn't overflow. (find_backup_file_name): Rewrite to use these new functions. This has a new optimization: we needn't call pathconf if the new numbered backup name has the same length as the old. Also, use xmalloc rather than malloc, so that the caller needn't worry about memory exhaustion.
2004-07-27backupfile.h (addext): Remove decl.Paul Eggert