platform/upstream/coreutils.git
20 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 22:51:09 +0000 (22:51 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.

20 years agoUpdate copyright.
Paul Eggert [Mon, 2 Aug 2004 22:50:47 +0000 (22:50 +0000)]
Update copyright.

20 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 22:50:29 +0000 (22:50 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.

20 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 22:49:58 +0000 (22:49 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.

20 years ago(hash_string): Rewrite to avoid cast.
Paul Eggert [Mon, 2 Aug 2004 22:49:34 +0000 (22:49 +0000)]
(hash_string): Rewrite to avoid cast.

20 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 22:49:12 +0000 (22:49 +0000)]
Include <stdbool.h>.
(hard_locale): Return bool, not int.

20 years agohard-locale.c (hard_locale): Return bool, not int.
Paul Eggert [Mon, 2 Aug 2004 22:48:49 +0000 (22:48 +0000)]
hard-locale.c (hard_locale): Return bool, not int.

20 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 22:48:05 +0000 (22:48 +0000)]
Include <stdbool.h>.
(getloadavg_initialized): Use bool for booleans.

20 years ago(lookup_word): Rewrite to avoid cast.
Paul Eggert [Mon, 2 Aug 2004 22:47:44 +0000 (22:47 +0000)]
(lookup_word): Rewrite to avoid cast.

20 years ago(textutils_fileblocks_unused): Make it a typedef
Paul Eggert [Mon, 2 Aug 2004 22:47:25 +0000 (22:47 +0000)]
(textutils_fileblocks_unused): Make it a typedef
instead of an int, to save a few bytes in the object file.

20 years agoUpdate copyright.
Paul Eggert [Mon, 2 Aug 2004 22:47:00 +0000 (22:47 +0000)]
Update copyright.

20 years ago(enum canonicalize_mode_t): Reformat comments to fit in 80 columns.
Paul Eggert [Mon, 2 Aug 2004 22:42:37 +0000 (22:42 +0000)]
(enum canonicalize_mode_t): Reformat comments to fit in 80 columns.

20 years ago(errno): Remove decl; we now assume C89 or better.
Paul Eggert [Mon, 2 Aug 2004 22:41:37 +0000 (22:41 +0000)]
(errno): Remove decl; we now assume C89 or better.

20 years ago(struct File_spec, reopen_inaccessible_files, count_lines,
Paul Eggert [Mon, 2 Aug 2004 22:20:24 +0000 (22:20 +0000)]
(struct File_spec, reopen_inaccessible_files, count_lines,
forever, from_start, print_headers, have_read_stdin, valid_file_spec,
write_header, file_lines, pipe_lines, pipe_bytes, recheck,
tail_forever, tail_bytes, tail_lines, tail, tail_file,
parse_obsolescent_option, parse_options, main):
Use bool for booleans.
(struct File_spec, max_n_unchanged_stats_between_opens,
parse_options): Use uintmax_t, not unsigned int or unsigned long int,
for state counters.
(tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
make it a bit clearer.

20 years ago(apply_suffix): Use bool for booleans.
Paul Eggert [Mon, 2 Aug 2004 22:19:27 +0000 (22:19 +0000)]
(apply_suffix):  Use bool for booleans.

20 years ago(equal_width, valid_format, main): Use bool for booleans.
Paul Eggert [Mon, 2 Aug 2004 22:19:01 +0000 (22:19 +0000)]
(equal_width, valid_format, main): Use bool for booleans.

20 years ago(xstrtod): Return bool, not int. Invert the sense of the boolean.
Paul Eggert [Mon, 2 Aug 2004 22:18:32 +0000 (22:18 +0000)]
(xstrtod): Return bool, not int.  Invert the sense of the boolean.
All uses changed.

20 years ago(xstrtod): Return bool, not int. Invert the sense of the boolean.
Paul Eggert [Mon, 2 Aug 2004 22:17:42 +0000 (22:17 +0000)]
(xstrtod): Return bool, not int.  Invert the sense of the boolean.
All uses changed.

20 years agoInclude "xgethostname.h".
Paul Eggert [Mon, 2 Aug 2004 21:52:28 +0000 (21:52 +0000)]
Include "xgethostname.h".
(xgethostname): Remove decl; xgethostname.h has it.
(sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO)
&& defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use
prototypes rather than K&R form.  Assume any negative value from
sysinfo denotes failure, not just -1.
(main): Simplify use of sethostname.

20 years agoDon't include <sys/types.h> or "exit.h"; no longer needed.
Paul Eggert [Mon, 2 Aug 2004 21:52:07 +0000 (21:52 +0000)]
Don't include <sys/types.h> or "exit.h"; no longer needed.
(errno): Remove decl; we now assume C89 or better.
Include unistd.h if available, for gethostname.
(ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with
existing errno values if any.
(gethostname): Remove decl, since unistd.h declares it (or doesn't,
in which case it's an older system and it should just work).
(xgethostname): Don't assume host name length is less than INT_MAX.
Exit if malloc fails, just as the comment says.

20 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 21:06:22 +0000 (21:06 +0000)]
Include <stdbool.h>.
(errno): Remove decl; we now assume C89 or better.
(save_cwd): Use bool for booleans.
(save_cwd, restore_cwd): Return -1 on failure, not 1, since we set
errno on failure.

20 years ago(do_lookup, short_list, short_output, include_idle,
Paul Eggert [Mon, 2 Aug 2004 20:56:46 +0000 (20:56 +0000)]
(do_lookup, short_list, short_output, include_idle,
include_heading, include_mesg, include_exit, need_boottime,
need_deadprocs, need_login, need_initspawn, need_clockchange,
need_runlevel, need_users, my_line_only, main): Use bool for booleans.
(print_runlevel): Use unsigned char for bytes.
(list_entries_who, scan_entries, who): Use size_t for sizes.
(main): No need to pass a non-NULL last arg to getopt_long.

20 years ago(list_entries_users, users): Use size_t for sizes.
Paul Eggert [Mon, 2 Aug 2004 20:56:30 +0000 (20:56 +0000)]
(list_entries_users, users): Use size_t for sizes.
(list_entries_users): Use char for bytes.
(main): No need to pass a non-NULL last arg to getopt_long.

20 years ago(print_uptime, uptime): Use size_t for sizes.
Paul Eggert [Mon, 2 Aug 2004 20:56:10 +0000 (20:56 +0000)]
(print_uptime, uptime): Use size_t for sizes.
(print_uptime): Remove unused local variable.
(main): No need to pass a non-NULL last arg to getopt_long.

20 years ago(include_idle, include_heading, include_fullname,
Paul Eggert [Mon, 2 Aug 2004 20:55:44 +0000 (20:55 +0000)]
(include_idle, include_heading, include_fullname,
include_project, include_plan, include_home_and_shell, do_short_format,
include_where, main): Use bool for booleans.
(count_ampersands, create_fullname, scan_entries, short_pinky):
Use size_t for sizes.
(create_fullname): Check for overflow in size calculations.
(idle_string): Don't assume that the number of idle days
is less than 10**8 and/or INT_MAX/(24*60*60).
(main): No need to pass a non-NULL last arg to getopt_long.

20 years ago(read_utmp): Don't assume that the number of users is less than INT_MAX.
Paul Eggert [Mon, 2 Aug 2004 20:55:14 +0000 (20:55 +0000)]
(read_utmp): Don't assume that the number of users is less than INT_MAX.
Check for integer overflow in size calculations.
Return -1 (not 1) on failure, since we set errno in that case.

20 years ago(UT_USER): Parenthesize properly.
Paul Eggert [Mon, 2 Aug 2004 20:54:45 +0000 (20:54 +0000)]
(UT_USER): Parenthesize properly.
(UT_USER_SIZE): New constant.
(read_utmp): Don't assume that the number of users is less than
INT_MAX.

20 years ago(posix_time_parse): Don't assume that the length of
Paul Eggert [Mon, 2 Aug 2004 20:34:27 +0000 (20:34 +0000)]
(posix_time_parse): Don't assume that the length of
the string being parsed is <= UINT_MAX.

20 years ago(read_file_system_list): Accept bool flag, not int.
Paul Eggert [Mon, 2 Aug 2004 20:27:45 +0000 (20:27 +0000)]
(read_file_system_list): Accept bool flag, not int.
(errno): Remove decl; we now assume C89 or better.
(xatoi): Remove; replaced by strtoul.  Hence device numbers can now
go up to ULONG_MAX.

20 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 20:27:16 +0000 (20:27 +0000)]
Include <stdbool.h>.
(read_file_system_list): Accept bool flag, not int.

20 years agoRegenerate.
Paul Eggert [Mon, 2 Aug 2004 20:17:31 +0000 (20:17 +0000)]
Regenerate.

20 years agoNo longer needed by 'install', so remove it.
Paul Eggert [Mon, 2 Aug 2004 20:15:49 +0000 (20:15 +0000)]
No longer needed by 'install', so remove it.

20 years ago(libfetish_a_SOURCES): Remove isdir.c.
Paul Eggert [Mon, 2 Aug 2004 20:14:53 +0000 (20:14 +0000)]
(libfetish_a_SOURCES): Remove isdir.c.

20 years ago(isdir): Remove decl.
Paul Eggert [Mon, 2 Aug 2004 20:14:39 +0000 (20:14 +0000)]
(isdir): Remove decl.
(install_file_to_path): Rely on make_path to fail if the destination
is not a directory, by passing preserve_existing==true to it.
Hence we no longer need to call isdir.
Free dest_dir immediately when it's no longer needed, rather than
waiting until the end of the function.
(copy_file): Don't bother calling isdir, as copy will do the
right thing if the destination is a directory.

20 years ago(fts_debug, opt_all, apparent_size, opt_count_all,
Paul Eggert [Mon, 2 Aug 2004 19:43:38 +0000 (19:43 +0000)]
(fts_debug, opt_all, apparent_size, opt_count_all,
print_grand_total, opt_separate_dirs, hash_ins, process_file, main):
Use bool for booleans.
(max_depth): Now size_t, not int, to avoid an arbitrary limit
of INT_MAX on depth.
(G_fail): Remove: no longer needed, now that the relevant
functions return bool.
(process_file): Use return value to signal success rather than
setting a global.  Remove first_call static var; not needed, since
we can look at n_alloc.  Use size_t for depths.  Remove FIXME
about size_t casts, as it's now fixed.  Use xnrealloc rather
than the obsolescent XREALLOC.  Don't bother to check whether
reallocation is needed unless level > prev_level.
(du_files): Invert sense of result, for consistency with
other coreutils code.  All callers changed.
(main): Allow --max-depth values up to SIZE_MAX.

20 years agoAdd an FSF copyright notice, since our changes are becoming nontrivial.
Paul Eggert [Mon, 2 Aug 2004 19:42:01 +0000 (19:42 +0000)]
Add an FSF copyright notice, since our changes are becoming nontrivial.
Include stdint.h if available, as Autoconf suggests.
(ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp
is an array.
(fts_alloc, fts_palloc, fts_sort, fts_load, fts_build):
Use size_t for sizes.
(fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build,
fts_palloc):
Use bool when appropriate.
(SIZE_MAX, TYPE_SIGNED): New macros.
(fts_read): Use u_short for instructions.
(fts_build): Use ptrdiff_t for levels.  Don't assume file name lengths
fit into int.  Don't assume nlink_t is signed.
(find_matching_ancestor): Don't assume dev, ino fit in int.
(fts_stat): Use function prototype; required for bool arg.
(fts_sort): Detect integer overflow in size calculations.
(fts_alloc): Simplify allocation code, now that fts_statp is an array
and not a pointer.

20 years agoAdd an FSF copyright notice, since our changes are becoming nontrivial.
Paul Eggert [Mon, 2 Aug 2004 19:41:35 +0000 (19:41 +0000)]
Add an FSF copyright notice, since our changes are becoming nontrivial.
Include stddef.h, for ptrdiff_t.
(FTS.fts_nitems): Now size_t, not int, for hosts that allow more
than INT_MAX entries in a directory.
(FTS_ROOTPARENTLEVEL): Parenthesize properly.
(FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more
than INT_MAX levels deep on 64-bit hosts.
(FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like
the Hurd that don't have arbitrary limits on directory entry lengths.
(FTSENT.fts_statp): Now an array, not a pointer, so that we don't
have to play unportable games with pointer arithmetic.  Keep it array
for the benefit of user code that assumes it is a pointer.

20 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 18:44:11 +0000 (18:44 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.
Include unistd.h, for lseek.

20 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 18:43:56 +0000 (18:43 +0000)]
Include <stdbool.h>.
(struct fs_usage): Use uintmax_t for block sizes, so that they're
not limited to INT_MAX.
Use bool for booleans.

20 years ago(inode_format, show_all_fs, show_local_fs,
Paul Eggert [Mon, 2 Aug 2004 18:43:35 +0000 (18:43 +0000)]
(inode_format, show_all_fs, show_local_fs,
show_listed_fs, posix_format, require_sync, print_type,
selected_fstype, excluded_fstype, show_dev, show_point, main):
Use bool for booleans.
(df_readable, show_dev): Use UINTMAX_MAX instead of -1.
(show_dev, show_point, main):
Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
Don't assume disk name lengths are <= INT_MAX.
Rewrite pct calculation to avoid cast.
(show_point): Don't assume resolved length is <= SSIZE_MAX.

20 years ago(EXT): Use size_t for sizes, not ptrdiff_t, so that we don't have
Paul Eggert [Mon, 2 Aug 2004 18:21:05 +0000 (18:21 +0000)]
(EXT): Use size_t for sizes, not ptrdiff_t, so that we don't have
to worry about wraparound.

20 years agofnmatch_loop.c (EXT, FCT): Use bool when appropriate.
Paul Eggert [Mon, 2 Aug 2004 18:10:55 +0000 (18:10 +0000)]
fnmatch_loop.c (EXT, FCT): Use bool when appropriate.
(FCT): Use size_t, not unsigned int, for sizes.
(EXT): Use ptrdiff_t, not int, for a variable that has to
store a size-related quantity but might go negative.
ptrdiff_t is good enough here, since in practice the value
can't exceed SIZE_MAX/2.

20 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 18:10:35 +0000 (18:10 +0000)]
Include <stdbool.h>.
(errno): Remove decl; we now assume C89 or better.

20 years ago(strip_trailing_slashes): Now returns bool.
Paul Eggert [Mon, 2 Aug 2004 17:33:57 +0000 (17:33 +0000)]
(strip_trailing_slashes): Now returns bool.

20 years ago(dir_name): Use bool when appropriate.
Paul Eggert [Mon, 2 Aug 2004 17:33:37 +0000 (17:33 +0000)]
(dir_name): Use bool when appropriate.

20 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 17:33:24 +0000 (17:33 +0000)]
Include <stdbool.h>.
(strip_trailing_slashes): Now returns bool.

20 years ago(argmatch, __xargmatch_internal, argmatch_invalid):
Paul Eggert [Mon, 2 Aug 2004 17:24:00 +0000 (17:24 +0000)]
(argmatch, __xargmatch_internal, argmatch_invalid):
Use ptrdiff_t, not int, when counting arguments, to allow more
than INT_MAX arguments.
Use bool when appropriate.

20 years ago(argmatch, __xargmatch_internal, argmatch_invalid):
Paul Eggert [Mon, 2 Aug 2004 17:23:19 +0000 (17:23 +0000)]
(argmatch, __xargmatch_internal, argmatch_invalid):
Use ptrdiff_t, not int, when counting arguments, to allow more
than INT_MAX arguments.

20 years agoInstall safe-read fix for blocksizes greater than 2**31.
Paul Eggert [Mon, 2 Aug 2004 05:56:14 +0000 (05:56 +0000)]
Install safe-read fix for blocksizes greater than 2**31.

20 years ago(errno): Remove decl; we now assume C89 or better.
Paul Eggert [Mon, 2 Aug 2004 05:55:54 +0000 (05:55 +0000)]
(errno): Remove decl; we now assume C89 or better.
(safe_rw): Don't work around Tru64 bug unless the bug symptoms
manifest themselves.  This allows us to do proper reads and writes
on other hosts, e.g., "dd" with a block size greater than 2**31.

20 years agoRegenerate.
Paul Eggert [Mon, 2 Aug 2004 05:30:48 +0000 (05:30 +0000)]
Regenerate.

20 years agoRegenerate.
Paul Eggert [Mon, 2 Aug 2004 05:29:29 +0000 (05:29 +0000)]
Regenerate.

20 years agoInitial revision
Paul Eggert [Mon, 2 Aug 2004 05:28:02 +0000 (05:28 +0000)]
Initial revision

20 years agouintptr_t and uint32_t port to Solaris 8.
Paul Eggert [Mon, 2 Aug 2004 05:26:59 +0000 (05:26 +0000)]
uintptr_t and uint32_t port to Solaris 8.

20 years ago(ptr_align): Use size_t; in practice, this is just as
Paul Eggert [Mon, 2 Aug 2004 05:26:19 +0000 (05:26 +0000)]
(ptr_align): Use size_t; in practice, this is just as
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.

20 years ago(UINT_MAX_32_BITS): Remove.
Paul Eggert [Mon, 2 Aug 2004 05:26:01 +0000 (05:26 +0000)]
(UINT_MAX_32_BITS): Remove.
(word32): Remove.  All uses changed to uint32_t.
(isaac_seed_data): Remove unnecessary cast.

20 years ago(hash_int) [!defined UINTPTR_MAX]: Use size_t instead of uintptr_t.
Paul Eggert [Mon, 2 Aug 2004 05:25:33 +0000 (05:25 +0000)]
(hash_int) [!defined UINTPTR_MAX]: Use size_t instead of uintptr_t.

20 years agoInitial revision.
Paul Eggert [Mon, 2 Aug 2004 05:24:47 +0000 (05:24 +0000)]
Initial revision.

20 years ago(gl_MD5): Require gl_AC_TYPE_UINT32_T.
Paul Eggert [Mon, 2 Aug 2004 05:23:39 +0000 (05:23 +0000)]
(gl_MD5): Require gl_AC_TYPE_UINT32_T.

20 years ago(gl_CHECK_ALL_TYPES):
Paul Eggert [Mon, 2 Aug 2004 05:22:57 +0000 (05:22 +0000)]
(gl_CHECK_ALL_TYPES):
Require gl_AC_TYPE_UINTPTR_T instead of using AC_CHECK_TYPE
on uintptr_t.  Require gl_AC_TYPE_UINT32_T.

20 years ago(UNALIGNED_P): Use size_t; in practice, this is just as
Paul Eggert [Mon, 2 Aug 2004 05:22:22 +0000 (05:22 +0000)]
(UNALIGNED_P): Use size_t; in practice, this is just as
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.

20 years agoDon't include inttypes.h or stdint.h.
Paul Eggert [Mon, 2 Aug 2004 05:21:47 +0000 (05:21 +0000)]
Don't include inttypes.h or stdint.h.
(UNALIGNED_P): Remove.
(__memrchr): Use size_t, not uintptr_t, to test alignment.

20 years agoDon't include inttypes.h or stdint.h.
Paul Eggert [Mon, 2 Aug 2004 05:21:12 +0000 (05:21 +0000)]
Don't include inttypes.h or stdint.h.
(UNALIGNED_P): Remove.
(__memchr): Use size_t, not uintptr_t, to test alignment.

20 years agoDon't include <limits.h>. Include <inttypes.h> if available,
Paul Eggert [Mon, 2 Aug 2004 05:20:05 +0000 (05:20 +0000)]
Don't include <limits.h>.  Include <inttypes.h> if available,
as it defines symbols like UINT32_MAX on Solaris 8.
(md5_uint32): Assume uint32_t exists; Autoconf will define it
otherwise (if the host has a 32-bit unsigned type, anyway).

20 years ago(UNALIGNED_P): Use size_t; in practice, this is just as
Paul Eggert [Mon, 2 Aug 2004 05:19:30 +0000 (05:19 +0000)]
(UNALIGNED_P): Use size_t; in practice, this is just as
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.

20 years agoFix typo: down -> done.
Paul Eggert [Sun, 1 Aug 2004 15:21:56 +0000 (15:21 +0000)]
Fix typo: down -> done.

20 years ago* src/Makefile.am (localedir.h): Make it readonly.
Paul Eggert [Sun, 1 Aug 2004 15:19:02 +0000 (15:19 +0000)]
* src/Makefile.am (localedir.h): Make it readonly.

20 years ago(localedir.h): Make it readonly; this
Paul Eggert [Sun, 1 Aug 2004 15:18:29 +0000 (15:18 +0000)]
(localedir.h): Make it readonly; this
undoes part of the 2004-07-27 patch.

20 years agoImprove comment for first_same_file.
Paul Eggert [Fri, 30 Jul 2004 23:24:03 +0000 (23:24 +0000)]
Improve comment for first_same_file.

20 years agosort, system.h, tr int cleanup
Paul Eggert [Fri, 30 Jul 2004 21:09:04 +0000 (21:09 +0000)]
sort, system.h, tr int cleanup

20 years ago(to_uchar): Remove; now in system.h.
Paul Eggert [Fri, 30 Jul 2004 21:08:48 +0000 (21:08 +0000)]
(to_uchar): Remove; now in system.h.
(is_char_class_member): Use bool when appropriate.

20 years ago(errno, CHAR_BIT): Remove decls;
Paul Eggert [Fri, 30 Jul 2004 21:08:25 +0000 (21:08 +0000)]
(errno, CHAR_BIT): Remove decls;
no longer needed now we assume C89 or better.
Include <inttypes.h> before <stdint.h>, as it's the Autoconf-recommended pattern.
(to_uchar): New inline function, moved here from tr.c.
Use full names for int types, e.g. "long int" rather than "long".

20 years ago(UCHAR): Remove; all uses changed to to_uchar.
Paul Eggert [Fri, 30 Jul 2004 21:08:02 +0000 (21:08 +0000)]
(UCHAR): Remove; all uses changed to to_uchar.
(IS_THOUSANDS_SEP): Use bool when appropriate.
(numcompare, main): Use char, not int, when the value is always a char.
(numcompare): Remove "register"; compilers are smart enough these days.

20 years agomakepath int cleanup
Paul Eggert [Fri, 30 Jul 2004 20:30:39 +0000 (20:30 +0000)]
makepath int cleanup

20 years agomkdir.c int cleanup.
Paul Eggert [Fri, 30 Jul 2004 20:30:18 +0000 (20:30 +0000)]
mkdir.c int cleanup.

20 years ago(create_parents, main): Use bool when appropriate.
Paul Eggert [Fri, 30 Jul 2004 20:29:29 +0000 (20:29 +0000)]
(create_parents, main): Use bool when appropriate.
(main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.

20 years ago(make_path, make_dir): Use bool, not int, since we're not setting errno.
Paul Eggert [Fri, 30 Jul 2004 20:29:01 +0000 (20:29 +0000)]
(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.

20 years agoInclude <stdbool.h>.
Paul Eggert [Fri, 30 Jul 2004 20:28:13 +0000 (20:28 +0000)]
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.

20 years agomodechange.c now uses bool.
Paul Eggert [Fri, 30 Jul 2004 08:02:27 +0000 (08:02 +0000)]
modechange.c now uses bool.

20 years agoint cleanups for chmod, rm, cp, install, mkfifo.
Paul Eggert [Fri, 30 Jul 2004 08:01:38 +0000 (08:01 +0000)]
int cleanups for chmod, rm, cp, install, mkfifo.

20 years ago(main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.
Paul Eggert [Fri, 30 Jul 2004 08:00:40 +0000 (08:00 +0000)]
(main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.

20 years ago(right_justify), full_filename_, AD_pop_and_chdir,
Paul Eggert [Fri, 30 Jul 2004 08:00:02 +0000 (08:00 +0000)]
(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.

20 years ago(rm_option_init, main): Use bool when appropriate.
Paul Eggert [Fri, 30 Jul 2004 07:59:19 +0000 (07:59 +0000)]
(rm_option_init, main): Use bool when appropriate.
(main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.

20 years ago(remove_trailing_slashes, rm_option_init,
Paul Eggert [Fri, 30 Jul 2004 07:58:07 +0000 (07:58 +0000)]
(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.

20 years ago(isdir, change_timestamps, change_attributes,
Paul Eggert [Fri, 30 Jul 2004 07:57:50 +0000 (07:57 +0000)]
(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.

20 years ago(struct dir_attr, flag_path, remove_trailing_slashes,
Paul Eggert [Fri, 30 Jul 2004 07:57:27 +0000 (07:57 +0000)]
(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.

20 years ago(remember_created): Use bool when appropriate.
Paul Eggert [Fri, 30 Jul 2004 07:55:59 +0000 (07:55 +0000)]
(remember_created): Use bool when appropriate.

20 years ago(remember_created): Use bool when appropriate.
Paul Eggert [Fri, 30 Jul 2004 07:55:33 +0000 (07:55 +0000)]
(remember_created): Use bool when appropriate.

20 years ago(copy_internal, is_ancestor, copy_dir, copy_reg,
Paul Eggert [Fri, 30 Jul 2004 07:51:59 +0000 (07:51 +0000)]
(copy_internal, is_ancestor, copy_dir, copy_reg,
same_file_ok, seen_file, copy_internal, valid_options, copy):
Use bool when appropriate.

20 years ago(struct cp_options): Use bool when appropriate.
Paul Eggert [Fri, 30 Jul 2004 07:49:39 +0000 (07:49 +0000)]
(struct cp_options): Use bool when appropriate.

20 years ago(hard_LC_COLLATE, only_file_1, only_file_2, both, compare_files, main):
Paul Eggert [Fri, 30 Jul 2004 05:25:17 +0000 (05:25 +0000)]
(hard_LC_COLLATE, only_file_1, only_file_2, both, compare_files, main):
Use bool when appropriate.

20 years ago(cksum, main): Use bool when appropriate.
Paul Eggert [Fri, 30 Jul 2004 04:12:25 +0000 (04:12 +0000)]
(cksum, main): Use bool when appropriate.

20 years ago(recurse, force_silent, process_file, process_files, main): Use bool
Paul Eggert [Fri, 30 Jul 2004 04:06:41 +0000 (04:06 +0000)]
(recurse, force_silent, process_file, process_files, main): Use bool
when appropriate.

20 years agoUpdate copyright.
Paul Eggert [Fri, 30 Jul 2004 04:06:16 +0000 (04:06 +0000)]
Update copyright.

20 years agoInclude <stdbool.h>.
Paul Eggert [Fri, 30 Jul 2004 04:05:50 +0000 (04:05 +0000)]
Include <stdbool.h>.
(mode_compile): Use bool when appropriate.

20 years agomd5sum, sha1sum integer cleanups.
Paul Eggert [Fri, 30 Jul 2004 00:55:09 +0000 (00:55 +0000)]
md5sum, sha1sum integer cleanups.

20 years ago(OPENOPTS, have_read_stdin, status_only, warn,
Paul Eggert [Fri, 30 Jul 2004 00:54:44 +0000 (00:54 +0000)]
(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.

20 years agoDon't include any files other than checksum.h.
Paul Eggert [Fri, 30 Jul 2004 00:54:02 +0000 (00:54 +0000)]
Don't include any files other than checksum.h.

20 years agoDon't include config.h, sys/types.h, stdio.h: not needed.
Paul Eggert [Fri, 30 Jul 2004 00:53:49 +0000 (00:53 +0000)]
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.

20 years agomd5sum and sha1sum overflow detection.
Paul Eggert [Fri, 30 Jul 2004 00:53:23 +0000 (00:53 +0000)]
md5sum and sha1sum overflow detection.