Commit Graph
6528 Commits
Author SHA1 Message Date
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
Jim Meyering eb4109b66e (usage): s/DIRECT/DIRECTORY/g 1999-04-18 14:38:24 +00:00
Jim Meyering e0cbae44cd *** empty log message *** 1999-04-18 13:32:44 +00:00
Jim Meyering 8f913cc64f (main): Open the output file with *read* access
only if we might need to read to satisfy a `seek=' request.
From Matthias Urlichs.
1999-04-18 13:32:35 +00:00
Jim Meyering 64dec9fafb *** empty log message *** 1999-04-18 13:31:34 +00:00
Jim Meyering a625377e8c *** empty log message *** 1999-04-18 03:25:23 +00:00
Jim Meyering c5027d831c . 1999-04-18 02:16:56 +00:00
Jim Meyering f4143898b2 *** empty log message *** 1999-04-17 14:41:38 +00:00
Jim Meyering 5101382ec6 *** empty log message *** 1999-04-17 11:56:21 +00:00
Jim Meyering dd886e9690 (file_lines): Fix serious bug introduced with last changes.
From Andreas Schwab.
1999-04-17 11:50:03 +00:00
Jim Meyering 6a821331eb . 1999-04-15 14:09:04 +00:00
Jim Meyering d679966505 *** empty log message *** 1999-04-15 14:03:06 +00:00
Jim Meyering f01319465c rename .posix-warn to .env-warn 1999-04-15 13:59:14 +00:00
Jim Meyering 1dbd1aff6f . 1999-04-15 13:49:45 +00:00
Jim Meyering 69e1d626bd Add comments.
(init_header): Tweak white space in Date/Time header.
1999-04-15 13:49:13 +00:00
Jim Meyering 609582a161 new tests from Roland 1999-04-15 13:26:50 +00:00
Jim Meyering bc95e393d8 Updated tests.
From Roland Huebner.
1999-04-15 13:26:44 +00:00
Jim Meyering 379dcf4c48 . 1999-04-15 12:45:57 +00:00
Jim Meyering ffd4e9684a *** empty log message *** 1999-04-14 03:12:27 +00:00
Jim Meyering 809b33b2ff new version via automake 1999-04-13 14:44:33 +00:00
Jim Meyering 2a8c4e283e *** empty log message *** 1999-04-13 02:57:40 +00:00
Jim Meyering e6bc0dccbc (main): Declare out_dev to be of type dev_t, not `int'.
Declare out_ino to be of type ino_t, not `int'.
1999-04-13 01:11:46 +00:00
Jim Meyering b6d265e347 * src/od.c (MIN, MAX): Remove definitions.
* src/sys2.h (MIN, MAX): Define here instead.
1999-04-13 01:09:15 +00:00
Jim Meyering 4de61e5f98 . TEXTUTILS-1_22i 1999-04-12 04:28:05 +00:00
Jim Meyering 1f6f06f7de (test_vector): Disable all tests while I wait for an updated suite. 1999-04-12 04:27:46 +00:00
Jim Meyering 69d1c5772e *** empty log message *** 1999-04-12 04:00:10 +00:00
Jim Meyering d577eef9e4 *** empty log message *** 1999-04-12 03:54:57 +00:00
Jim Meyering a36f86a13e . 1999-04-12 03:47:40 +00:00
Jim Meyering 924b7e2291 . 1999-04-12 03:47:17 +00:00
Jim Meyering 2e2161c97a (COPY_TO_EOF): Define.
(dump_remainder): Add parameter, n_bytes, and rewrite to use it.
Update callers.
(file_lines): Rename parameter.
(tail_bytes): Remove obsolete comment.
1999-04-12 03:22:24 +00:00
Jim Meyering f3df8336ae Fix the problem whereby `yes > k & tail -1 k' would infloop.
(dump_remainder): Move this function to precede the new use in file_lines.
(tail_lines): Don't call dump_remainder here.
(file_lines): Call dump_remainder here instead.
1999-04-11 17:59:28 +00:00
Jim Meyering a66cc3009b *** empty log message *** 1999-04-11 13:26:42 +00:00
Jim Meyering cf3d3f1e6e (readtoken, readtokens): Protoize. 1999-04-11 13:25:52 +00:00
Jim Meyering 832dfa7e1f (xwrite): Use STDOUT_FILENO instead of literal `1'. 1999-04-11 03:42:21 +00:00
Jim Meyering 35af2e8613 *** empty log message *** 1999-04-11 03:24:12 +00:00
Jim Meyering de9d4e9f91 (alpha): Add trailing slash for ncftp. 1999-04-11 03:24:04 +00:00
Jim Meyering fb059dc67c *** empty log message *** FILEUTILS-4_0f 1999-04-11 02:19:51 +00:00
Jim Meyering 12562e897d . 1999-04-11 02:17:48 +00:00
Jim Meyering cc40ff77a8 . 1999-04-11 02:17:20 +00:00
Jim Meyering 294b139566 *** empty log message *** 1999-04-11 02:15:26 +00:00
Jim Meyering 54047adacd *** empty log message *** 1999-04-11 01:45:44 +00:00
Jim Meyering 4d062fbe6d *** empty log message *** 1999-04-11 01:44:26 +00:00
Jim Meyering 23dfcdb368 `ls --color' would segfault
Include assert.h.
(color_indicator[]): Add an entry for the type, `door.'
(main): Assert that the lengths of the color_indicator and
indicator_name arrays are appropriately related.
1999-04-11 01:43:34 +00:00
Jim Meyering e6a9ce41b6 *** empty log message *** 1999-04-11 01:35:01 +00:00
Jim Meyering 03e24361ee (scanargs): Fix bug introduced with last change: now that
the loop is gone, manually decrement argc and increment argv.
1999-04-11 01:32:28 +00:00
Jim Meyering 24c8bc7107 *** empty log message *** 1999-04-08 13:44:31 +00:00