platform/upstream/coreutils.git
21 years ago(main): Handle argc < optind.
Jim Meyering [Sat, 10 May 2003 14:33:24 +0000 (14:33 +0000)]
(main): Handle argc < optind.

21 years agoadd semicolon
Jim Meyering [Sat, 10 May 2003 14:19:44 +0000 (14:19 +0000)]
add semicolon

21 years ago(main): When failing due to too few arguments, also say
Jim Meyering [Sat, 10 May 2003 14:17:46 +0000 (14:17 +0000)]
(main): When failing due to too few arguments, also say
that rather than just "Try `uname --help' for more information.".

21 years ago*** empty log message ***
Jim Meyering [Sat, 10 May 2003 14:14:51 +0000 (14:14 +0000)]
*** empty log message ***

21 years ago(main): When failing due to unaccepted arguments,
Jim Meyering [Sat, 10 May 2003 13:47:38 +0000 (13:47 +0000)]
(main): When failing due to unaccepted arguments,
also say `too many arguments' rather than just `Try `uname --help'
for more information.'.

21 years ago(main): Handle argc < optind.
Jim Meyering [Sat, 10 May 2003 13:42:48 +0000 (13:42 +0000)]
(main): Handle argc < optind.

21 years ago(main): Don't segfault when argc < optind.
Jim Meyering [Sat, 10 May 2003 13:39:05 +0000 (13:39 +0000)]
(main): Don't segfault when argc < optind.

21 years ago(main): Use error, rather than fprintf, for the sake of consistency.
Jim Meyering [Sat, 10 May 2003 13:36:50 +0000 (13:36 +0000)]
(main): Use error, rather than fprintf, for the sake of consistency.

21 years ago(main): Test for the case of no arguments before computing n_files.
Jim Meyering [Sat, 10 May 2003 13:30:26 +0000 (13:30 +0000)]
(main): Test for the case of no arguments before computing n_files.

21 years ago(main): Test for `missing argument' before computing n_files.
Jim Meyering [Sat, 10 May 2003 13:25:41 +0000 (13:25 +0000)]
(main): Test for `missing argument' before computing n_files.

21 years agoInclude error.h.
Jim Meyering [Sat, 10 May 2003 10:41:14 +0000 (10:41 +0000)]
Include error.h.

21 years ago(More details about version sort): Note that strverscmp, and hence
Jim Meyering [Sat, 10 May 2003 09:42:14 +0000 (09:42 +0000)]
(More details about version sort): Note that strverscmp, and hence
`ls -v', does not use LC_COLLATE.

