Commit Graph
19012 Commits
Author SHA1 Message Date
Paul Eggert 21e05084ac (make_path, make_dir): Use bool, not int, since we're not setting errno.
Use mode_t for modes, not int.  All uses changed.
(errno): Remove decl; no longer needed since we assume C89.
2004-07-30 20:29:01 +00:00
Paul Eggert b90519d9f9 Include <stdbool.h>.
(make_path, make_dir): Use bool, not int, since we're not setting errno.
Use mode_t for modes, not int.  All uses changed.
2004-07-30 20:28:13 +00:00
Paul Eggert d41b0c05ba modechange.c now uses bool. 2004-07-30 08:02:27 +00:00
Paul Eggert 48ed3f3692 int cleanups for chmod, rm, cp, install, mkfifo. 2004-07-30 08:01:38 +00:00
Paul Eggert a586795939 (main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1. 2004-07-30 08:00:40 +00:00
Paul Eggert 35c0c98c7d (right_justify), full_filename_, AD_pop_and_chdir,
AD_push, prompt, remove_dir): Use bool when appropriate.
(top_dir, pop_dir, full_filename_):
Use size_t for sizes.
2004-07-30 08:00:02 +00:00
Paul Eggert aed86808d9 (rm_option_init, main): Use bool when appropriate.
(main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
2004-07-30 07:59:19 +00:00
Paul Eggert bbed0ba2e3 (remove_trailing_slashes, rm_option_init,
cp_option_init, do_move, movefile, main): Likewise.
* src/remove.c (right_justify), full_filename_, AD_pop_and_chdir,
AD_push, prompt, remove_dir): Likewise.
2004-07-30 07:58:07 +00:00
Paul Eggert 0892ed97a6 (isdir, change_timestamps, change_attributes,
copy_file, install_file_to_path, install_file_in_dir,
install_file_in_file, strip_files, dir_arg, cp_option_init, main,
change_attributes, change_timestamps): Likewise.
2004-07-30 07:57:50 +00:00
Paul Eggert f3b9ba46f8 (struct dir_attr, flag_path, remove_trailing_slashes,
re_protect, make_path_private, target_directory_operand, do_copy,
cp_option_init, decode_preserve_arg, main): Use bool when appropriate.
(target_directory_operand): Do not clear *NEW_DST if stat
succeeds.  It's not necessary in that case, as *NEW_DST is always
false already.
(do_copy): Rewrite slightly to avoid need for "unreachable" comment.
(main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
2004-07-30 07:57:27 +00:00
Paul Eggert 89c5dddb8f (remember_created): Use bool when appropriate. 2004-07-30 07:55:59 +00:00
Paul Eggert 1c9f7316d2 (remember_created): Use bool when appropriate. 2004-07-30 07:55:33 +00:00
Paul Eggert 49eaeaf611 (copy_internal, is_ancestor, copy_dir, copy_reg,
same_file_ok, seen_file, copy_internal, valid_options, copy):
Use bool when appropriate.
2004-07-30 07:51:59 +00:00
Paul Eggert dabfc733f7 (struct cp_options): Use bool when appropriate. 2004-07-30 07:49:39 +00:00
Paul Eggert e61348619a (hard_LC_COLLATE, only_file_1, only_file_2, both, compare_files, main):
Use bool when appropriate.
2004-07-30 05:25:17 +00:00
Paul Eggert 299d98cfe2 (cksum, main): Use bool when appropriate. 2004-07-30 04:12:25 +00:00
Paul Eggert f232dfa081 (recurse, force_silent, process_file, process_files, main): Use bool
when appropriate.
2004-07-30 04:06:41 +00:00
Paul Eggert 6d02317a83 Update copyright. 2004-07-30 04:06:16 +00:00
Paul Eggert f9663b8c83 Include <stdbool.h>.
(mode_compile): Use bool when appropriate.
2004-07-30 04:05:50 +00:00
Paul Eggert 0d812118fa md5sum, sha1sum integer cleanups. 2004-07-30 00:55:09 +00:00
Paul Eggert 577caa4da2 (OPENOPTS, have_read_stdin, status_only, warn,
bsd_split_3, split_3, hex_digits, digest_file, digest_check, main):
Use bool when appropriate.
(digest_check): Increase limit of number of input lines to
UINTMAX_MAX from INT_MAX.  Diagnose any overflows of this counter.
Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals.
2004-07-30 00:54:44 +00:00
Paul Eggert bd20ce2bad Don't include any files other than checksum.h. 2004-07-30 00:54:02 +00:00
Paul Eggert 286aff1fe6 Don't include config.h, sys/types.h, stdio.h: not needed.
(ALG_UNSPECIFIED): Remove.
(ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary.
2004-07-30 00:53:49 +00:00
Paul Eggert a8faa974c4 md5sum and sha1sum overflow detection. 2004-07-30 00:53:23 +00:00
Paul Eggert ac63cc6b0f Fix copyright year. 2004-07-30 00:40:40 +00:00
Paul Eggert 14508bd891 Use sizeof, not alignof, in memchr and memrchr. 2004-07-29 17:34:38 +00:00
Paul Eggert f03b0c3060 (UNALIGNED_P): Use sizeof, not alignof. 2004-07-29 17:34:20 +00:00
Paul Eggert 3a7060d519 (UNALIGNED_P): Use sizeof, not alignof. 2004-07-29 17:33:38 +00:00
Paul Eggert 0bdefc2dca 'int' cleanup for "cat". 2004-07-29 06:12:44 +00:00
Paul Eggert 69da9561c7 (exit_status): Remove. Now done by passing a boolean
'ok' flag around.
(simple_cat, cat): Return true if successful.  All callers changed.
(simple_cat, cat, main): Use bool for booleans.
(simple_cat): Use size_t for sizes.
(cat, main): Use the same names for parameters that we use for
long options, to avoid confusion.  This inverts the sense of the
show_tabs (formerly output_tabs) and number_nonblank
(formerly numbers_at_empty_lines) variables.
(main): Don't mess up (due to integer overflow) if we are given
INT_MAX - INT_MIN + 1 options.
[O_BINARY]: Don't invoke isatty unless the other options require it.
(main): When deciding whether to use simple_cat, don't worry
about binary option; it's irrelevant.
2004-07-29 06:12:27 +00:00
Paul Eggert b61e6bc352 dcgen cleanup. 2004-07-28 23:59:37 +00:00
Paul Eggert 488905a239 Remove comments, trailing white space, and empty
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-28 23:59:11 +00:00
Paul Eggert 3a92cf062b chown/chgrp cleanup. 2004-07-28 23:39:12 +00:00
Paul Eggert d73c456b2e (chown_files): Return true/false, not 0/-1, since we don't set errno. 2004-07-28 23:38:36 +00:00
Paul Eggert 5c0ca7ea76 Include inttostr.h.
(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 23:37:49 +00:00
Paul Eggert 65c2eab955 (main): int -> bool when appropriate. 2004-07-28 23:37:21 +00:00
Paul Eggert a830ae0cbb (parse_group): Require base 10 when parsing groups as integers.
(main): int -> bool when appropriate.
2004-07-28 23:36:59 +00:00
Paul Eggert 3badaccae1 userspec.c cleanup, e.g. for "chown 010 file". 2004-07-28 23:06:25 +00:00
Paul Eggert a07018a24d Include <stdbool.h>, "inttostr.h".
(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-28 23:06:11 +00:00
Paul Eggert 0bddab6d08 Test for "chown 010 file". 2004-07-28 23:05:52 +00:00
Paul Eggert adab436e48 Test for proper handling of uids like
"010", which must be parsed as decimal.
2004-07-28 23:05:27 +00:00
Paul Eggert f8fe7f2e43 Regenerate. 2004-07-28 22:32:26 +00:00
Paul Eggert ef6b50199e memchr and memrchr portability fixes. 2004-07-28 22:21:33 +00:00
Paul Eggert 8792823f5c Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
(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-28 22:21:18 +00:00
Paul Eggert 5048f3461c Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
(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-28 22:20:56 +00:00
Paul Eggert 9f09a96f97 md5, sha1 cleanups; getugroups change. 2004-07-28 20:11:45 +00:00
Paul Eggert 926de77e69 md5, sha1 cleanups. 2004-07-28 20:10:55 +00:00
Paul Eggert 2146f830d2 (gl_SHA): Require AC_C_BIGENDIAN. 2004-07-28 20:10:44 +00:00
Paul Eggert c01cc5cfaa (gl_MD5): Do not require AC_C_INLINE, since it doesn't
use inline any more.  Require AC_C_BIGENDIAN, though.
2004-07-28 20:10:18 +00:00
Paul Eggert 94185e124d Don't include <sys/types.h> or <stdlib.h>; <stddef.h>
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-28 20:09:39 +00:00