Commit Graph
15462 Commits
Author SHA1 Message Date
Jim Meyering 6476197bcb (main): Don't overrun array bound if argc is 0.
That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2003-05-09 08:50:37 +00:00
Jim Meyering 883159c855 *** empty log message *** 2003-05-09 08:49:46 +00:00
Jim Meyering 8a3a1ce11f *** empty log message *** 2003-05-08 09:26:42 +00:00
Jim Meyering de261015e8 (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.
2003-05-08 09:26:34 +00:00
Jim Meyering f197628cb2 (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.
2003-05-08 06:26:00 +00:00
Jim Meyering 96242be0c1 *** empty log message *** 2003-05-07 16:21:56 +00:00
Jim Meyering 61ba51a61e 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.
2003-05-07 16:21:52 +00:00
Jim Meyering f8fdfad624 *** empty log message *** 2003-05-07 07:25:08 +00:00
Jim Meyering b8dcf7b6e4 *** empty log message *** 2003-05-06 22:22:06 +00:00
Jim Meyering d16d49b67a *** empty log message *** 2003-05-06 13:33:26 +00:00
Jim Meyering ad06bb9c5a (CHAR_BIT): Remove duplicate definition. 2003-05-06 13:33:12 +00:00
Jim Meyering ef4ee07f31 *** empty log message *** 2003-05-06 08:51:30 +00:00
Jim Meyering 00d70feed3 (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.
2003-05-06 08:51:26 +00:00
Jim Meyering 78986d419d *** empty log message *** 2003-05-05 07:55:18 +00:00
Jim Meyering a8916294ec (struct dummy): Ensure that at least the number of
initializers matches the number of members in the corresponding enum.
2003-05-05 07:54:19 +00:00
Jim Meyering 95623ba86e (enum Ftw_option): Name this previously-anonymous enum.
(enum Ftw_option) [FTW_N_MEMBERS]: New member.
2003-05-05 07:52:26 +00:00
Jim Meyering 75fa058191 Avoid array overrun.
(nftw_arr): Update to reflect complete list of members.
(ftw_arr): Likewise
2003-05-05 07:31:49 +00:00
Jim Meyering 8670b14045 *** empty log message *** 2003-05-05 07:30:45 +00:00
Jim Meyering 1048ef4240 . 2003-05-04 14:07:26 +00:00
Jim Meyering f53eda1b81 . 2003-05-04 14:07:07 +00:00
Jim Meyering 8a79d3d630 Remove tests of --bytes=-N; using that framework
caused the addition of thousands of small files to the tar archive.
2003-05-04 14:06:52 +00:00
Jim Meyering 0a8019497e *** empty log message *** 2003-05-04 14:01:02 +00:00
Jim Meyering 832fdc2a2e *** empty log message *** 2003-05-04 13:56:47 +00:00
Jim Meyering 997f9e72d2 (TESTS): Add head-elide-tail. 2003-05-04 13:56:43 +00:00
Jim Meyering beaff195ed Exercise head's --bytes=-N option. 2003-05-04 13:46:52 +00:00
Jim Meyering f1ce5dbf0e . 2003-05-04 08:45:17 +00:00
Jim Meyering 28e9fb4f73 *** empty log message *** 2003-05-04 08:44:40 +00:00
Jim Meyering 3a6d6ae776 *** empty log message *** 2003-05-04 08:43:39 +00:00
Jim Meyering 57d138d144 *** empty log message *** 2003-05-04 08:40:45 +00:00
Jim Meyering 21c8705b3c *** empty log message *** 2003-05-04 08:39:14 +00:00
Jim Meyering f4fbb39dfd *** empty log message *** 2003-05-04 08:30:25 +00:00
Jim Meyering 8b4a10178b *** empty log message *** 2003-05-04 08:30:09 +00:00
Jim Meyering 6754f257e0 (__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.
2003-05-04 08:30:01 +00:00
Jim Meyering 986b5eca57 *** empty log message *** 2003-05-04 08:26:15 +00:00
Jim Meyering cf09ab79a3 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.
2003-05-04 08:26:09 +00:00
Jim Meyering e3ea089119 *** empty log message *** 2003-05-04 07:10:25 +00:00
Jim Meyering 87c13cce86 (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.
2003-05-04 07:10:21 +00:00
Jim Meyering c48100ccf1 *** empty log message *** 2003-05-03 20:14:20 +00:00
Jim Meyering 34bd9f31cc *** empty log message *** 2003-05-03 15:11:25 +00:00
Jim Meyering 75fc3fd6a0 Add lots of tests to exercise --bytes=-N. 2003-05-03 15:11:20 +00:00
Jim Meyering cbbdaf78f8 *** empty log message *** 2003-05-03 15:10:22 +00:00
Jim Meyering 57c1158f02 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.
2003-05-03 15:10:13 +00:00
Jim Meyering 61d5480f00 *** empty log message *** 2003-05-03 14:56:22 +00:00
Jim Meyering b9c9a002d8 *** empty log message *** 2003-05-03 14:24:48 +00:00
Jim Meyering 46c548cab4 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'.
2003-05-03 14:24:37 +00:00
Jim Meyering 1867521304 . 2003-05-03 07:13:25 +00:00
Jim Meyering 3b0e09ef8c *** empty log message *** 2003-05-02 21:43:00 +00:00
Jim Meyering 35cad8ae05 (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.
2003-05-02 21:42:51 +00:00
Jim Meyering 478239f404 *** empty log message *** 2003-05-02 19:52:59 +00:00
Jim Meyering c4ff976e20 (usage): Don't mention obsolescent -WIDTH option.
Instead explain about `-' and standard input.
(main): Give a proper diagnostic for e.g., `fmt -c -72'.
2003-05-02 19:52:48 +00:00