Commit Graph
6573 Commits
Author SHA1 Message Date
Jim Meyering 7d98d28569 *** empty log message *** 1999-04-21 04:04:20 +00:00
Jim Meyering e441de9acc (jm_AC_TYPE_UINTMAX_T): Move unsigned long
long check into new jm_AC_TYPE_UNSIGNED_LONG_LONG macro.
1999-04-21 04:04:04 +00:00
Jim Meyering 36ca174d81 *** empty log message *** 1999-04-21 04:00:48 +00:00
Jim Meyering 76659f726f Require jm_AC_TYPE_UNSIGNED_LONG_LONG.
Replace xstroull if necessary.
1999-04-21 04:00:38 +00:00
Jim Meyering 42a64ac80e *** empty log message *** 1999-04-21 03:58:57 +00:00
Jim Meyering 6783ad7832 *** empty log message *** 1999-04-21 03:24:54 +00:00
Jim Meyering e8b570e45a update comment 1999-04-21 03:19:26 +00:00
Jim Meyering cf6eaeb03b <xstrtol.h>: Include this, not xstrtoul.h.
<human.h>: Include.
Use uintmax_t in place of unsigned long.
Use human_readable to convert to strings for printing.
1999-04-21 03:18:23 +00:00
Jim Meyering 42ccae28c6 . 1999-04-21 02:30:43 +00:00
Jim Meyering c850864a19 . 1999-04-21 02:29:50 +00:00
Jim Meyering c93a59ac4f . 1999-04-21 02:28:20 +00:00
Jim Meyering abc54153b1 *** empty log message *** 1999-04-21 02:21:57 +00:00
Jim Meyering c4a52014f7 Port to AIX and HP-UX. Support cross-compilation. 1999-04-21 02:21:47 +00:00
Jim Meyering c7a0b8f429 <config.h>: Include first, since it can do
things like #define const, and this must be done before
including any system headers.
1999-04-20 13:26:06 +00:00
Jim Meyering 154588d722 (my_strtoumax): Fix typo in computing
whether overflow occurred.  Improve overflow-detection to use
only one conditional branch total, rather than 2N+1
conditional branches for an N-digit number.
1999-04-20 13:24:14 +00:00
Jim Meyering f9270b650f *** empty log message *** 1999-04-19 14:09:07 +00:00
Jim Meyering 5f724e01b9 *** empty log message *** 1999-04-19 14:06:07 +00:00
Jim Meyering c37f2f6355 (main): Restore `+' in getopt_long string. Otherwise,
commands like `seq 10 -2 0' wouldn't work.  From Andreas Schwab.
1999-04-19 14:05:34 +00:00
Jim Meyering dcf32e94d2 *** empty log message *** 1999-04-19 14:03:17 +00:00
Jim Meyering 3e47e246f8 *** empty log message *** 1999-04-19 05:25:52 +00:00
Jim Meyering d5c056d478 (b_host): Remove /pub suffix. 1999-04-19 05:22:54 +00:00
Jim Meyering da96ede53c *** empty log message *** TEXTUTILS-1_22j 1999-04-19 04:50:25 +00:00
Jim Meyering 6a9f42807f (my-distcheck): Use AMTAR, not TAR. 1999-04-19 04:50:03 +00:00
Jim Meyering 36564cbefd . 1999-04-19 04:45:09 +00:00
Jim Meyering 95836befb3 *** empty log message *** 1999-04-19 04:24:35 +00:00
Jim Meyering 0b8e81aab9 . 1999-04-19 04:20:57 +00:00
Jim Meyering a0119464b8 *** empty log message *** 1999-04-19 02:56:54 +00:00
Jim Meyering 00811477e8 *** empty log message *** 1999-04-19 02:54:53 +00:00
Jim Meyering e144c80776 Require jm_AC_PREREQ_XSTRTOUMAX. 1999-04-19 02:54:48 +00:00
Jim Meyering ac4f985ac9 *** empty log message *** 1999-04-19 02:53:36 +00:00
Jim Meyering 560d7d9dac . 1999-04-19 02:42:58 +00:00
Jim Meyering e7a7a48ee6 . 1999-04-19 02:39:52 +00:00
Jim Meyering 95e8d410ff (tempname): Wrap after 99999 only for length-impaired file systems. 1999-04-19 02:39:09 +00:00
Jim Meyering d3b1ca9174 (main, longopts):
Use -u instead of -R for --remove, so that we can preserve
future compatibility with rm.
1999-04-19 02:15:09 +00:00
Jim Meyering d70fb569fb [!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
(do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
member directly.
1999-04-19 02:13:01 +00:00
Jim Meyering e5e1c6d4fd *** empty log message *** 1999-04-19 00:20:36 +00:00
Jim Meyering d17b6bc300 *** empty log message *** 1999-04-18 23:20:24 +00:00
Jim Meyering 114946fdb0 Include xstrtol.h.
(parse_integer): Migrate most of the work into the new xstrtoumax fn.
1999-04-18 23:18:48 +00:00
Jim Meyering 30edff7a36 Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
xstrto... functions.
1999-04-18 23:18:32 +00:00
Jim Meyering d3ffbea816 Include xstrtol.h, not obsolete file xstrtoul.h. 1999-04-18 23:18:09 +00:00
Jim Meyering cc7d631369 <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
(LookupWord, yylex): Don't pass negative char to ctype macros.
1999-04-18 23:17:30 +00:00
Jim Meyering 4e8d80cad7 (xalloc_fail): Pass xalloc_msg_memory_exhausted through gettext. 1999-04-18 23:17:05 +00:00
Jim Meyering a1d8c38553 (libfu_a_SOURCES): Add xstrtoumax.c.
(noinst_HEADERS): Remove xstrtoul.h.
1999-04-18 23:16:49 +00:00
Jim Meyering 0501984933 (__xstrtol, __strtol, __unsigned): Remove macro decls.
<inttypes.h>: Include if HAVE_INTTYPES_H.
(_DECLARE_XSTRTOL): New macro.
(xstrtol, xstrtoul, xstrtoumax): Declare all three functions, so that
we need only one include file, not three.
(_STRTOL_ERROR): Do not undef, as this is no longer needed.
Reword overflow message so that it's independent of type.
1999-04-18 23:16:23 +00:00
Jim Meyering f8474e2421 (__strtol, __strtol_t, __xstrtol):
New macros to specify the
underlying function, its returned type, and our function.  Default to
values suitable for xstrtol.

Include <ctype.h>, since we use its macros.

(ULONG_MAX, LONG_MAX, ISBLANK): Remove: no longer needed.
(ISSPACE): New macro.

(bkm_scale, bkm_scale_by_power, __xstrtol, main): __unsigned long int
-> __strtol_t.

(__xstrtol): Depend on whether __strtol_t is an unsigned type, not on
whether STRING_TO_UNSIGNED is defined.  Skip isspace chars, not
isblank chars, to match strtol.  When returning
LONGINT_INVALID_SUFFIX_CHAR, store the value that we computed into
*val.
1999-04-18 23:15:34 +00:00
Jim Meyering ddd5fa0ce5 (STRING_TO_UNSIGNED): Remove.
(__strtol, __strtol_t, __xstrtol): New macros.
1999-04-18 23:15:02 +00:00
Jim Meyering a7a7424b8b Include xstrtol.h, not obsolete file xstrtoul.h.
"human.h", "xalloc.h": Include.
(attribute): Remove; no longer needed.
(xstrdup): New decl.
(STDOUT_FILENO): New macro.
(O_NOCTTY): Make sure it's always defined, even if HAVE_CONFIG_H.

The following changes have effect only if !HAVE_CONFIG_H.
<ctype.h>: New include.
(RETSIGTYPE): Remove bogus semicolon at end.
(STDOUT_FILENO, uintmax_t, human_readable, LONGEST_HUMAN_READABLE):
New macros.
(xstrtoumax): Renamed from xstrtoul, with corresponding type changes.
Handle suffixes like the real routine does.
(error): Remove bogus assignment of errno to errnum.
(xmalloc, xstrdup): New functions.

(O_NOCTTY): Define even if !HAVE_CONFIG_H.
(S_ISFIFO, S_ISSOCK): New macros, if not already defined.
(OUTPUT_BLOCK_SIZE): New macro.
(struct Options.verbose): Now a boolean, since we no longer have two
levels of verbosity.
(long_opts, usage, main): Remove -D or --device option.  Invert -p or
--preserve option, and rename it to -R or --remove.
(usage): Describe G suffix.
(usage): "-" no longer conflicts with -v.
(UCHAR_MAX): Indent `#error' so that SunOS 4.1.4 cc doesn't reject it.
(ind): Portability fixes: return word32, not unsigned; multiply by
sizeof (word32) instead of shifting left by 2.
(isaac_refill, isaac_mix): Comment out size of array parameter, as
ansi2knr mishandles this.
(status_visible, status_pos, pfstatus, flushstatus): Remove, since
pfstatus isn't portable to users with varying width fonts, or
internationalized messages, and vfprintf is problematic.  All callers
of pfstatus changed to use error instead; this removes incompatibility
of -v with -.  All calls to flushstatus removed.
(dopass, do_wipefd): Do not translate non-English msgs with gettext.

(dopass): Cast lseek constant arguments to (off_t) for benefit
of pre-ANSI compilers; fix one lseek call whose args were interchanged.
Remove unnecessary casts to (off_t).  Do not check for EIO
when determining file size; this was just my earlier wild guess.
Use human_readable to print off_t, instead of casting to unsigned long
(which doesn't work in Solaris 2.6, where off_t is longer than long).
Output human-readable sizes, instead of always using "K".
Check for offset overflow (it happened to me in SunOS 4.1.4).
(do_wipefd): Do not insist on regular files, but do check for special
files that cannot possibly be shredded.
Use xmalloc instead of malloc + check.
Do not inspect st_size for non-regular files.
Try to find the size of a non-regular file by seeking to its end.
Do not assume that a regular file of size-0 has unknown size.
Check for regular files with negative sizes,
and for overflow after rounding to next block.
Always try to truncate, even for special files, but do not report an
error if truncation fails on a special file.

(dopass, wipefile): Do not return 1 for special files; the caller
doesn't care any more.

(wipefd): Remove unnecessary (and nonportable) check for
whether the file descriptor is read-only.  Remove
no-longer-needed check for `-v -'.

(incname): Return 1 for carry bit, like the documentation says.

(wipename, wipefile): Accept new argument, specifying the
quoted file name.  All callers changed.

(wipename): Use xstrdup instead of strdup+error check.

(wipefile): Check for ENOTDIR when opening /dev/fd/NNN. Check for
errors in NNN more carefully. Restore errno after the check.
Check for errors when closing the file descriptor.
Use more consistent wording when unable to remove a file.

(main): Do not remove files by default.
Use xstrtoumax instead of xstrtoul uniformly, since xstrtoul won't
exist if !HAVE_CONFIG_H.
In diagnostics, quote invalid operands to -n and -s options.
Allow T, P, E, Z, and Y suffixes in -s operand.
flags.verbose is now a boolean, not a counter.
Use STDOUT_FILENO instead of 1, for clarity.
1999-04-18 23:13:57 +00:00
Jim Meyering 69b1c4026c (tempname): Add a FIXME comment. 1999-04-18 15:57:19 +00:00
Jim Meyering 0fe4e6b443 (NAME_MAX_IN_DIR): Rename from PATH_MAX_IN_DIR. Use _POSIX_NAME_MAX,
not _POSIX_PATH_MAX.  Guard with #if HAVE_PATHCONF rather than
#if HAVE_UNISTD_H.
1999-04-18 15:44:03 +00:00
Jim Meyering 8cee2c6772 Rename global: s/temp_file_prefix/temp_dir/. 1999-04-18 14:40:20 +00:00