21 years ago*** empty log message ***
Jim Meyering [Sat, 10 May 2003 09:41:50 +0000 (09:41 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sat, 10 May 2003 06:27:08 +0000 (06:27 +0000)]
*** empty log message ***

21 years ago(Exit status): Remove `uniq' from the list. It uses standard exit codes.
Jim Meyering [Sat, 10 May 2003 06:27:04 +0000 (06:27 +0000)]
(Exit status): Remove `uniq' from the list.  It uses standard exit codes.

21 years ago(main): Don't overrun array bound if argc is 0.
Jim Meyering [Fri, 9 May 2003 22:25:12 +0000 (22:25 +0000)]
(main): Don't overrun array bound if argc is 0.

21 years agofix off-by-one error in last change
Jim Meyering [Fri, 9 May 2003 22:16:22 +0000 (22:16 +0000)]
fix off-by-one error in last change

21 years ago*** empty log message ***
Jim Meyering [Fri, 9 May 2003 08:50:44 +0000 (08:50 +0000)]
*** empty log message ***

21 years ago(main): Don't overrun array bound if argc is 0.
Jim Meyering [Fri, 9 May 2003 08:50:37 +0000 (08:50 +0000)]
(main): Don't overrun array bound if argc is 0.
That would happen when invoked via: execl ("/usr/bin/sort", NULL);

21 years ago*** empty log message ***
Jim Meyering [Fri, 9 May 2003 08:49:46 +0000 (08:49 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Thu, 8 May 2003 09:26:42 +0000 (09:26 +0000)]
*** empty log message ***

21 years ago(timespec_subtract): Don't modify the 2nd arg.
Jim Meyering [Thu, 8 May 2003 09:26:34 +0000 (09:26 +0000)]
(timespec_subtract): Don't modify the 2nd arg.
Work even if X-Y overflows when subtracting.  Make explicit the
assumption that tv_nsec must be in range.
(clock_get_realtime): Remove.  All callers changed to invoke gettime,
for simplicity.
(xnanosleep): Check for gettime failure every time.

21 years ago(clock_get_realtime): Use gettime.c's gettime function,
Jim Meyering [Thu, 8 May 2003 06:26:00 +0000 (06:26 +0000)]
(clock_get_realtime): Use gettime.c's gettime function,
rather than an inferior, open-coded version that would fail on
AIX systems due to clock_gettime failing with errno == ENOSYS.

21 years ago*** empty log message ***
Jim Meyering [Wed, 7 May 2003 16:21:56 +0000 (16:21 +0000)]
*** empty log message ***

21 years agoImplement support so that `head --lines=-N' works on seekable files.
Jim Meyering [Wed, 7 May 2003 16:21:52 +0000 (16:21 +0000)]
Implement support so that `head --lines=-N' works on seekable files.

(enum Copy_fd_status): Define.
(COPY_FD_DIAGNOSE): New macro.
(elide_tail_lines_seekable): New funtion.
(elide_tail_lines_file): Call it here.

21 years ago*** empty log message ***
Jim Meyering [Wed, 7 May 2003 07:25:08 +0000 (07:25 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Tue, 6 May 2003 22:22:06 +0000 (22:22 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Tue, 6 May 2003 13:33:26 +0000 (13:33 +0000)]
*** empty log message ***

21 years ago(CHAR_BIT): Remove duplicate definition.
Jim Meyering [Tue, 6 May 2003 13:33:12 +0000 (13:33 +0000)]
(CHAR_BIT): Remove duplicate definition.

21 years ago*** empty log message ***
Jim Meyering [Tue, 6 May 2003 08:51:30 +0000 (08:51 +0000)]
*** empty log message ***

21 years ago(GL_FUNC_GETCWD_PATH_MAX): Check for the
Jim Meyering [Tue, 6 May 2003 08:51:26 +0000 (08:51 +0000)]
(GL_FUNC_GETCWD_PATH_MAX): Check for the
declaration of getcwd *before* checking for the getcwd kernel bug.
Otherwise, configure-time `checking ...' messages would be intermixed.

21 years ago*** empty log message ***
Jim Meyering [Mon, 5 May 2003 07:55:18 +0000 (07:55 +0000)]
*** empty log message ***

21 years ago(struct dummy): Ensure that at least the number of
Jim Meyering [Mon, 5 May 2003 07:54:19 +0000 (07:54 +0000)]
(struct dummy): Ensure that at least the number of
initializers matches the number of members in the corresponding enum.

21 years ago(enum Ftw_option): Name this previously-anonymous enum.
Jim Meyering [Mon, 5 May 2003 07:52:26 +0000 (07:52 +0000)]
(enum Ftw_option): Name this previously-anonymous enum.
(enum Ftw_option) [FTW_N_MEMBERS]: New member.

21 years agoAvoid array overrun.
Jim Meyering [Mon, 5 May 2003 07:31:49 +0000 (07:31 +0000)]
Avoid array overrun.
(nftw_arr): Update to reflect complete list of members.
(ftw_arr): Likewise

21 years ago*** empty log message ***
Jim Meyering [Mon, 5 May 2003 07:30:45 +0000 (07:30 +0000)]
*** empty log message ***

21 years ago.
Jim Meyering [Sun, 4 May 2003 14:07:26 +0000 (14:07 +0000)]
.

21 years ago.
Jim Meyering [Sun, 4 May 2003 14:07:07 +0000 (14:07 +0000)]
.

21 years agoRemove tests of --bytes=-N; using that framework
Jim Meyering [Sun, 4 May 2003 14:06:52 +0000 (14:06 +0000)]
Remove tests of --bytes=-N; using that framework
caused the addition of thousands of small files to the tar archive.

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 14:01:02 +0000 (14:01 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 13:56:47 +0000 (13:56 +0000)]
*** empty log message ***

21 years ago(TESTS): Add head-elide-tail.
Jim Meyering [Sun, 4 May 2003 13:56:43 +0000 (13:56 +0000)]
(TESTS): Add head-elide-tail.

21 years agoExercise head's --bytes=-N option.
Jim Meyering [Sun, 4 May 2003 13:46:52 +0000 (13:46 +0000)]
Exercise head's --bytes=-N option.

21 years ago.
Jim Meyering [Sun, 4 May 2003 08:45:17 +0000 (08:45 +0000)]
.

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 08:44:40 +0000 (08:44 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 08:43:39 +0000 (08:43 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 08:40:45 +0000 (08:40 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 08:39:14 +0000 (08:39 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 08:30:25 +0000 (08:30 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 08:30:09 +0000 (08:30 +0000)]
*** empty log message ***

21 years ago(__set_errno, LOCK, UNLOCK): Define.
Jim Meyering [Sun, 4 May 2003 08:30:01 +0000 (08:30 +0000)]
(__set_errno, LOCK, UNLOCK): Define.
(unsetenv): Update from GNU libc.
Ifdef-out this function, since the only caller
is putenv.c and that file now has its own copy.

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 08:26:15 +0000 (08:26 +0000)]
*** empty log message ***

21 years agoThis avoids a core dump on systems without GNU putenv,
Jim Meyering [Sun, 4 May 2003 08:26:09 +0000 (08:26 +0000)]
This avoids a core dump on systems without GNU putenv,
when running `env -u SOME_ALREADY_UNSET_VARIABLE'.

(unsetenv): New static function, from libc.
(rpl_putenv): Use it.

21 years ago*** empty log message ***
Jim Meyering [Sun, 4 May 2003 07:10:25 +0000 (07:10 +0000)]
*** empty log message ***

21 years ago(HAVE_WORKING_READDIR): Define to 0 if not defined.
Jim Meyering [Sun, 4 May 2003 07:10:21 +0000 (07:10 +0000)]
(HAVE_WORKING_READDIR): Define to 0 if not defined.
(IF_READDIR_NEEDS_REWINDDIR): Remove.
(remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
which was a bit weird because it couldn't be emulated by a function.

21 years ago*** empty log message ***
Jim Meyering [Sat, 3 May 2003 20:14:20 +0000 (20:14 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sat, 3 May 2003 15:11:25 +0000 (15:11 +0000)]
*** empty log message ***

21 years agoAdd lots of tests to exercise --bytes=-N.
Jim Meyering [Sat, 3 May 2003 15:11:20 +0000 (15:11 +0000)]
Add lots of tests to exercise --bytes=-N.

21 years ago*** empty log message ***
Jim Meyering [Sat, 3 May 2003 15:10:22 +0000 (15:10 +0000)]
*** empty log message ***

21 years agoExtend head to accept --lines=-N (--bytes=-N) and to print all
Jim Meyering [Sat, 3 May 2003 15:10:13 +0000 (15:10 +0000)]
Extend head to accept --lines=-N (--bytes=-N) and to print all
but the N lines (bytes) at the end of the file.

Include full-write.h, full-read.h, inttostr.h, quote.h.
Use quote() in diagnostics, rather than literal `' marks.
(copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
New functions.
(elide_tail_lines_pipe, elide_tail_lines_file): New functions.
(head_file): Reorganize so as to call head from only one place.
(main): Likewise, for head_file.
Handle new, undocumented option, --presume-input-pipe.
Handle negative line and byte counts.

21 years ago*** empty log message ***
Jim Meyering [Sat, 3 May 2003 14:56:22 +0000 (14:56 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Sat, 3 May 2003 14:24:48 +0000 (14:24 +0000)]
*** empty log message ***

21 years agoSkip test if the file system of `.' doesn't support
Jim Meyering [Sat, 3 May 2003 14:24:37 +0000 (14:24 +0000)]
Skip test if the file system of `.' doesn't support
sparse files -- otherwise it'd create a file of size 8GB.
This happens on Darwin6.5 with a file system of type `hfs'.

21 years ago.
Jim Meyering [Sat, 3 May 2003 07:13:25 +0000 (07:13 +0000)]
.

21 years ago*** empty log message ***
Jim Meyering [Fri, 2 May 2003 21:43:00 +0000 (21:43 +0000)]
*** empty log message ***

21 years ago(canonicalize_file_name) [!HAVE_RESOLVEPATH]:
Jim Meyering [Fri, 2 May 2003 21:42:51 +0000 (21:42 +0000)]
(canonicalize_file_name) [!HAVE_RESOLVEPATH]:
A memory-allocation error could result in heap corruption.  Fix it
by also updating `dest' when rpath may be changed by xrealloc.

21 years ago*** empty log message ***
Jim Meyering [Fri, 2 May 2003 19:52:59 +0000 (19:52 +0000)]
*** empty log message ***

21 years ago(usage): Don't mention obsolescent -WIDTH option.
Jim Meyering [Fri, 2 May 2003 19:52:48 +0000 (19:52 +0000)]
(usage): Don't mention obsolescent -WIDTH option.
Instead explain about `-' and standard input.
(main): Give a proper diagnostic for e.g., `fmt -c -72'.

21 years agoGive a proper diagnostic for e.g., `fmt -c -72'.
Jim Meyering [Fri, 2 May 2003 19:52:34 +0000 (19:52 +0000)]
Give a proper diagnostic for e.g., `fmt -c -72'.

21 years ago*** empty log message ***
Jim Meyering [Fri, 2 May 2003 19:49:06 +0000 (19:49 +0000)]
*** empty log message ***

21 years agoInclude "quote.h".
Jim Meyering [Fri, 2 May 2003 19:37:23 +0000 (19:37 +0000)]
Include "quote.h".
Use quote() in diagnostics, rather than literal `' marks.
(main): Exit nonzero when unable to open an input file.

21 years agomake sure we fail when unable to open an input file
Jim Meyering [Fri, 2 May 2003 19:36:48 +0000 (19:36 +0000)]
make sure we fail when unable to open an input file

21 years agomake sure -72x elicits an error
Jim Meyering [Fri, 2 May 2003 19:20:18 +0000 (19:20 +0000)]
make sure -72x elicits an error

21 years ago(main): Diagnose invalid suffix on obsolescent width specifications like `-72x'.
Jim Meyering [Fri, 2 May 2003 19:15:19 +0000 (19:15 +0000)]
(main): Diagnose invalid suffix on obsolescent width specifications like `-72x'.

21 years ago.
Jim Meyering [Fri, 2 May 2003 13:03:28 +0000 (13:03 +0000)]
.

21 years ago*** empty log message ***
Jim Meyering [Fri, 2 May 2003 13:02:54 +0000 (13:02 +0000)]
*** empty log message ***

21 years agobump serial number
Jim Meyering [Fri, 2 May 2003 13:02:48 +0000 (13:02 +0000)]
bump serial number

21 years ago(jm_MACROS): Require GL_FUNC_READDIR.
Jim Meyering [Fri, 2 May 2003 13:02:40 +0000 (13:02 +0000)]
(jm_MACROS): Require GL_FUNC_READDIR.

21 years ago(GL_FUNC_READDIR): Revive dead file. Change name to
Jim Meyering [Fri, 2 May 2003 13:01:28 +0000 (13:01 +0000)]
(GL_FUNC_READDIR): Revive dead file.  Change name to
have GL_ (not jm_) prefix.  Adjust cache variables similarly.
Create 500 rather than just 300 files, to exercise bug on
Darwin6.5, too.

21 years agoWork around nasty readdir bug with Darwin6.5 and hfs file system.
Jim Meyering [Fri, 2 May 2003 12:53:02 +0000 (12:53 +0000)]
Work around nasty readdir bug with Darwin6.5 and hfs file system.

(IF_READDIR_NEEDS_REWINDDIR): Define.
[! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
returned NULL and there has been at least one successful unlink or
rmdir call since the opendir or previous rewinddir, then call
rewinddir and reiterate the loop.

21 years ago*** empty log message ***
Jim Meyering [Fri, 2 May 2003 10:44:41 +0000 (10:44 +0000)]
*** empty log message ***

21 years agoFactor out common code.
Jim Meyering [Fri, 2 May 2003 10:44:32 +0000 (10:44 +0000)]
Factor out common code.
(readdir_ignoring_dotdirs): New function.
(is_empty_dir): Use it here.
(remove_cwd_entries): Use it here.

21 years agorevive dead file
Jim Meyering [Fri, 2 May 2003 07:13:10 +0000 (07:13 +0000)]
revive dead file

21 years ago*** empty log message ***
Jim Meyering [Thu, 1 May 2003 17:52:40 +0000 (17:52 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Thu, 1 May 2003 17:51:52 +0000 (17:51 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Thu, 1 May 2003 17:49:47 +0000 (17:49 +0000)]
*** empty log message ***

21 years agoCreate 500 rather than just 300 files.
Jim Meyering [Thu, 1 May 2003 17:49:41 +0000 (17:49 +0000)]
Create 500 rather than just 300 files.
There's a bug in Darwin6.5's readdir that shows up only with
338 or more files.
Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
has two components.

21 years ago*** empty log message ***
Jim Meyering [Thu, 1 May 2003 16:25:34 +0000 (16:25 +0000)]
*** empty log message ***

21 years agoChange type of n_units, n_bytes, n_lines to be `uintmax_t'.
Jim Meyering [Thu, 1 May 2003 16:25:13 +0000 (16:25 +0000)]
Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
(dump_remainder): Move two declarations `down' into the scope
where they are used.
(xlseek): Return the resulting offset.
(file_lines): Rename parameter, file_length, to end_pos.
(pipe_lines): Don't coerce safe_read return value to `int'.
Adapt tests accordingly.
(pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
to `unsigned int'.
Change type of `total_bytes' from `int' to `size_t',
since the former wouldn't always be wide enough.
Don't coerce safe_read return value to `int',
and adapt tests accordingly.
Now that testing for a read error no longer involves
using `tmp', handle that case *after* freeing `tmp'.
(start_bytes): Clean up.
(tail_bytes): Now that `n_bytes' may be larger than
OFF_T_MAX, test for that condition and, if it's true, don't
use lseek optimizations.
(parse_options): Don't fail just because N_UNITS is larger than
the maximum size of a file -- tail may be applied to an input
stream (e.g., a pipe) with more data than that.

21 years ago(file_lines): Rename parameter, file_length, to end_pos.
Jim Meyering [Thu, 1 May 2003 13:22:19 +0000 (13:22 +0000)]
(file_lines): Rename parameter, file_length, to end_pos.

21 years ago*** empty log message ***
Jim Meyering [Thu, 1 May 2003 13:19:37 +0000 (13:19 +0000)]
*** empty log message ***

21 years ago(syntax-check): Rename from alloc-check.
Jim Meyering [Thu, 1 May 2003 13:19:28 +0000 (13:19 +0000)]
(syntax-check): Rename from alloc-check.
Also check for SPACE-TAB sequences.
Also check for malloc/calloc/realloc casts.

21 years ago*** empty log message ***
Jim Meyering [Thu, 1 May 2003 11:49:17 +0000 (11:49 +0000)]
*** empty log message ***

21 years ago(start_lines): Rewrite to use memchr. Clean up.
Jim Meyering [Thu, 1 May 2003 11:49:12 +0000 (11:49 +0000)]
(start_lines): Rewrite to use memchr.  Clean up.

21 years ago*** empty log message ***
Jim Meyering [Mon, 28 Apr 2003 20:29:27 +0000 (20:29 +0000)]
*** empty log message ***

21 years agoSend two tokens, not just one, so we don't
Jim Meyering [Mon, 28 Apr 2003 20:29:22 +0000 (20:29 +0000)]
Send two tokens, not just one, so we don't
make the now-more-picky tsort fail.

21 years ago.
Jim Meyering [Mon, 28 Apr 2003 19:41:01 +0000 (19:41 +0000)]
.

21 years agocorrect grammar in comment
Jim Meyering [Mon, 28 Apr 2003 16:07:33 +0000 (16:07 +0000)]
correct grammar in comment

21 years ago*** empty log message ***
Jim Meyering [Sat, 26 Apr 2003 06:44:50 +0000 (06:44 +0000)]
*** empty log message ***

21 years ago*** empty log message ***
Jim Meyering [Fri, 25 Apr 2003 18:42:21 +0000 (18:42 +0000)]
*** empty log message ***