Commit Graph
4366 Commits
Author SHA1 Message Date
Jim Meyering 603137e2ab *** empty log message *** 1997-12-10 11:17:16 +00:00
Jim Meyering 4f242b4d51 use NULL, '\0' instead of zeroes 1997-12-10 10:31:25 +00:00
Jim Meyering 3cd84da3a6 (main): Make sure pw->pw_shell is non-NULL before trying to strdup it.
Patch from Dick Streefland.
1997-12-10 10:25:46 +00:00
Jim Meyering 92f0098844 . 1997-12-06 21:18:14 +00:00
Jim Meyering 45ef6ccef8 . 1997-12-06 21:16:57 +00:00
Jim Meyering 20e1875a32 revert last change 1997-12-06 21:09:58 +00:00
Jim Meyering b73786146f use SORT_INITIAL_LINE_LENGTH envvar for testing 1997-12-06 21:09:30 +00:00
Jim Meyering a587b015d0 *** empty log message *** 1997-12-06 21:08:41 +00:00
Jim Meyering a353313b22 *** empty log message *** 1997-12-06 18:23:51 +00:00
Jim Meyering 7209272d72 . 1997-12-06 13:42:21 +00:00
Jim Meyering 6ee3c1a91a (fillbuf): split longer-than-80-char line 1997-12-06 12:13:52 +00:00
Jim Meyering 9f50126a03 . 1997-12-06 09:20:26 +00:00
Jim Meyering 5d1987b3da . 1997-12-06 09:18:32 +00:00
Jim Meyering 04c29cd1db Separate struct dcl and typedef.
(String *): Rename from parameter-shadowed `string'.
(stringstruct): Remove typedef.
1997-12-06 08:57:14 +00:00
Jim Meyering d91c95fda0 (re_compile_fastmap): Remove dcl of unused num_regs. 1997-12-06 08:27:25 +00:00
Jim Meyering 8f1aea2bc0 *** empty log message *** TEXTUTILS-1_22c 1997-11-30 15:17:48 +00:00
Jim Meyering ad7eabb3b3 . 1997-11-30 15:14:10 +00:00
Jim Meyering 468e83a183 *** empty log message *** 1997-11-30 14:22:56 +00:00
Jim Meyering 66fbc2c8f6 (savedir): Revert last change. malloc always
works when called with zero, because we use the wrapper if the
system version is lacking.
1997-11-30 14:20:17 +00:00
Jim Meyering 2807179898 *** empty log message *** 1997-11-30 13:44:02 +00:00
Jim Meyering 216037574d *** empty log message *** 1997-11-30 13:43:36 +00:00
Jim Meyering 4f670edacc *** empty log message *** 1997-11-30 13:37:44 +00:00
Jim Meyering 5c3d73a99b (EXTRA_DIST): Add inttypes_h.m4 and uintmax_t.m4. 1997-11-30 13:35:45 +00:00
Jim Meyering d29ca45595 . 1997-11-30 13:35:35 +00:00
Jim Meyering 9e2eec1ca9 *** empty log message *** 1997-11-30 13:35:25 +00:00
Jim Meyering e0da3d8d39 filter through cppi 1997-11-30 11:17:28 +00:00
Jim Meyering 3f7e011ab0 remove trailing blank 1997-11-30 11:16:14 +00:00
Jim Meyering bca6f1740d remove trailing blank 1997-11-30 11:15:27 +00:00
Jim Meyering d7d6efb0d7 remove trailing blank 1997-11-30 11:15:02 +00:00
Jim Meyering 3203b1d69c *** empty log message *** 1997-11-30 11:13:34 +00:00
Jim Meyering fbe1ba7079 . 1997-11-30 11:13:18 +00:00
Jim Meyering 00c42a8936 (human_readable): Convert to ANSI-style definition.
[lint]: Define `power'.
1997-11-30 11:10:24 +00:00
Jim Meyering 5320bf5037 filter through cppi 1997-11-30 11:08:39 +00:00
Jim Meyering 79111711fe . 1997-11-30 11:08:23 +00:00
Jim Meyering f7acc655f4 (print_long_format): Rename inner-scoped buf' arrays to hbuf'
to avoid shadowing local.
1997-11-30 11:07:49 +00:00
Jim Meyering e5781fe090 (change_dir_owner): Cast st_size arg to unsigned int in savedir call. 1997-11-30 11:05:34 +00:00
Jim Meyering a10fdc591f (change_dir_mode): Cast st_size arg to unsigned int in savedir call. 1997-11-30 11:05:10 +00:00
Jim Meyering f7ecccf234 (full_filename): Use memcpy, not mempcpy when not using the return value. 1997-11-30 11:02:47 +00:00
Jim Meyering 5112b2973f filter through cppi 1997-11-30 11:01:54 +00:00
Jim Meyering 10aa5f6fd7 (<limits.h>): Include if HAVE_LIMITS_H.
(CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX, UINT_MAX):
New macros.
(ST_NBLOCKS): Now counts actual blocks, not 512-byte blocks.
(ST_NBLOCKSIZE): New macro.
1997-11-30 10:25:21 +00:00
Jim Meyering 9c59f1dcc4 (<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(<limits.h>): Don't include; system.h does it now.
(INT_MAX): Remove.
(longdiff): Remove bogus definition that uses subtraction;
it gives the wrong answer when overflows occur.
(convert_blocks): Remove.
(output_units): New variable;
replaces booleans kilobyte_blocks and megabyte_blocks.
(human_readable_base): New variable.
(long_options, usage): Add -h or --human-readable and -H or --si.
(decode_switches): Adjust to renamed option variables.
Use -H if BLOCKSIZE is SI.  Add -h, -H.
(print_dir): Count blocks using uintmax_t, not int.
(gobble_file): Now returns uintmax_t, not int.
Don't convert blocks to 512 byte units, as this might overflow;
let caller handle the problem.  Deduce what caller will print
by invoking human_readable.
(print_long_format, print_file_name_and_frills): Don't assume
inode number, block count, file size fit in unsigned long.
Use human_readable to do block count conversion and to print
file sizes.
(prep_non_filename_text): Print decimal string for time if
localtime fails due to enormous time_t.
1997-11-30 10:25:16 +00:00
Jim Meyering d08a2b63dc (BITSPERBYTE): Remove.
(UID_T_MAX, GID_T_MAX): Define in terms of TYPE_MAXIMUM.
1997-11-30 10:25:11 +00:00
Jim Meyering 6ed8115087 (<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(LONGEST_HUMAN_READABLE, enum Output_units): Remove.
(count_entry): Now returns uintmax_t, not long.
(human_readable_base): Renamed from opt_human_readable; value is now
zero or positive integer, not just zero or nonzero.
(output_units): Now an integer giving output size.
(tot_size): Now uintmax_t, not long.
(long_options, usage): Add --si or -H.
(main): Adjust to renamed option variables.
Use -H if BLOCKSIZE is SI.  Add -H.
(human_readable): Remove; rewritten and now in lib/human.c.
(print_size): Rewrite in terms of human_readable.
Accept extra arg to be printed after size; all callers changed.
1997-11-30 10:25:07 +00:00
Jim Meyering 76916942ca (<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(LONGEST_HUMAN_READABLE_1K_BYTE_BLOCKS): Remove.
(human_readable_base): Renamed from human_blocks; value is now
zero or positive integer, not just zero or nonzero.
(output_units): New variable;
replaces booleans kilobyte_blocks and megabyte_blocks.
(long_options): Add --si or -H.
(print_header): Adjust to renamed option variables.
(human_readable_1k_blocks): Remove.
(show_dev): Count blocks using uintmax_t, not long.
Calculate percentages using double, not long; this still isn't
perfect as it suffers double rounding, but it's more likely to
round correctly in practice than using long did.
Adjust to renamed option variables.
Use new human_readable library function to format uintmax_t values.
(usage): Add -H, --si.
(main): Adjust to renamed option variables.
Use -H if BLOCKSIZE is SI.  Add -H.
1997-11-30 10:25:02 +00:00
Jim Meyering 72bc3b818f (<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(input_blocksize, output_blocksize, conversion_blocksize):
Now size_t instead of long.  0 means unset.
(skip_records, seek_record, max_records): Now uintmax_t, not long.
(w_partial, w_full, r_partial, r_full, r_truncate):
Now uintmax_t instead of unsigned.
(print_stats): Print counts as uintmax_t, not unsigned.
(main, skip): Check for overflow when computing file offsets.
(skip): Records count arg is uintmax_t, not long; blocksize arg is
size_t, not long.  Try lseek even on non regular files, as per comment.
(oc, col): Now size_t, not int.
(copy): No need to check max_records >= 0 any more, as the
default value is now effectively infinity.
Cast lseek arg to off_t.
(copy, copy_with_block): conversion_blocksize - col can never
be negative now, since it's unsigned, so rewrite loops to
avoid problems with unsigned.
(scanargs): Parse numeric args using uintmax_t, not int.
Check for overflow when converting block size args to size_t.
Blocksize options are now unsigned, and are now 0 when not set yet.
(parse_integer): Return uintmax_t, not int; accept new int * arg
to store error indicator, since all returned values are now valid.
Check for overflow when scanning integer.
1997-11-30 10:24:58 +00:00
Jim Meyering a5fe3a240b (<inttypes.h>): Include if HAVE_INTTYPES_H.
(hash_insert2): Cast inode number to uintmax_t; this prevents
negative remainders if the inode number is negative and ino_t
is longer than unsigned.
1997-11-30 10:24:54 +00:00
Jim Meyering b8c474191a (copy_reg): Store file size as off_t, not long.
Do not assume st_size has been normalized to 512 byte blocks,
or that it fits in size_t after dividing by the blocksize.
1997-11-30 10:24:50 +00:00
Jim Meyering 0f411474da (<limits.h>, UINT_MAX, UINT_MAX): Remove; now
done by system.h.
1997-11-30 10:24:45 +00:00
Jim Meyering dcd4c05dfa (savedir): Check for size zero before invoking
malloc; this can occur if st_size arg overflows on conversion to
unsigned int.  All callers now cast st_size arg to unsigned int.
1997-11-30 10:24:41 +00:00
Jim Meyering 07783bcdf0 (getuidbyname, getgidbyname): Names can now
be NULL in cache.  This change merely fixes ifdeffed-out code.
1997-11-30 10:24:38 +00:00