Jim Meyering [Mon, 19 Apr 1999 02:42:58 +0000 (02:42 +0000)]
.
Jim Meyering [Mon, 19 Apr 1999 02:39:52 +0000 (02:39 +0000)]
.
Jim Meyering [Mon, 19 Apr 1999 02:39:09 +0000 (02:39 +0000)]
(tempname): Wrap after 99999 only for length-impaired file systems.
Jim Meyering [Mon, 19 Apr 1999 02:15:09 +0000 (02:15 +0000)]
(main, longopts):
Use -u instead of -R for --remove, so that we can preserve
future compatibility with rm.
Jim Meyering [Mon, 19 Apr 1999 02:13:01 +0000 (02:13 +0000)]
[!HAVE_CONFIG_H] (ST_BLKSIZE): Define to 65536.
(do_wipefd): Use ST_BLKSIZE instead of referring to the st_blksize
member directly.
Jim Meyering [Mon, 19 Apr 1999 00:20:36 +0000 (00:20 +0000)]
*** empty log message ***
Jim Meyering [Sun, 18 Apr 1999 23:20:24 +0000 (23:20 +0000)]
*** empty log message ***
Jim Meyering [Sun, 18 Apr 1999 23:18:48 +0000 (23:18 +0000)]
Include xstrtol.h.
(parse_integer): Migrate most of the work into the new xstrtoumax fn.
Jim Meyering [Sun, 18 Apr 1999 23:18:32 +0000 (23:18 +0000)]
Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
xstrto... functions.
Jim Meyering [Sun, 18 Apr 1999 23:18:09 +0000 (23:18 +0000)]
Include xstrtol.h, not obsolete file xstrtoul.h.
Jim Meyering [Sun, 18 Apr 1999 23:17:30 +0000 (23:17 +0000)]
<stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
(LookupWord, yylex): Don't pass negative char to ctype macros.
Jim Meyering [Sun, 18 Apr 1999 23:17:05 +0000 (23:17 +0000)]
(xalloc_fail): Pass xalloc_msg_memory_exhausted through gettext.
Jim Meyering [Sun, 18 Apr 1999 23:16:49 +0000 (23:16 +0000)]
(libfu_a_SOURCES): Add xstrtoumax.c.
(noinst_HEADERS): Remove xstrtoul.h.
Jim Meyering [Sun, 18 Apr 1999 23:16:23 +0000 (23:16 +0000)]
(__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.
Jim Meyering [Sun, 18 Apr 1999 23:15:34 +0000 (23:15 +0000)]
(__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.
Jim Meyering [Sun, 18 Apr 1999 23:15:02 +0000 (23:15 +0000)]
(STRING_TO_UNSIGNED): Remove.
(__strtol, __strtol_t, __xstrtol): New macros.
Jim Meyering [Sun, 18 Apr 1999 23:13:57 +0000 (23:13 +0000)]
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.
Jim Meyering [Sun, 18 Apr 1999 15:57:19 +0000 (15:57 +0000)]
(tempname): Add a FIXME comment.
Jim Meyering [Sun, 18 Apr 1999 15:44:03 +0000 (15:44 +0000)]
(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.
Jim Meyering [Sun, 18 Apr 1999 14:40:20 +0000 (14:40 +0000)]
Rename global: s/temp_file_prefix/temp_dir/.
Jim Meyering [Sun, 18 Apr 1999 14:38:24 +0000 (14:38 +0000)]
(usage): s/DIRECT/DIRECTORY/g
Jim Meyering [Sun, 18 Apr 1999 13:32:44 +0000 (13:32 +0000)]
*** empty log message ***
Jim Meyering [Sun, 18 Apr 1999 13:32:35 +0000 (13:32 +0000)]
(main): Open the output file with *read* access
only if we might need to read to satisfy a `seek=' request.
From Matthias Urlichs.
Jim Meyering [Sun, 18 Apr 1999 13:31:34 +0000 (13:31 +0000)]
*** empty log message ***
Jim Meyering [Sun, 18 Apr 1999 03:25:23 +0000 (03:25 +0000)]
*** empty log message ***
Jim Meyering [Sun, 18 Apr 1999 02:16:56 +0000 (02:16 +0000)]
.
Jim Meyering [Sat, 17 Apr 1999 14:41:38 +0000 (14:41 +0000)]
*** empty log message ***
Jim Meyering [Sat, 17 Apr 1999 11:56:21 +0000 (11:56 +0000)]
*** empty log message ***
Jim Meyering [Sat, 17 Apr 1999 11:50:03 +0000 (11:50 +0000)]
(file_lines): Fix serious bug introduced with last changes.
From Andreas Schwab.
Jim Meyering [Thu, 15 Apr 1999 14:09:04 +0000 (14:09 +0000)]
.
Jim Meyering [Thu, 15 Apr 1999 14:03:06 +0000 (14:03 +0000)]
*** empty log message ***
Jim Meyering [Thu, 15 Apr 1999 13:59:14 +0000 (13:59 +0000)]
rename .posix-warn to .env-warn
Jim Meyering [Thu, 15 Apr 1999 13:49:45 +0000 (13:49 +0000)]
.
Jim Meyering [Thu, 15 Apr 1999 13:49:13 +0000 (13:49 +0000)]
Add comments.
(init_header): Tweak white space in Date/Time header.
Jim Meyering [Thu, 15 Apr 1999 13:26:50 +0000 (13:26 +0000)]
new tests from Roland
Jim Meyering [Thu, 15 Apr 1999 13:26:44 +0000 (13:26 +0000)]
Updated tests.
From Roland Huebner.
Jim Meyering [Thu, 15 Apr 1999 12:45:57 +0000 (12:45 +0000)]
.
Jim Meyering [Wed, 14 Apr 1999 03:12:27 +0000 (03:12 +0000)]
*** empty log message ***
Jim Meyering [Tue, 13 Apr 1999 14:44:33 +0000 (14:44 +0000)]
new version via automake
Jim Meyering [Tue, 13 Apr 1999 02:57:40 +0000 (02:57 +0000)]
*** empty log message ***
Jim Meyering [Tue, 13 Apr 1999 01:11:46 +0000 (01:11 +0000)]
(main): Declare out_dev to be of type dev_t, not `int'.
Declare out_ino to be of type ino_t, not `int'.
Jim Meyering [Tue, 13 Apr 1999 01:09:15 +0000 (01:09 +0000)]
* src/od.c (MIN, MAX): Remove definitions.
* src/sys2.h (MIN, MAX): Define here instead.
Jim Meyering [Mon, 12 Apr 1999 04:28:05 +0000 (04:28 +0000)]
.
Jim Meyering [Mon, 12 Apr 1999 04:27:46 +0000 (04:27 +0000)]
(test_vector): Disable all tests while I wait for an updated suite.
Jim Meyering [Mon, 12 Apr 1999 04:00:10 +0000 (04:00 +0000)]
*** empty log message ***
Jim Meyering [Mon, 12 Apr 1999 03:54:57 +0000 (03:54 +0000)]
*** empty log message ***
Jim Meyering [Mon, 12 Apr 1999 03:47:40 +0000 (03:47 +0000)]
.
Jim Meyering [Mon, 12 Apr 1999 03:47:17 +0000 (03:47 +0000)]
.
Jim Meyering [Mon, 12 Apr 1999 03:22:24 +0000 (03:22 +0000)]
(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.
Jim Meyering [Sun, 11 Apr 1999 17:59:28 +0000 (17:59 +0000)]
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.
Jim Meyering [Sun, 11 Apr 1999 13:26:42 +0000 (13:26 +0000)]
*** empty log message ***
Jim Meyering [Sun, 11 Apr 1999 13:25:52 +0000 (13:25 +0000)]
(readtoken, readtokens): Protoize.
Jim Meyering [Sun, 11 Apr 1999 03:42:21 +0000 (03:42 +0000)]
(xwrite): Use STDOUT_FILENO instead of literal `1'.
Jim Meyering [Sun, 11 Apr 1999 03:24:12 +0000 (03:24 +0000)]
*** empty log message ***
Jim Meyering [Sun, 11 Apr 1999 03:24:04 +0000 (03:24 +0000)]
(alpha): Add trailing slash for ncftp.
Jim Meyering [Sun, 11 Apr 1999 02:19:51 +0000 (02:19 +0000)]
*** empty log message ***
Jim Meyering [Sun, 11 Apr 1999 02:17:48 +0000 (02:17 +0000)]
.
Jim Meyering [Sun, 11 Apr 1999 02:17:20 +0000 (02:17 +0000)]
.
Jim Meyering [Sun, 11 Apr 1999 02:15:26 +0000 (02:15 +0000)]
*** empty log message ***
Jim Meyering [Sun, 11 Apr 1999 01:45:44 +0000 (01:45 +0000)]
*** empty log message ***
Jim Meyering [Sun, 11 Apr 1999 01:44:26 +0000 (01:44 +0000)]
*** empty log message ***
Jim Meyering [Sun, 11 Apr 1999 01:43:34 +0000 (01:43 +0000)]
`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.
Jim Meyering [Sun, 11 Apr 1999 01:35:01 +0000 (01:35 +0000)]
*** empty log message ***
Jim Meyering [Sun, 11 Apr 1999 01:32:28 +0000 (01:32 +0000)]
(scanargs): Fix bug introduced with last change: now that
the loop is gone, manually decrement argc and increment argv.
Jim Meyering [Thu, 8 Apr 1999 13:44:31 +0000 (13:44 +0000)]
*** empty log message ***
Jim Meyering [Thu, 8 Apr 1999 13:44:19 +0000 (13:44 +0000)]
(Options for date): Document --iso-8601
Jim Meyering [Thu, 8 Apr 1999 13:44:00 +0000 (13:44 +0000)]
Accept new option: --iso-8601.
Jim Meyering [Wed, 7 Apr 1999 17:43:47 +0000 (17:43 +0000)]
*** empty log message ***
Jim Meyering [Wed, 7 Apr 1999 17:43:36 +0000 (17:43 +0000)]
(difftm): Protoize.
Jim Meyering [Wed, 7 Apr 1999 17:43:12 +0000 (17:43 +0000)]
.
Jim Meyering [Wed, 7 Apr 1999 17:41:57 +0000 (17:41 +0000)]
.
Jim Meyering [Wed, 7 Apr 1999 12:53:22 +0000 (12:53 +0000)]
*** empty log message ***
Jim Meyering [Tue, 6 Apr 1999 17:26:07 +0000 (17:26 +0000)]
split long line
Jim Meyering [Tue, 6 Apr 1999 14:22:06 +0000 (14:22 +0000)]
Update from master source in libc, removing %f.
Jim Meyering [Tue, 6 Apr 1999 14:15:04 +0000 (14:15 +0000)]
*** empty log message ***
Jim Meyering [Tue, 6 Apr 1999 14:14:58 +0000 (14:14 +0000)]
Remove test for %f.
Jim Meyering [Mon, 5 Apr 1999 03:51:33 +0000 (03:51 +0000)]
*** empty log message ***
Jim Meyering [Mon, 5 Apr 1999 03:51:17 +0000 (03:51 +0000)]
Comment out the test added on 1999-01-31.
Jim Meyering [Mon, 5 Apr 1999 02:00:03 +0000 (02:00 +0000)]
(url_dir_list): Define properly.
(real_dir_list): Likewise.
Jim Meyering [Sun, 4 Apr 1999 23:15:20 +0000 (23:15 +0000)]
*** empty log message ***
Jim Meyering [Sun, 4 Apr 1999 23:15:07 +0000 (23:15 +0000)]
Don't include string.h.
[!HAVE_CONFIG_H]: Include string.h here.
[!HAVE_CONFIG_H]: Hard-code RETSIGTYPE to `int'.
(sigill_handler): Change return type and type of local `oldhandler' to
RETSIGTYPE.
(isaac_seed_machdep): Change and type of local `oldhandler' to
RETSIGTYPE.
Jim Meyering [Sun, 4 Apr 1999 21:07:25 +0000 (21:07 +0000)]
use dquotes, not squotes
Jim Meyering [Sun, 4 Apr 1999 20:54:30 +0000 (20:54 +0000)]
*** empty log message ***
Jim Meyering [Sun, 4 Apr 1999 16:02:28 +0000 (16:02 +0000)]
*** empty log message ***
Jim Meyering [Sun, 4 Apr 1999 16:00:50 +0000 (16:00 +0000)]
Change the sed command used to extract the
filename from ls -l output, to accommodate the change in format.
Jim Meyering [Sun, 4 Apr 1999 15:46:31 +0000 (15:46 +0000)]
Add case_GETOPT_* cases.
Jim Meyering [Sun, 4 Apr 1999 15:44:58 +0000 (15:44 +0000)]
*** empty log message ***
Jim Meyering [Sun, 4 Apr 1999 15:44:26 +0000 (15:44 +0000)]
Standardize --help and --version processing.
Jim Meyering [Sun, 4 Apr 1999 14:44:45 +0000 (14:44 +0000)]
define/use AUTHORS
Jim Meyering [Sun, 4 Apr 1999 14:43:27 +0000 (14:43 +0000)]
*** empty log message ***
Jim Meyering [Sun, 4 Apr 1999 14:41:43 +0000 (14:41 +0000)]
(print_long_format): Add a space between %s and %3u. This
assures that even when modebuf has the trailing `+' and there are more
than 99 hard links to a file, the permissions string and the link count
will be separated.
Jim Meyering [Sun, 4 Apr 1999 14:33:18 +0000 (14:33 +0000)]
import latest
Jim Meyering [Sun, 4 Apr 1999 14:32:58 +0000 (14:32 +0000)]
(S_IWUSR): Define if not already defined.
Jim Meyering [Sun, 4 Apr 1999 14:30:44 +0000 (14:30 +0000)]
.
Jim Meyering [Sun, 4 Apr 1999 14:30:30 +0000 (14:30 +0000)]
fix comments
add FIXME
Jim Meyering [Sun, 4 Apr 1999 04:54:34 +0000 (04:54 +0000)]
(dopass): add curly braces to avoid warning about ambiguous `else'.
(wipefd): Add parentheses suggested by gcc.
(do_wipefd): Remove declaration of unused local.
Jim Meyering [Sun, 4 Apr 1999 04:37:39 +0000 (04:37 +0000)]
[!HAVE_CONFIG_H] (xstrtoul, error, close_stdout): Added stubs
to allow standalone compilation.
(wipefile): Added support for emulating /dev/fd/# files even if
the OS doesn't support them. From Paul Eggert.
(main, usage): Changed --device short option to -D.
(wipefd, do_wipefd): Renamed function to do_wipefd and added
separate wipefd that performs sanity checks on externally-opened file
descriptors, such as not append-only. From Paul Eggert.
(do_wipefd, isaac_seedfd): Do not read file for any reason.
if the file is low-entropy, it's a security hole.
(wipefile) Changed to open O_WRONLY and chmod to write-only when
forcing.
(isaac_seedfd) Function deleted as unnecessary.
From Paul Eggert.
(dopass): Dynamically fall back to fsync() if fdatasync() fails,
since POSIX, in their infinitesimal wisdom, encourage implementations
that return constant -1, making compile-time testing useless.
From Paul Eggert.
(dopass): Changed to support a size of -1 to mean "unknown".
This entailed changing to a counting-up offset rather than couting-down
cursize for the central state variable. Also changed size argument to
be call-by-reference so that it can be passed back once known.
(sizer) Function deleted as unnecessary.
(wipefd): Changed to match. From Paul Eggert
(dopass): Try to skip over bad blocks in destination files.
Also added ftruncate() for more complete destruction of metadata.
(main, usage): Changed "-" to stand for standard output.
(wipefd): Added error message to detect conflict with -v.
(dopass): Added periodic fsync() calls to keep the pass progress
display in sync with reality. Hopefully they're sufficiently far spaced
that throughput isn't affected. It might be a good thing to do even in
non-verbose mode, to avoid filling up the kernel caches with dirty data.
Also added ftruncate() for more complete destruction of metadata.
(quotearg_colon): New function to print
pathological filenames properly.
[!HAVE_CONFIG_H] (quotearg_colon_buf) New internal helper function
that does most of the work.
(wipefd, do_wipefd, dopass) Now take a qname (pre-quoted name) argument.
(wipename, wipefile, main) Changed diagnostics to use quotearg_colon.
Error messages are also in a more uniform format.
From Paul Eggert.
(struct Options, main, do_wipefd): Added -s/--size=N flag.
(xstrtoul): Added support for valid_suffixes to help this.
(usage) Documented it.
(error): Changed some arguments from N_() to _(), since error()
does not translate its argument. I think this is a bug.
(struct Options do_wipefd, wipefd, wipefile, main): moved passes
argument into the Options structure as n_iterations, which is now a
size_t. From Paul Eggert.
(isaac_seed_start, isaac_seed_data, isaac_seed_finish): New functions
to manage seeding of RNG with arbitrary-sized data.
(isaac_init): commented out as dead code.
(isaac_seed): changed to use new functions to prevent any possibility of
a buffer overflow.
(isaac_seed): Added support for Solaris' gethrtime()
configure.in: Corresponding feature test. From Paul Eggert.
(wipename): Change remove() to unlink() for speed & portability.
Use lstat() instead of access() to see if a filename is taken. This
works even on dangling symlinks and avoids the suid problems of
access(2). From Paul Eggert.
(isaac_seed_machdep): New function for reading cycle counters
Jim Meyering [Sun, 4 Apr 1999 04:34:16 +0000 (04:34 +0000)]
*** empty log message ***
Jim Meyering [Sun, 4 Apr 1999 02:34:49 +0000 (02:34 +0000)]
back out Paul's changes
Jim Meyering [Sat, 3 Apr 1999 05:26:48 +0000 (05:26 +0000)]
Use AUTHORS in place of string in parse_long_options call.