1 2001-02-27 Paul Eggert <eggert@twinsun.com>
3 * src/sort.c (initbuf): If the desired size cannot be
4 allocated, repeatedly halve it until allocation succeeds.
5 Reported by Solar Designer.
7 2001-02-26 Paul Eggert <eggert@twinsun.com>
9 * src/sort.c (parse_field_count): Comment fix.
11 2001-02-25 Paul Eggert <eggert@twinsun.com>
13 * src/sort.c: Tune allocation and comparison of nodes
14 representing temp files. This improved CPU performance of
15 'sort -S 1 *.[ch]' by 17% on my host.
17 (struct tempnode): name member now uses struct hack.
18 (temphead): Now a pointer, not a structure. All uses changed.
19 (create_temp_file): Allocate node using struct hack.
20 (zaptemp): Free node using struct hack. Use pointer comparison, not
23 2001-02-25 Paul Eggert <eggert@twinsun.com>
25 * src/sort.c (eolchar, trim_trailing_blanks): Now static.
27 2001-02-25 Paul Eggert <eggert@twinsun.com>
29 'sort' race condition fixes.
31 Defend against a DoS attack where someone else creates a
32 temporary file with the same name as ours. Use mkstemp to do
33 this, supplying our own mkstemp if the system doesn't have one.
35 Also, fix a race condition during cleanup on hosts without
38 * src/sort.c (NAME_MAX_IN_DIR): Remove.
39 (sigprocmask, sigset_t): New macros, defined only on older hosts.
40 (caught_signals): New var.
41 (xtmpfopen, tempname): Removed.
42 (create_temp_file): New function, combining the functions of the old
43 xtmpfopen and tempname. All callers changed.
44 Use mkstemp to create the file.
45 (sighandler): On hosts without sigaction, ignore signals while
46 cleaning up, instead of letting them interrupt cleanup.
47 (main): Initialize caught_signals. On hosts with sigaction, block all
48 caught signals while handling one. Remove duplicate code.
50 2001-02-22 Jim Meyering <meyering@lucent.com>
52 * src/sort.c (keycompare): Move declarations of locals, lena and lenb,
53 into the inner scope where they are used.
55 2001-02-19 Jim Meyering <meyering@lucent.com>
57 * src/sort.c (AUTHORS): Add Paul Eggert.
59 * src/wc.c (wc): Rename innermost `buf' to avoid shadowing warning.
60 (wc): Rename local `wc' to avoid shadowing function name.
62 2001-02-18 Paul Eggert <eggert@twinsun.com>
64 Fix a race condition: freed storage accessed during a signal handler.
66 * src/sort.c (struct tempnode.next): Now volatile.
67 (zaptemp): Free the file name after removing it from the temp list,
68 not before, because a signal can arrive between the two actions
69 and cleanup () traverses the list.
71 2001-02-18 Paul Eggert <eggert@twinsun.com>
73 Check for input size, and do not overallocate memory.
74 Also check for memory quotas.
76 Revamp storage management so that line tables and character data are
77 taken from the same buffer. Line tables are now in reverse order,
78 since they grow down while the character data grow up.
81 (<sys/resource.h>): Include if HAVE_SYS_RESOURCE_H.
82 (struct rlimit, getrlimit): Define a replacement if RLIMIT_DATA
84 (RLIMIT_AS): Define to RLIMIT_DATA if not defined.
85 (struct lines): Remove.
86 (struct buffer): New members nlines, line_bytes, eof.
87 Remove member newline_free; no longer needed, since the code no longer
88 runs out of line table space.
89 (SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): Remove.
90 (sort_size): Renamed from sortalloc; now applies to the sum of the
91 character data and the line table, not just the character data.
92 (MIN_SORT_SIZE, INPUT_FILE_SIZE_GUESS): New macros.
94 (specify_sort_size): Don't worry about the distinction between the
95 character data and the line table; that is now the caller's
97 (default_sort_size): Return the value, instead of being executed for
98 side effect. Return half of available memory, or 1/16 of total memory,
99 whichever is greater; except do not exceed 1/2 of quota.
100 (sort_buffer_size): New function.
101 (initbuf): New arg LINE_BYTES. Ensure that the line array is properly
102 aligned. Initialize the new set of struct buffer members.
103 (buffer_linelim): New function.
104 (fillbuf): Return int, not size_t, since the callers merely care
105 whether the result is nonzero. New arg FILE so that error messages
106 can report the file name. Keep track of eof. Initialize the line
107 table too, taking its memory from the input buffer's memory; this
108 subsumes the old findlines function and removes the need for worrying
109 about running out of line table entries.
110 (checkfp, mergefps, sortlines, merge, sort): Adjust to the new storage
111 management regime, in particular the fact that line tables are now
112 filled in by fillbuf and are in reverse order.
113 (checkfp): Now takes char *, not const char *, since subroutines
114 require that now. Rewrite to avoid lint and duplicate code.
115 If line length alloc calculation overflows,
116 simply allocate enough memory to hold the line.
117 (mergefps): New arg FILES, used for buffer size calculation and error
118 messages. Rewrite to avoid lint. Do not loop if savealloc*2
120 (mergefps, merge): Zap temporary files eagerly rather than lazily;
121 this is needed because we now pass FILES to mergefps.
122 (sortlines): Args now point at end of arrays, not at beginnings.
123 (sort): Do not allocate temporary line array for sortlines;
124 instead, take the space from the same buffer.
125 (main): Adjust to sort_size and default_sort_size changes.
127 2001-02-18 Jim Meyering <meyering@lucent.com>
129 Rename test input files to avoid conflicts on case-insensitive
131 * tests/pr/2-Sf-t_notab: Rename from 2Sf-t_notab.
132 * tests/pr/2-S_f-t_notab: Rename from 2S_f-t_notab.
133 * tests/pr/W-72l17f-ll: Rename from W72l17f-ll.
134 * tests/pr/Test.pm: Update file names to reflect renamings.
135 Reported by Matthew Smith.
137 2001-01-20 Jim Meyering <meyering@lucent.com>
139 * configure.in: Remove jm_CHECK_ALL_TYPES.
140 Now it's invoked by jm_MACROS.
142 2001-01-17 Jim Meyering <meyering@lucent.com>
144 * src/cksum.c (main): Use PACKAGE, not GNU_PACKAGE.
145 * src/tsort.c (main): Likewise.
146 * src/sort.c (main): Likewise.
147 (usage): Convert each TAB in --help output to a sequence of 8 spaces.
149 2001-01-07 Jim Meyering <meyering@lucent.com>
151 * src/tail.c (usage): Split a string that was longer than 2048 bytes.
153 2001-01-03 Jim Meyering <meyering@lucent.com>
155 * src/sort.c (main): Remove embedded \n from diagnostic.
157 2001-01-02 Jim Meyering <meyering@lucent.com>
159 * src/od.c (ulonglong_t): Define place-holder type to avoid some #if
161 (LONGEST_INTEGRAL_TYPE): Remove definition.
162 (MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of
163 LONGEST_INTEGRAL_TYPE.
164 (print_long_long): Compile this function even on systems without
166 (decode_one_format): Remove #if directive.
168 * src/od.c (decode_one_format): Guard use of print_long_long with
169 `#if HAVE_UNSIGNED_LONG_LONG'. From Darren Salt.
170 Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead.
172 2000-12-23 Jim Meyering <meyering@lucent.com>
174 * src/sys2.h [HAVE_INTTYPES_H]: Include <inttypes.h>.
176 2000-12-19 Jim Meyering <meyering@lucent.com>
180 2000-12-18 Paul Eggert <eggert@twinsun.com>
182 * NEWS, doc/textutils.texi: New "sort" option -S SIZE.
184 * src/sys2.h (UINTMAX_MAX): New macro, taken from C99.
186 * src/sort.c: Include physmem.h.
187 (SORTALLOC, mergealloc, LINEALLOC): Remove.
188 (sortalloc): Default to zero at program startup.
189 (SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): New macros.
190 (usage, main): Add support for new -S SIZE option.
191 (specify_sort_size, default_sort_size): New functions.
192 (initlines): Do not let alloc exceed limit.
193 (findlines): Likewise.
194 (checkfp, mergefps, sort): Use sortalloc to size everything
195 else, instead of relying on precomputed sizes.
197 2000-12-17 Jim Meyering <meyering@lucent.com>
199 * doc/texinfo.tex: Update from master repository.
200 * config.sub: Likewise.
201 * config.guess: Likewise.
203 2000-12-11 Jim Meyering <meyering@lucent.com>
207 2000-12-07 Jim Meyering <meyering@lucent.com>
209 * src/od.c (address_base): Declare to be static.
211 2000-12-06 Paul Eggert <eggert@twinsun.com>
213 * src/od.c (address_base, address_pad_len): New var.
214 (output_address_fmt_string, address_fmt_buffer, address_pad): Remove.
215 (flag_pseudo_start): Now int, not long int.
216 (pseudo_offset): Now off_t, not long int.
217 (n_specs, n_specs_allocated): Now size_t, not unsigned int.
218 (format_address, format_address_none, format_address_std,
219 format_address_label): Now accepts an extra char argument (an extra
220 char to print if nonzero), and prints instead of returning a string.
222 (bytes_per_block): Now size_t, not int.
223 (format_address_none): Do not even print the extra char argument.
224 This simplifies the callers.
225 (format_address_std, format_address_label): Print off_t ourself
226 instead of trying to use autoconfigured format. This is faster and
228 (format_address_paren): New function.
229 (dump): Remove unnecessary cast.
230 (expand_address_fmt): Remove.
231 (main): Use size_t, off_t, etc. instead of builtin types where this is
232 advisable. Adjust to above changes. Remove unnecessary cast.
234 2000-12-03 Jim Meyering <meyering@lucent.com>
236 * src/tail.c (tail_file): Initialize ignore, dev, and ino members,
237 when tailing forever and the open failed. Otherwise, we could get
238 uninitialized memory references of those fields in recheck.
239 * tests/tail-2/Makefile.am (TESTS): Add assert-2.
240 * tests/tail-2/assert-2: New file.
244 Make od print valid addresses for offsets of 2^32 and larger, and
245 allow byte offset (-j) and byte count (-N) to be 2^32 and larger.
247 * src/od.c (MAX_ADDRESS_LENGTH): Don't hard-code as a literal.
248 Rather, define in terms of the type, off_t.
249 (string_min): Declare to be of type size_t.
250 (flag_dump_strings): Declare to be of type int.
251 (print_s_char): Declare the n_bytes parameter and the local, `i',
253 (print_char): Likewise.
254 (print_s_short): Likewise.
255 (print_short): Likewise.
256 (print_int): Likewise.
257 (print_long): Likewise.
258 (print_long_long): Likewise.
259 (print_float): Likewise.
260 (print_double): Likewise.
261 (print_long_double): Likewise.
262 (dump_hexl_mode_trailer): Likewise.
263 (print_named_ascii): Likewise.
264 (print_ascii): Likewise.
265 (write_block): Likewise.
266 (print_ascii): Declare local, `print_function' with a prototype.
267 Change a few `>' comparisons to the equivalent `<' form.
268 (parse_options): Declare `tmp' to be of type uintmax_t.
269 Use xstrtoumax, not xstrtoul.
270 Fail if the specified offset if larger than OFF_T_MAX.
271 (dump_strings): Declare local `i' to be of type size_t.
272 Remove the now-unnecessary cast-to-off_t.
273 (main) [IF_LINT]: Initialize desired_width to avoid a warning.
274 Declare `tmp' to be of type uintmax_t.
275 Use xstrtoumax, not xstrtoul.
276 Fail if minimum string length is larger than SIZE_MAX.
277 Fail if specified width is larger than ULONG_MAX.
279 * src/od.c (format_address): Use off_t, not long unsigned_int as the
281 (format_address_none): Likewise. Mark parameter as unused.
282 (format_address_std): Likewise.
283 (format_address_label): Likewise.
284 (print_ascii): Mark format string parameter as unused.
285 (write_block): Use off_t, not long unsigned_int as offset type.
286 (expand_address_fmt): New function.
287 (main): Use it to expand each address format string template.
288 Reported by Mark Nudelman, via Andreas Jaeger.
290 * src/sys2.h (OFF_T_MIN): Define here instead.
291 (OFF_T_MAX): Likewise.
294 * src/tail.c (parse_options): Use xstrtoumax to parse the byte and line
295 offset. Give a better diagnostic when the requested offset is still
296 representable but larger than OFF_T_MAX.
297 (OFF_T_MIN): Remove definition.
298 (OFF_T_MAX): Likewise.
300 2000-12-02 Jim Meyering <meyering@lucent.com>
302 * src/sort.c (checkfp): Rename local `buf' to avoid shadowing previous
305 * src/sort.c (NONZERO): Define and use it to make the code a tiny
308 * doc/textutils.texi (sort invocation): Clarify how -t works
309 when a sort key specifies a range of fields. From Karl O. Pinc.
311 2000-11-26 Paul Eggert <eggert@twinsun.com>
313 * src/od.c (skip): Use lseek instead of worrying about fseeko or fseek.
314 This should be portable, as we seek before doing any I/O.
315 (fseeko): Remove; no longer used.
317 2000-11-30 Jim Meyering <meyering@lucent.com>
319 * src/sort.c: s/SIZE_T_MAX/SIZE_MAX/.
321 2000-11-30 Paul Eggert <eggert@twinsun.com>
323 * src/sys2.h: Include <stdint.h> if HAVE_STDINT_H.
324 (SIZE_MAX): Renamed from SIZE_T_MAX, as C99 uses SIZE_MAX.
327 2000-11-30 Jim Meyering <meyering@lucent.com>
329 * src/sort.c: SIZE_MAX is not defined, so s/SIZE_MAX/SIZE_T_MAX/, and...
330 * src/sys2.h (SIZE_T_MAX): ... define.
332 2000-11-29 Paul Eggert <eggert@twinsun.com>
334 Port GNU "sort" to hosts where sizes don't fit in "int",
335 e.g. 64-bit Solaris (sparc).
337 * src/sort.c ("human.h", "xstrtol.h"): Include.
338 (struct line): length member is now size_t, not int.
339 (struct lines): Likewise for used, alloc, limit members.
340 (struct buffer): Likewise for used, alloc, left, newline_free members.
341 (struct keyfield): Likewise for sword, schar, eword, echar members.
342 (sortalloc, mergealloc, linelength): Now size_t, not int.
344 (initbuf, fillbuf, initlines, begfield, limfield, findlines,
345 numcompare, getmonth, keycompare, compare, checkfp, mergefps,
346 sortlines, sort): Accept, return, and use size_t for sizes, not int.
348 (fillbuf, initlines, findlines, checkfp, sort): Check for overflow
349 when computing buffer sizes.
351 (begfield, limfield): Do not index past end of array.
353 (checkfp): Return a boolean, not a line number, as the line
354 number may not fit in int. All callers changed. Use
355 uintmax_t for line numbers, not int.
357 (sort): Don't allocate tmp until we need it (and know the right size).
359 (parse_field_count): New function.
361 (main): Use it to check for overflow in field counts.
362 "outfile" is now a pointer to const.
364 2000-11-27 Jim Meyering <meyering@lucent.com>
366 * src/checksum.h: Don't include system.h here.
367 * src/md5.c: Include config.h, stdio.h, sys/types.h. and system.h here
369 * src/sha1sum.c: Likewise.
371 2000-11-18 Paul Eggert <eggert@twinsun.com>
373 * src/pr.c (main): Do not assume EOF == -1.
374 Handle the case correctly when digits options immediately precede a
377 2000-11-18 Jim Meyering <meyering@lucent.com>
379 * doc/textutils.texi: Change GNU to @sc{gnu} in many places.
380 Update to use the Free Documentation Licence.
382 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
383 very latest version (in CVS) of autoconf.
385 2000-11-17 Jim Meyering <meyering@lucent.com>
387 * GNUmakefile (.NOTPARALLEL): New target. Prevent unwanted parallelism.
388 Suggestion from Ulrich Drepper.
390 2000-11-16 John David Anglin <dave@hiauly1.hia.nrc.ca>
392 * tsort.c: Include sys/types.h before system.h.
394 2000-11-16 Jim Meyering <meyering@lucent.com>
396 * src/join.c: Declare global `tab' to be of type *unsigned* char,
397 so join works with 8-bit delimiter characters.
398 Reported by Antonio Rendas.
399 * tests/join/Test.pm (8-bit-t): New test for the above fix.
401 2000-11-13 Paul Eggert <eggert@twinsun.com>
403 * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
404 be tested with #ifdef, not with #if.
406 2000-11-11 Jim Meyering <meyering@lucent.com>
408 * doc/textutils.texi: More minor rewording and grammar correction.
411 2000-11-06 Paul Eggert <eggert@twinsun.com>
413 * src/od.c (skip): st_size is not defined for directories.
415 2000-11-03 Jim Meyering <meyering@lucent.com>
417 * tests/sha1sum/sample-vec: New file, with tests derived from
418 http://csrc.nist.gov/cryptval/shs/sha1-vectors.zip
419 * tests/sha1sum/Makefile.am (TESTS): Add sample-vec.
421 2000-10-30 Jim Meyering <meyering@lucent.com>
423 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
424 very latest version (in CVS) of autoconf.
426 * src/wc.c: Include "system.h" after wctype.h (not before)
427 to avoid a compilation error on Solaris 5.5.1 systems.
428 Reported by Vin Shelton.
430 2000-10-23 Jim Meyering <meyering@lucent.com>
432 * Makefile.maint: Clean up version-related variables.
436 * Makefile.am (EXTRA_DIST): Add .prev-version.
438 2000-10-22 Jim Meyering <meyering@lucent.com>
440 * tests/Makefile.am (SUBDIRS): Add sha1sum.
441 * tests/sha1sum/basic-1: New file.
442 * configure.in (AC_OUTPUT): Add tests/sha1sum/Makefile.
444 * src/Makefile.am (bin_PROGRAMS): Add sha1sum.
445 (md5sum_SOURCES): Define.
446 (sha1sum_SOURCES): Define.
447 (noinst_HEADERS): Add checksum.h.
449 * src/md5sum.c: Factor out the differences between MD5 and SHA1,
450 and parameterize so this code may be used by both md5sum and the new
451 program, sha1sum. Loosely based on a patch from Scott Miller.
452 * src/checksum.h: New file.
453 * src/md5.c: New file that simply defines `algorithm'.
454 * src/sha1sum.c: Likewise.
456 * man/Makefile.am (man_MANS): Add sha1sum.1.
457 * man/sha1sum.x: New file.
459 Support 8-byte integers, assuming they're printable with e.g., %lld.
460 * src/od.c: Add support for printing data as unsigned
463 2000-10-21 Jim Meyering <meyering@lucent.com>
465 The command, `yes ''|./cat -n' would stop printing after INT_MAX lines.
466 * src/cat.c (cat): Never let `newlines' exceed 3.
468 2000-10-21 Jim Meyering <meyering@lucent.com>
470 Prevent a counter buffer overrun when numbering lines and when
471 processing 100 billion lines (or more) of input.
472 * src/cat.c (LINE_COUNTER_BUF_LEN): Define to allow numbering as
473 many as 10^18 - 1 lines (the old limit was 10^11 - 1, and could
474 be exceeded without too much trouble). Use this symbol rather
475 than hard-coding the constant everywhere.
476 (next_line_num): Rather than overrunning for input with more lines,
477 mark the line number by putting a `>' in the leftmost slot.
478 Patch by Jan Nieuwenhuizen.
480 * src/sort.c (SORT_OUT_OF_ORDER): Define.
481 (main): Use it instead of hard-coding the `1'.
483 2000-10-10 Jim Meyering <meyering@lucent.com>
485 * src/sort.c (main): Use EXIT_SUCCESS rather than 0.
486 Fail when checking (-c) with more than one file argument,
487 rather than simply ignoring the extra arguments.
489 2000-09-07 Jim Meyering <meyering@lucent.com>
491 * src/cut.c: Remove obsolete comment block.
492 (usage): Note that when using -f, lines with no delimiters are
494 * doc/textutils.texi (cut invocation): Likewise.
496 2000-08-23 Jim Meyering <meyering@lucent.com>
498 * src/md5sum.c: Include <config.h> unconditionally, to be consistent
499 with all the other programs in this directory.
500 * src/tsort.c: Likewise.
502 2000-08-19 Jim Meyering <meyering@lucent.com>
504 * src/comm.c (writeline): Correct comments. From Bruno Haible.
506 2000-08-11 Paul Eggert <eggert@twinsun.com>
508 * doc/textutils.texi:
510 Portable shell scripts should specify global options before
513 Move global LC_CTYPE remark to each sort option that depends
516 sort -g depends on LC_NUMERIC.
518 Add @vindex where it's missing.
520 "radix character" -> "decimal-point character", to match Standard C
521 terminology, which is easier for most people to follow.
523 "comm" does not consider trailing newlines to be significant.
525 2000-08-10 Paul Eggert <eggert@twinsun.com>
527 * doc/textutils.texi: Recommend against the System V syntax
528 for tr ranges, and don't use it in examples. Use POSIX
529 classes rather than ranges, for portability.
530 * src/tr.c (usage): Don't describe System V syntax, as it
533 * src/sort.c (usage): Describe -d and -i in a locale-independent way.
535 * doc/Makefile.am (constants.texi): Use the C locale so that
536 [A-Z] works as expected.
538 2000-08-07 Paul Eggert <eggert@twinsun.com>
540 * src/cut.c (cut_fields): Invoke xalloc_die instead of printing
542 (cut_fields): Check for I/O error as well as end-of-file
544 2000-08-06 Bruno Haible <haible@clisp.cons.org>
546 * src/wc.c: Add support for multi-byte locales.
547 (iswprint, mbrtowc, wcwidth): Provide default definitions.
548 (total_bytes): New variable.
549 (print_bytes): New variable.
550 (longopts): Change abbreviation for --chars from 'c' to 'm'.
552 (write_counts): Add `bytes' argument.
553 (wc): New variables `bytes', `count_bytes', `count_chars',
554 `count_complicated'. The old code determines `bytes', not `chars'.
555 New case for MB_CUR_MAX > 1. A non-printable non-space character does
556 not increment the line position or start a word. Update `total_bytes'.
557 (main): Initialize `print_bytes' and `total_bytes' to 0. Accept 'm'
558 option. Pass `total_bytes' to write_counts.
559 * doc/textutils.texi (wc invocation): Update accordingly.
561 2000-08-06 Bruno Haible <haible@clisp.cons.org>
563 * src/head.c (head): Call write_header here.
564 (head_file): ... not here.
566 * src/cat.c (closeout_func): Remove variable.
567 (close_stdout_wrapper): Remove unused function.
568 (main): Remove assignment to closeout_func.
570 * src/fold.c (fold_file): Remove ferror(stdout) check, already done
573 2000-08-06 Paul Eggert <eggert@twinsun.com>
575 * src/sort.c (usage): Warn more succinctly about the effects of
576 the locale on sort order.
578 2000-08-06 Jim Meyering <meyering@lucent.com>
582 * src/tail.c (pipe_lines): Declare local `cp' to be const.
584 2000-08-04 Greg McGary <greg@mcgary.org>
586 * src/tail.c (pipe_lines): Add variable `nbytes' so we can free
587 `tmp' immediately after read loop. Don't process an empty file.
588 [This fixes a buffer-underrun error -- detected thanks to
589 bounded pointers -jmm]
591 2000-08-05 Jim Meyering <meyering@lucent.com>
593 Fix buffer-overrun error.
594 * src/pr.c (init_header): Allocated buffer was sometimes too small.
595 Reported by Greg McGary (who found this bug using his
596 bounded-pointers-enabled gcc).
597 (init_header): Move declarations of several variables into the
598 inner scope where they are used.
599 * tests/pr/Test.pm (narrow-1): New test, for the above.
601 * src/csplit.c (MAX): Remove definition (It's in sys2.h).
603 2000-08-04 Jim Meyering <meyering@lucent.com>
605 * src/sort.c (main): Rename local `t' to `tmp_dir' to avoid shadowing
606 a previous local by that name.
607 (usage): Warn that GNU sort is now locale-aware, and suggest
608 people put LC_ALL=POSIX in their environment.
610 * src/pr.c (store_columns): Remove conjunct that would dereference
611 an out-of-bounds pointer. Reported by Greg McGary (who found this
612 bug using his bounded-pointers-enabled gcc).
614 2000-08-03 Jim Meyering <meyering@lucent.com>
616 * tests/Makefile.am.in ($(srcdir)/$x-tests): Use -I$(srcdir), not `-I.'.
617 (Makefile.am): Likewise. Reported by Greg McGary.
619 2000-08-01 Jim Meyering <meyering@lucent.com>
621 * doc/textutils.texi (tr invocation): Note that ranges are not portable.
622 Update examples not to use ranges.
624 2000-07-31 Jim Meyering <meyering@lucent.com>
626 * src/cut.c (cut_fields): Use `virtual memory exhausted',
627 not `Memory exhausted'.
629 2000-07-30 Jim Meyering <meyering@lucent.com>
631 * src/help-version: Remove file. Move it to ...
632 * tests/help-version: ...here
633 * tests/Makefile.am (TESTS): Set to help-version.
634 (TESTS_ENVIRONMENT): Define.
635 (EXTRA_DIST): Add $(TESTS).
636 * src/Makefile.am (EXTRA_DIST): Remove help-version.
637 (TESTS): Remove definition.
638 (TESTS_ENVIRONMENT): Remove definition.
640 2000-07-28 Paul Eggert <eggert@twinsun.com>
642 sort's -T option can now appear multiple times.
643 Thanks to Charles Randall for suggesting this idea.
645 * doc/textutils.texi, NEWS: Document this.
647 * src/sort.c (temp_dir): Remove.
648 (temp_dirs, temp_dir_count, temp_dir_alloc): New vars.
649 (process_id): New var.
650 (usage): Describe new use of -T.
651 (add_temp_dir): New function.
652 (tempname): Use new temp_dirs array.
653 Do not discard information from the process-id or sequence
654 number, unless we have short file names.
655 (sighandle): Use process_id instead of getpid.
656 (main): Initialize process_id.
657 Add support for the new use of -T.
659 2000-07-23 Jim Meyering <meyering@lucent.com>
661 * tests/head/Test.pm: Rename tests (and hence files) to have a short
662 enough prefix so that they're not truncated on 8+3 file systems.
663 Reported by Eli Zaretskii.
665 2000-07-09 Jim Meyering <meyering@lucent.com>
667 * config.guess: Update from FSF.
668 * config.sub: Likewise.
670 2000-07-02 Jim Meyering <meyering@lucent.com>
674 2000-07-01 Jim Meyering <meyering@lucent.com>
676 * src/cut.c: Change type of global, field_1_bufsize, from int to size_t.
678 2000-06-29 Jim Meyering <meyering@lucent.com>
680 * src/tr.c (find_bracketed_repeat): Add a cast to suppress a warning.
681 Reported by Gerhard Poul.
683 * src/tail.c (enum): Remove comma from end of enumerator list.
686 2000-06-25 Jim Meyering <meyering@lucent.com>
688 * configure.in (ALL_LINGUAS): Add Danish (da).
690 2000-06-24 Jim Meyering <meyering@lucent.com>
692 * doc/textutils.texi: Lots of minor rewording and grammar correction.
695 * tests/sum/basic-1: New file.
696 * tests/sum/Makefile.am: New file.
697 * configure.in (AC_OUTPUT): Add tests/md5sum/Makefile.
698 * tests/Makefile.am (SUBDIRS): Add sum.
700 2000-06-22 Bruno Haible <haible@clisp.cons.org>
702 * src/sum.c (sysv_sum_file): Avoid overflowing 32-bit accumulator
703 on files larger than 256 MB.
705 2000-06-22 Bruno Haible <haible@clisp.cons.org>
707 * src/cat.c (main): Correct a comment.
709 2000-06-21 Jim Meyering <meyering@lucent.com>
711 * src/cut.c (getstr): Remove private (and out of date) version of
713 (cut_fields): Adjust caller to use the just-extended one in ../lib.
714 Reported by Paul Sauer.
716 2000-06-20 Jim Meyering <meyering@lucent.com>
718 * src/uniq.c (main): Fix off-by-argc test, so +N-style options are
719 recognized once again. Reported by Geoff Keunning.
720 Fix typo in diagnostic: s/compare/skip/.
722 2000-05-27 Jim Meyering <meyering@lucent.com>
724 * src/tail.c: Arrange to call close_stdout upon exit.
725 Don't close stdout explicitly.
726 (usage): Add missing backslash at end of line.
727 (write_header): Remove now-unused COMMENT parameter.
730 2000-05-24 Jim Meyering <meyering@lucent.com>
732 * src/head.c (head_file): Use STDIN_FILENO in place of `0'.
735 2000-05-20 Jim Meyering <meyering@lucent.com>
737 * src/cat.c: Arrange to call close_stdout upon exit.
738 Don't close stdout explicitly. Replace uses of global constant,
739 output_desc, with uses of STDOUT_FILENO.
741 Arrange to call close_stdout upon exit. Don't close stdout explicitly.
742 * src/cksum.c: Likewise.
743 * src/comm.c: Likewise.
744 * src/csplit.c: Likewise.
745 * src/cut.c: Likewise.
746 * src/expand.c: Likewise.
747 * src/fmt.c: Likewise.
748 * src/fold.c: Likewise.
749 * src/head.c: Likewise.
750 * src/join.c: Likewise.
751 * src/md5sum.c: Likewise.
752 * src/nl.c: Likewise.
753 * src/od.c: Likewise.
754 * src/paste.c: Likewise.
755 * src/pr.c: Likewise.
756 * src/ptx.c: Likewise.
757 * src/sort.c: Likewise. (but set exit status and file name, too)
758 * src/split.c: Likewise.
759 * src/sum.c: Likewise.
760 * src/tac.c: Likewise.
761 * src/tr.c: Likewise.
762 * src/tsort.c: Likewise.
763 * src/unexpand.c: Likewise.
764 * src/uniq.c: Likewise.
765 * src/wc.c:: Likewise.
767 2000-05-13 Jim Meyering <meyering@lucent.com>
769 * src/help-version: Run each program successfully at least once.
771 2000-05-12 Jim Meyering <meyering@lucent.com>
773 * src/head.c (string_to_integer): Restrict base to 10.
774 Reported by Joseph S. Myers.
775 * tests/head/Test.pm: Add a few tests for this.
777 New option: --first-only
778 * src/unexpand.c (anonymous enum) [CONVERT_FIRST_ONLY_OPTION]: Define.
779 (long_options): Add `first-only'.
780 (main): Handle new option.
782 2000-05-11 Jim Meyering <meyering@lucent.com>
784 * tests/unexpand/basic-1: New tests.
786 2000-04-17 Bruno Haible <haible@clisp.cons.org>
788 * src/system.h [__BEOS__]: Ignore O_BINARY and O_TEXT.
790 2000-04-16 Jim Meyering <meyering@lucent.com>
792 * src/tail.c: Prepare to remove option: --max-consecutive-size-changes.
794 (usage): Remove description.
795 * doc/textutils.texi (tail invocation): Remove description.
797 2000-04-12 Jim Meyering <meyering@lucent.com>
799 * src/tail.c (usage): Tweak --help output. Suggestions from Karl Berry.
801 Move some macros into m4/.
802 * configure.in (_GNU_SOURCE): Don't define here.
803 (AC_SYS_LARGEFILE): Don't use here.
804 (AM_C_PROTOTYPES): Don't use here.
805 * acconfig.h: Remove now-unused file.
807 2000-04-09 Jim Meyering <meyering@lucent.com>
809 * doc/textutils.texi: Include constants.texi.
810 (tail invocation): Use `@value's instead of referring to the
811 output of `tail --help' for defaults.
812 * doc/Makefile.am (constants.texi): New rule.
813 (EXTRA_DIST): Add constants.texi.
814 (MAINTAINERCLEANFILES): Add it here, too.
815 (textutils.dvi, textutils.info): Depend on constants.texi.
817 * src/tail.c (usage): Clarify descriptions of the --max-* options.
820 2000-04-03 Jim Meyering <meyering@lucent.com>
822 * configure.in (AC_CHECK_HEADERS): Remove langinfo.h. Now it's in m4/.
823 (AC_CHECK_FUNCS): Remove nl_langinfo. Now it's in m4/.
825 2000-03-17 Jim Meyering <meyering@lucent.com>
827 * configure.in (ALL_LINGUAS): Add Slovenian (sl).
829 2000-03-12 Jim Meyering <meyering@lucent.com>
831 Merge from fileutils.
832 * src/system.h "pathmax.h": Include.
833 <sys/time.h>: Include if appropriate.
835 <sys/mkdev.h>: Likewise.
836 <sys/sysmacros.h>: Likewise.
838 (major, minor, makedev): Define if needed.
839 (struct utimbuf): Declare if missing.
840 (ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE): Define.
842 * src/cksum.c (usage): Correct --help output.
843 Prompted by a report from Gregory Leblanc.
845 2000-03-05 Paul Eggert <eggert@twinsun.com>
847 * src/sort.c (struct buffer.newline_free): New member.
848 (initbuf, findlines): Set it.
849 (fillbuf): Do not double the size of a full buffer to append a newline
850 unless the buffer is known to be newline free.
852 2000-03-05 Jim Meyering <meyering@lucent.com>
856 2000-03-04 Jim Meyering <meyering@lucent.com>
858 Don't get failed assertion for `tail -f directory'.
859 * src/tail.c: Revert most of 1999-10-20 change. Instead, ...
860 (IS_TAILABLE_FILE_TYPE): Define to produce similar result.
861 (recheck): Use it here.
862 (tail_file): Use it here.
863 Reported by François Pinard.
865 Once we encounter a file that is not of IS_TAILABLE_FILE_TYPE,
866 marke it as such and ignore it forever after.
867 * src/tail.c (struct File_spec): New member.
868 (recheck): Initialize new member.
869 (tail_file): Likewise.
870 (tail_forever): Skip the file if it's marked as ignorable.
872 2000-03-03 Jim Meyering <meyering@lucent.com>
874 * src/sort.c (fillbuf): Move declaration of local, cc, into scope of
875 `while' loop where it's used.
877 2000-03-02 Paul Eggert <eggert@set.twinsun.com>
879 Big performance improvement when sorting many small files,
880 building on a suggestion by Charles Randall.
882 * src/sort.c (fillbuf): Skip memmove if it would be a no-op,
883 as many memmove implementations are slow in that case.
884 Don't examine leftover bytes for eolchar, since they may be left
885 over from a previous file, and we want to read from this file.
887 (sort): At end of file, if there is more input and buffer room,
888 concatenate the next input file.
890 2000-02-29 Jim Meyering <meyering@lucent.com>
892 * src/join.c (make_blank): Add an explicit cast to `unsigned char *'
893 to placate HPUX's C compiler. Reported by Bob Proulx.
895 2000-01-30 Jim Meyering <meyering@lucent.com>
899 * Makefile.maint (my-distcheck): Depend on po-check, so I'll be warned
900 about any required changes at `make distcheck' time rather than at
902 (writable-files): New target.
903 (my-distcheck): Depend on it.
906 * po/POTFILES.in: Add these: lib/makepath.c, lib/rpmatch.c,
909 2000-01-29 Jim Meyering <meyering@lucent.com>
911 * configure.in: Remove lib-check for cposix now that we use
913 (jm_LIB_CHECK): Use this even though the library checks aren't
914 required for this patchage (so all three lib/Makefile.in files
917 2000-01-24 Mark Kettenis <kettenis@gnu.org>
919 * src/tsort.c (exit_status): New variable.
920 (loop): New varibale.
921 (count_items, scan_zeroes): Change return type to int.
922 (detect_loop): Complete rewrite to correctly implement detection
923 of loops. Also change return type to int.
924 (recurse_tree): Stop if ACTION returns non-zero. This involves
925 changing the return type of this function and ACTION to int.
926 (walk_tree): Change return type of ACTION to int.
927 (tsort): Continue sort after a loop has been detected (and
928 broken). Set exit_status to 1 if a loop was detected.
929 (main): Use exit_status to determine exit code.
930 * tests/tsort/basic-1: Change expected output for cycle-1 and
933 2000-01-23 Jim Meyering <meyering@lucent.com>
935 * configure.in (AM_FUNC_STRTOD): Move to m4/.
936 (AC_SUBST(POW_LIBM)): Likewise.
938 2000-01-22 Jim Meyering <meyering@lucent.com>
940 * src/sort.c (keycompare): Use global, hard_LC_COLLATE in place of
941 local that is sometimes undeclared.
943 * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
944 (AC_CHECK_HEADERS): Move these checks into m4/.
946 * src/tr.c ("xstrtol.h"): Include.
947 (Filter): Rename from PFL.
948 (non_neg_strtol): Remove function.
949 (find_bracketed_repeat): Use xstrtoul instead of non_neg_strtol.
950 (squeeze_filter, set_initialize, main): Use size_t and ssize_t in
951 place of long and int in several decls.
952 (read_and_delete, read_and_xlate): Likewise, and remove assertion.
953 * tests/tr/Test.pm: (o-rep-1, o-rep-2): New tests.
955 * src/cut.c: Correct copying notice to use GPL, per author's request.
956 * src/paste.c: Likewise.
959 1999-09-19 Bruno Haible <haible@clisp.cons.org>
961 * src/tr.c (PFI): Return `long', not `int'.
962 (PFL): Rename from PFI now that it returns long.
963 (squeeze_filter): Declare as `long': i, nr, out_len.
965 2000-01-17 Paul Eggert <eggert@twinsun.com>
967 Tweak sort performance.
969 * src/sort.c (hard_LC_CTYPE): Remove.
970 (keylist): Renamed from keyhead. Now a pointer, not a
971 mostly-unused struct. All uses changed.
972 (findlines, keycompare, CMP_WITH_IGNORE, compare, checkfp, mergefps,
973 sort): Tune and use a more consistent style for reallocation.
974 (keycompare, main): Don't worry about LC_CTYPE;
975 it's buggy with multibyte chars anyway.
976 (compare): Invoke alloca (0) after each call to keycompare,
977 not just the ones that return nonzero. This avoids a memory
978 leak on architectures without builtin alloca that occurs
979 sometimes when a file contains all duplicate lines.
981 2000-01-17 Paul Eggert <eggert@twinsun.com>
983 * src/csplit.c (interrupt_handler, main):
984 Don't use SA_INTERRUPT to decide whether to call sigaction, as
985 POSIX.1 doesn't require SA_INTERRUPT and some systems
986 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
987 it's been part of POSIX.1 since day 1 (in 1988).
988 * src/sort.c (sighandler, main): Likewise.
990 2000-01-16 Jim Meyering <meyering@lucent.com>
992 * lib/Makefile.am: Merge with fileutils/lib/Makefile.am.
994 * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_STRFTIME,
995 AC_FUNC_VPRINTF, and AC_FUNC_ALLOCA. Now they're in m4/.
997 2000-01-15 Jim Meyering <meyering@lucent.com>
999 * configure.in (AC_REPLACE_FUNCS): Remove these: memcpy memset stpcpy
1000 strpbrk strtol strtoul. Now that's in m4/.
1002 unexpand could infloop
1003 * src/unexpand.c (TAB_STOP_SENTINEL): Define.
1004 (unexpand): Use it instead of INT_MAX.
1005 Declare column and pending to be `unsigned'.
1006 Increment pending and column counters only if column is smaller
1007 than TAB_STOP_SENTINEL.
1008 * tests/Makefile.am (SUBDIRS): Add unexpand.
1009 * tests/unexpand/basic-1: New tests for the above-fixed bug.
1010 * configure.in (AC_OUTPUT): Add tests/unexpand/Makefile.
1011 Reported by John Kodis.
1013 2000-01-12 Paul Eggert <eggert@twinsun.com>
1015 * src/sort.c (fillbuf): Avoid quadratic behavior with long lines.
1016 Also, stop worrying about ancient memchr bug (misbehavior when
1017 size is zero), since other code doesn't worry either.
1019 2000-01-11 Jim Meyering <meyering@lucent.com>
1021 Sync lib/ directories of sh-utils, and textutils.
1023 * lib/Makefile.am (libfetish_a_SOURCES): Add getdate.y, posixtm.c,
1024 basename.c, canon-host.c, readutmp.c, stripslash.c, xgetcwd.c,
1026 (noinst_HEADERS): Add getdate.h, group-member.h, posixtm.h,
1027 pathmax.h, readutmp.h
1029 * lib/Makefile.am: s/tu/fetish/
1030 * src/Makefile.am: s/libtu/libfetish/
1032 2000-01-10 Jim Meyering <meyering@lucent.com>
1036 * Makefile.maint (announcement): Include URLs for xdelta files.
1037 (alpha): Use scp, not ncftp.
1039 * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
1041 2000-01-08 Jim Meyering <meyering@ascend.com>
1046 * src/cut.c (OUTPUT_DELIMITER_OPTION): Define this and use it
1047 instead of `CHAR_MAX + n'.
1048 * src/pr.c (PAGES_OPTION, COLUMNS_OPTION): Likewise.
1050 2000-01-07 Jim Meyering <meyering@ascend.com>
1052 * tests/tsort/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix
1053 to exported PATH value (though not strictly necessary, here).
1054 * tests/md5sum/Makefile.am: Likewise.
1057 * lib/memcasecmp.c: Use `#if' instead of `#ifdef' for `HAVE_CONFIG_H'.
1058 Capitalize all macro parameters.
1059 (memcasecmp): Ansideclify.
1060 Don't cast away `const'ness of parameters.
1061 * lib/strpbrk.c (strpbrk): Ansideclify.
1062 Use `#if' instead of `#ifdef' for `HAVE_CONFIG_H'.
1063 Suggestions from François Pinard.
1065 2000-01-06 Jim Meyering <meyering@ascend.com>
1067 * tests/tail-2/assert: Tell the user just before sleeping for 7 seconds.
1069 * tests/tail-2/Makefile.am (TESTS): Remove fflush test. It didn't
1070 test the losing behavior, and left a stray tail process to boot.
1072 2000-01-01 Jim Meyering <meyering@ascend.com>
1076 * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in.
1078 1999-12-12 Jim Meyering <meyering@ascend.com>
1080 Move 120+ lines of stat.h-related macros from system.h (not shared)
1081 to sys2.h, which is shared between fileutils, sh-utils, textutils.
1082 * src/system.h: Move them from here...
1083 * src/sys2.h: ... to here.
1085 1999-12-09 Jim Meyering <meyering@ascend.com>
1087 * configure.in (ALL_LINGUAS): Add Galician (gl).
1089 1999-12-06 Jim Meyering <meyering@ascend.com>
1091 * tests/tail-2/fflush: New test for latest change.
1092 * tests/tail-2/Makefile.am (TESTS): Add fflush.
1094 1999-10-26 Marc Boucher <marc@mbsi.ca>
1096 * src/tail.c (main): Flush stdout before switching to unbuffered mode
1097 and calling tail_forever. Required only on Solaris2.7 -- on other
1098 systems, using setvbuf to switch to unbufferd mode does the flush.
1100 1999-11-22 Jim Meyering <meyering@ascend.com>
1102 * lib/Makefile.am (DISTCLEANFILES): Put $(BUILT_SOURCES) here rather
1103 than in $(MAINTAINERCLEANFILES).
1105 * src/tail.c (recheck): Handle a race condition (including <dev,inode>
1106 reuse) that would lead to a failed assertion.
1107 Reported by Ken Pizzini.
1108 (tail_forever): Record errno before using it in call to `error'
1109 which might change it.
1110 (tail_file): Likewise.
1112 New test for the above.
1113 * tests/tail-2/assert: New file.
1114 * tests/tail-2/Makefile.am: New file.
1115 * tests/tail-2: New directory.
1116 * tests/Makefile.am (SUBDIRS): Add tail-2.
1117 * configure.in (AC_OUTPUT): Add tests/tail-2/Makefile.
1119 1999-11-05 Jim Meyering <meyering@ascend.com>
1121 * src/system.h: Use HAVE_STRUCT_STAT_ST_BLKSIZE not HAVE_ST_BLKSIZE.
1123 * configure.in: Move some type/header/member tests into
1124 m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
1125 fileutils, textutils, and sh-utils.
1127 1999-11-04 Paul Eggert <eggert@twinsun.com>
1129 * src/sort.c (SORTALLOC): New macro.
1130 (sortalloc, mergealloc, LINEALLOC): Use it.
1131 (sortalloc, mergealloc, linelength): Now const.
1132 (sortalloc): Increase from 0.5 to 8 MB.
1133 (mergealloc): Increase from 16 to 256 kB.
1134 (LINEALLOC): Increase from 0.25 to 4 MB.
1136 1999-11-03 Paul Eggert <eggert@twinsun.com>
1138 * NEWS, doc/textutils.texi:
1139 Do not consider newline to be part of a line when comparing lines
1140 in `sort' and `comm'. POSIX.2 requires that we consider newline,
1141 but this is a bug in the spec and the bug will likely be fixed.
1142 * src/comm.c (compare_files): Likewise.
1143 * src/sort.c (begfield, limfield, findlines, keycompare, compare):
1145 * tests/sort/Test.pm: Update tests `use-nl' and `11d' to reflect
1148 * lib/linebuffer.c (readline): Do not leave room for an extra
1149 byte after the newline; it's no longer needed.
1150 * src/sort.c: (sortalloc, mergealloc, fillbuf, checkfp, mergefps):
1153 * lib/memcoll.c (memcoll): The two arguments cannot be
1154 adjacent any more, so remove the alloca/copy workaround for
1157 1999-11-03 Jim Meyering <meyering@ascend.com>
1159 Fix so that `tail -fn 2 file' works again.
1160 * src/tail.c (anonymous enum) [LONG_FOLLOW_OPTION]: Define.
1161 (long_options): Use LONG_FOLLOW_OPTION here, instead of 'f'.
1162 (main): Remove the `::' after the `f' in getopt_long string.
1163 Add `case LONG_FOLLOW_OPTION' after `case 'f':'.
1164 Based on a patch from Tim Waugh.
1166 * src/tail.c (anonymous enum) [RETRY_OPTION]: Define.
1167 [MAX_UNCHANGED_STATS_OPTION]: Likewise.
1168 [MAX_CONSECUTIVE_SIZE_CHANGES_OPTION]: Likewise.
1169 [PID_OPTION]: Likewise.
1170 (long_options): Use *_OPTION instead of CHAR_MAX + N.
1173 1999-11-02 Jim Meyering <meyering@ascend.com>
1175 * man/help2man: Import version 1.018.
1176 * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
1177 * man/*.x: Include one-line summary in [NAME] section.
1178 * man/Makefile.summ (cat-summary): Remove now-unused file.
1179 * man/Makefile.am (EXTRA_DIST): Remove Makefile.summ.
1180 * man/Makefile.maint: Include Makefile.summ with leading `-'.
1181 This file is shared by fileutils and sh-utils, both of which still
1182 have the file (albeit nearly empty now).
1183 Suggestion for clean-up from Akim Demaille.
1185 1999-11-01 Jim Meyering <meyering@ascend.com>
1187 * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
1189 1999-10-20 Jim Meyering <meyering@ascend.com>
1191 * src/tail.c (recheck): Don't refuse to tail a non-regular, non-pipe.
1192 (tail_file): Likewise.
1194 1999-10-07 Jim Meyering <meyering@ascend.com>
1196 * configure.in (ALL_LINGUAS): Add Japanese (ja).
1198 1999-10-04 Jim Meyering <meyering@ascend.com>
1200 * depcomp: New file, for automake's new dependency support.
1201 * missing: New version, from automake's user-dep-gen-branch.
1203 1999-09-28 Jim Meyering <meyering@ascend.com>
1205 * src/system.h: Update from the system.h from fileutils.
1207 * lib/error.c (error_at_line): Use strerror portably here, too,
1208 just as was done in error.
1210 1999-09-02 Jim Meyering <meyering@ascend.com>
1212 * src/cut.c: Remove xstrdup declaration.
1213 * src/sort.c: Likewise.
1214 * src/tsort.c: Likewise.
1216 1999-08-22 Jim Meyering <meyering@ascend.com>
1218 * src/tsort.c (detect_loop): There's no loop if k->top is NULL.
1219 Niklas Edmundsson showed how to make tsort segfault.
1221 * tests/tsort/Makefile.am: Rewrite to use Fetish.pm-based framework.
1222 * tests/tsort/basic-1: New file.
1223 Add a few more tests.
1224 * tests/tsort/Test.pm: Remove.
1226 * man/help2man: Escape backslashes so tr's manual comes out right.
1227 Reported by Andreas Schwab.
1229 * src/tsort.c (usage): Correct address for bug reports.
1230 (tsort): Remove trailing `\n' in error format.
1232 * src/md5sum.c (md5_check): Remove trailing `\n' in error format.
1234 * src/sys2.h (IF_LINT): Define new macro.
1235 * src/od.c (dump): Use IF_LINT macro instead of #ifdef lint...
1237 * src/paste.c (paste_parallel): Likewise.
1238 * src/pr.c (read_line): Likewise.
1239 * src/sort.c (checkfp): Likewise.
1240 (mergefps): Likewise.
1242 * src/cksum.c (cksum): Constify a char*.
1243 * src/comm.c (writeline): Likewise.
1245 * src/uniq.c (check_file): Move declarations of local variables
1246 into the scopes where they're used.
1247 (min): Remove macro definition.
1248 (different): Use MIN, not min.
1249 (SWAP_LINES): New macro.
1250 (check_file): Use it here.
1252 * src/uniq.c (check_file): Generate each line of output earlier,
1253 when possible. It is possible when using none of these options:
1254 --count, -repeated, --all-repeated, --unique.
1255 Based on a patch from Ian Turner.
1257 1999-08-15 Jim Meyering <meyering@ascend.com>
1259 * src/tail.c (ENOSYS): Define to a bogus value if not already defined.
1261 1999-08-13 Eli Zaretskii <eliz@is.elta.co.il>
1263 * src/tail.c (parse_options): Warn if --pid=PID is used and kill()
1264 returns ENOSYS (e.g. when compiled with DJGPP).
1266 1999-08-13 Jim Meyering <meyering@ascend.com>
1268 * src/tsort.c (usage): Use consistent bug-reporting address.
1270 * tests/tsort/Test.pm: New file.
1271 * tests/tsort/Makefile.am: New file.
1272 * tests/tsort: New directory.
1273 * tests/Makefile.am (SUBDIRS): Add tsort.
1274 * configure.in (AC_OUTPUT): Add tests/tsort/Makefile.
1276 1999-08-11 Paul Eggert <eggert@twinsun.com>
1278 * doc/textutils.texi: Document how to ignore newline during sort.
1280 1999-08-07 Jim Meyering <meyering@ascend.com>
1282 * po/POTFILES.in: Add lots of lib/*.c files. Remove src/system.h.
1284 1999-08-06 Jim Meyering <meyering@ascend.com>
1288 * src/sort.c: Include file name in `write error' diagnostics.
1289 (write_bytes): Add output_file parameter and use it. Update callers.
1290 (mergefps): Likewise.
1293 Reported by John Summerfield.
1295 1999-08-05 Jim Meyering <meyering@ascend.com>
1297 * src/tail.c (Follow_mode): Remove comma at end of enumerator list.
1298 Reported by Kaveh Ghazi.
1300 * config.sub: Update from autoconf.
1301 * config.guess: Update from autoconf.
1303 1999-08-04 Jim Meyering <meyering@ascend.com>
1307 * configure.in: Remove inadequate getline-testing code. md5sum would
1308 segfault on HPUX because of the getline function in their C library.
1309 Use the AM_FUNC_GETLINE test in m4/ instead.
1311 1999-08-03 Jim Meyering <meyering@ascend.com>
1313 * src/tail.c (tail_forever): When following by name and calling recheck
1314 because of exceeding max_n_consecutive_size_changes_between_opens,
1315 `continue' so we don't fall through and (assuming the file finally grew)
1316 get the erroneous `file truncated' message. This was hard to reproduce.
1318 1999-08-01 Jim Meyering <meyering@ascend.com>
1322 * configure.in (AM_C_PROTOTYPES): Move test to precede a few
1323 header tests -- merely on principle.
1325 1999-08-01 Paul Eggert <eggert@twinsun.com>
1327 * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
1329 1999-07-16 Paul Eggert <eggert@twinsun.com>
1331 * lib/quotearg.c (quotearg_buffer):
1332 Don't quote spaces if C quoting style.
1334 1999-07-31 Jim Meyering <meyering@ascend.com>
1336 * src/tail.c (tail_forever): Don't call kill if pid is 0.
1337 Detect when `writer_is_dead' also when the writer is some other user.
1340 * src/tail.c (parse_options): Warn if --pid=PID is used without -f.
1342 1999-07-30 Jim Meyering <meyering@ascend.com>
1346 * src/tail.c: New option: --pid=PID.
1347 Include signal.h for kill prototype.
1349 (long_options): Add `pid'.
1350 (usage): Describe it.
1351 (tail_forever): Implement it.
1352 (parse_options): Handle the new option and required arg.
1353 Suggestion and pseudo-code from Karl Heuer.
1355 1999-07-27 Jim Meyering <meyering@ascend.com>
1357 * lib/linebuffer.c: Include <sys/types.h> now that linebuffer.h uses
1358 size_t. This is required on at least SunOS4. From Kaveh Ghazi.
1360 1999-07-26 Jim Meyering <meyering@ascend.com>
1362 * src/sys2.h (PID_T_MAX): Define.
1364 * src/tail.c (struct File_spec) [n_stat_calls]: Remove unused member.
1366 1999-07-25 Jim Meyering <meyering@ascend.com>
1368 * src/pr.c (usage): Remove `NEWS'-style paragraph (sorry to have
1369 let that in, translators).
1373 1999-06-01 Volker Borchert <bt@teknon.de>
1375 * tests/Makefile.am: Make envvar-check depend on check-recursive rather
1376 than on `check' so that its tests are performed before any real tests.
1378 1999-07-20 Jim Meyering <meyering@ascend.com>
1380 * configure.in (AC_REPLACE_FUNCS) Remove memmove, now that it's
1381 AC_REPLACE...'d in m4/jm-macros.m4.
1383 * src/wc.c (posixly_correct): Declare global.
1384 (write_counts): Use it to select printf formats.
1385 (main): Set posixly_correct from the POSIXLY_CORRECT envvar.
1388 1999-07-15 Jim Meyering <meyering@ascend.com>
1390 * tests/md5sum/Makefile.am: Revert the 1999-02-15 change.
1391 * tests/md5sum/basic-1, newine-1: Add --text for each individual test.
1392 Reported by Eli Zaretskii.
1394 1999-07-12 Jim Meyering <meyering@ascend.com>
1396 * configure.in (ALL_LINGUAS): Add Slovak (sk).
1398 1999-07-11 Jim Meyering <meyering@ascend.com>
1400 * src/tail.c (recheck): Use assert instead of unnecessary close_fd.
1401 Remove a couple of unnecessary FIXME comments.
1403 1999-07-10 Jim Meyering <meyering@ascend.com>
1405 * doc/textutils.texi: Document new tail options.
1407 * src/tail.c (struct File_spec) [tailable]: Rename from `missing' and
1408 document. Change all uses and locals like was_missing to was_tailable.
1409 Invert expressions as appropriate.
1410 (reopen_inaccessible_files): Rename from allow_missing.
1411 (sleep_interval): Describe.
1412 (--allow-missing): Deprecate.
1413 (--retry): New option, equivalent to --allow-missing.
1414 (usage): Document name vs. descriptor differences.
1415 Refer to manual for descriptions of --max-unchanged-stats=N
1416 and --max-consecutive-size-changes=N.
1417 (valid_file_spec): New function.
1418 (recheck): Assert valid_file_spec.
1419 Remove dead else-if block (suggestion from Eli Zaretskii).
1420 Adjust stmts that set f->tailable -- unlike for `missing', tailable
1421 doesn't depend on errno == ENOENT.
1422 (parse_options): Give a warning if --retry is used when not following
1425 * tests/join/Test.pm: New test case (but commented out) for
1426 Paul's 1999-06-01 fix.
1428 1999-07-09 Jim Meyering <meyering@ascend.com>
1430 * configure.in (ALL_LINGUAS): Add Greek (el).
1432 1999-07-04 Jim Meyering <meyering@ascend.com>
1434 * tests/join/Test.pm: New test case for Paul's 1999-06-03 fix.
1436 1999-07-03 Eli Zaretskii <eliz@is.elta.co.il>
1438 * src/tail.c (struct File_spec): New member, errnum.
1439 (recheck): Record the new value of errno in f->errnum. Don't
1440 output an error message unless the new value of errno differs from
1441 the old one. Output a message if previously-inaccessible file
1443 (tail_forever): Always recheck files whose fd is negative. If the
1444 file cannot be fstat'ed, record the errno value in f[i].errnum.
1445 (tail_file): If the file cannot be open, record the errno value in
1446 f->errnum. If it can be opened, initialize f->errnum to zero. If
1447 it's a non-regular non-fifo file, initialize f->errnum to -1.
1449 1999-06-21 Jim Meyering <meyering@ascend.com>
1451 * doc/textutils.texi: Use lower case characters in sc{} context.
1452 Reported by Eli Zaretskii.
1454 1999-06-03 Paul Eggert <eggert@shade.twinsun.com>
1456 * src/join.c (xfields): Only <blank>s separate fields, not <space>s.
1458 1999-06-01 Paul Eggert <eggert@twinsun.com>
1460 * lib/linebuffer.c (readline): Leave room for an extra byte
1461 after the newline; comm needs this for memcoll.
1463 1999-06-01 Paul Eggert <eggert@twinsun.com>
1465 Add LC_COLLATE support to `join'.
1467 * doc/textutils.texi: Describe join and LC_COLLATE.
1469 * src/join.c: Add support for LC_COLLATE locale.
1470 Include hard-locale.h, linebuffer.h, memcoll.h.
1471 (struct line): New member `buf', replacing `beg' and `lim'.
1473 (hard_LC_COLLATE): New var.
1474 (main): Initialize it.
1475 (get_line): Use readline to read the line,
1476 instead of doing it by hand.
1477 That way, we get a buffer that we can pass to memcoll.
1478 (keycmp): Use memcoll to compare lines if hard_LC_COLLATE is nonzero.
1480 1999-05-27 Volker Borchert <bt@teknon.de>
1482 * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
1484 1999-05-25 Paul Eggert <eggert@twinsun.com>
1486 Add LC_COLLATE support to `comm', so that `comm' is compatible
1487 with `sort' in nontrivial locales.
1489 * doc/textutils.texi: Document locale-specific mode for comm.
1491 * lib/Makefile.am (libtu_a_SOURCES): Add hard-locale.c, memcoll.c.
1492 (noinst_HEADERS): Add hard-locale.h, memcoll.h.
1494 * src/comm.c: Include hard-locale.h, memcoll.h.
1495 (hard_LC_COLLATE): New variable.
1496 (compare_files): Use memcoll to compare if hard_LC_COLLATE.
1497 (main): Initialize hard_LC_COLLATE from locale.
1499 * src/sort.c: Include hard-locale.h, memcoll.h.
1500 (hard_LC_COLLATE, hard_LC_CTYPE, hard_LC_TIME): New variables,
1501 replacing `need_locale'.
1502 (memcoll): Move to lib/memcoll.c.
1503 (keycompare): No need to alloc (0), since our caller now does it.
1504 (compare): alloca (0) before returning.
1505 (my_setlocale): Remove; hard_locale now dows this.
1506 (main): Invoke setlocale, bindtextdomain, and textdomain before
1507 invoking anything that might print an error.
1508 Use hard_locale to determine which locales are hard.
1510 * lib/hard-locale.c, lib/hard-locale.h, lib/memcoll.c, lib/memcoll.h:
1513 1999-05-25 Paul Eggert <eggert@shade.twinsun.com>
1515 * lib/linebuffer.c (readline):
1516 Append trailing newline to line.
1518 [struct linebuffer] (size): Declare to be of type size_t, not long.
1519 [struct linebuffer] (length): Likewise.
1520 * src/comm.c, (writeline): Lines now contain trailing newline.
1521 * src/uniq.c (find_field, different): Use size_t, not int, for lengths.
1522 (writeline): Lines now contain trailing newline.
1523 (check_file): Use size_t, not int, for lengths.
1524 * src/nl.c (proc_text, check_section, main): More of the same.
1526 * lib/linebuffer.h (struct linebuffer): Use size_t for sizes.
1527 src/nl.c (header_del_len, body_del_len, footer_del_len, main):
1529 src/uniq.c (find_field, different, check_file): Likewise.
1531 * lib/linebuffer.c (readline): Silently append trailing
1532 newline if needed. Do not bother setting buffer length to 0
1533 at EOF, since it's not part of the spec and nobody relies on
1534 it. Do not compute the difference between unrelated pointers.
1536 1999-05-25 Paul Eggert <eggert@twinsun.com>
1538 * src/tac.c (memrchr): Ifdef out this unused function.
1540 1999-05-25 Jim Meyering <meyering@ascend.com>
1542 * doc/textutils.texi (Squeezing): Remove misleading square brackets
1543 from SET1 in the one-word-per-line example.
1545 1999-05-22 Jim Meyering <meyering@ascend.com>
1547 * lib/Makefile.am (libtu_a_SOURCES): Remove memchr.c.
1548 From Ulrich Drepper.
1552 1999-05-22 Paul Eggert <eggert@twinsun.com>
1554 * doc/textutils.texi: Document locale-specific changes to `sort',
1555 as well as the new, POSIX-compliant definition of line comparison,
1556 and -g's more careful treatment of NaNs, infinities and zeros.
1558 * src/sort.c (general_numcompare): Put exceptional cases
1559 first, not last, to be consistent with -M.
1561 1999-05-21 Paul Eggert <eggert@twinsun.com>
1563 * src/sort.c (strtod): Declare if STDC_HEADERS is not defined.
1564 (general_numcompare): Use strtod, not xstrtod.
1565 Do not consider partial conversions to be errors.
1566 Put -infinity at the start, and +infinity at the end;
1567 follow +infinity with NaNs (sorted by bit pattern),
1568 and finally by conversion errors.
1570 1999-05-21 Jim Meyering <meyering@ascend.com>
1572 * tests/sort/Test.pm (11d): Reverse lines in expected output
1573 to reflect latest change.
1574 (use-nl): New test from Paul Eggert.
1576 1999-05-20 Paul Eggert <eggert@twinsun.com>
1578 * src/sort.c: Treat the trailing newline as part of the line,
1579 as required by POSIX.2.
1581 (struct line, findlines, compare, checkfp, mergefps, sort):
1582 A line now includes its trailing newline.
1583 (findlines): Do not replace newline with NUL.
1584 (memcoll, keycompare): Work even if the data to be compared are
1585 adjacent strings; this is possible now that lines contain the
1587 (fillbuf): Always have an unused byte at the end of the buffer,
1588 since memcoll and keycompare want to modify a byte after the last line.
1589 (sortalloc, mergealloc): Increase by 1, for trailing byte.
1591 1999-05-20 Jim Meyering <meyering@ascend.com>
1593 * tests/sort/Test.pm: Add test case from Paul Eggert.
1595 1999-05-20 Paul Eggert <eggert@twinsun.com>
1597 * src/sort.c (keycompare): Ignore any length difference if the
1598 localized comparison says the strings are equal.
1600 * src/sort.c (memcoll, keycompare, compare): Handle NUL
1601 characters properly when comparing with LC_COLLATE semantics.
1602 (NLS_MEMCMP): Remove.
1603 (memcoll): Renamed from strncoll.
1604 Take separate lengths for each string.
1605 This function is now invoked only when need_locale.
1606 (keycompare): Don't copy strings when ignore and translate
1609 1999-05-18 Paul Eggert <eggert@twinsun.com>
1611 * src/sort.c (MONTHTAB_CONST): Renamed from NLS_CONST; the use
1612 is also changed. Define to const also if !HAVE_NL_LANGINFO.
1614 (usage): `,' -> `;' (English typo).
1616 1999-05-17 Eli Zaretskii <eliz@is.elta.co.il>
1618 * src/cat.c (main): When stdout is in binary mode, make sure all
1619 input files are also read in binary mode.
1621 1999-05-16 Jim Meyering <meyering@ascend.com>
1625 1999-05-11 Paul Eggert <eggert@twinsun.com>
1627 * src/sort.c: Don't autodetect the locale of numbers and
1628 months, as this conflicts with POSIX.2 and is tricky to boot.
1630 (FLOATING_COMMA, NLS_STRNCMP, NLS_MAX_GROUPS,
1631 NLS_ONE_CHARACTER_STRING): Remove macros no longer used.
1633 (nls_grouping, nls_fraction_found, nls_month_found, nos_monthtab,
1634 nls_months_collide, nls_keyhead, us_monthtab): Remove variables no
1637 (struct nls_keyfield): Remove types no longer used.
1639 (strncoll_s2_readonly, nls_set_fraction, look_for_fraction,
1640 nls_month_is_either_locale, nls_numeric_format): Remove functions no
1643 (monthtab): Now has the role that us_monthtab had, but it's const only
1644 if ENABLE_NLS is not defined.
1646 (C_DECIMAL_POINT): Renamed from FLOATING_POINT. All uses changed.
1647 (MONTHS_PER_YEAR): Renamed from NLS_NUM_MONTHS. All uses changed.
1648 (struct_month_cmp): Renamed from nls_sort_month_comp. All uses changed.
1649 Use strcmp, not strcoll, since the user doesn't care about collating
1652 (inittables): Read locale data into monthtab, rather than modifying a
1653 separate month table and futzing with indirection. Do not worry about
1654 colliding months, since we no longer autodetect month locale.
1656 (fraccompare): Don't set no-longer-used variable nls_fraction_found.
1658 (getmonth): Use strncmp to compare months, since user doesn't care
1659 about collating here. Fix bug where code incorrectly assumed that
1660 strlen (monthtab[lo].name) == strlen (monthtab[ix].name).
1662 (keycompare, main): Don't autodetect month locale.
1664 (compare): Don't use NLS_MEMCP in code that can't be executed if
1665 need_locale is false, as NLS_MEMCP is equivalent to memcmp in that
1668 (sort, insertkey, main): Don't autodetect numeric locale.
1670 1999-05-15 Jim Meyering <meyering@ascend.com>
1672 * tests/join/Test.pm (trailing-sp): New test for this fix.
1673 * src/join.c (xfields): Don't interpret a trailing blank as a
1674 delimiter when e.g. -t: was specified. From Tim Smithers.
1676 1999-05-12 Jim Meyering <meyering@ascend.com>
1678 * tests/Makefile.am (envvar-check): Renamed from check-local.
1679 (check): Depend on envvar-check so the envvar check is performed
1680 before all other tests. Reported by Volker Borchert.
1681 * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
1682 so CDPATH is mentioned in the message. Reported by Volker Borchert.
1684 1999-05-11 Jim Meyering <meyering@ascend.com>
1686 * src/sort.c (usage): Split the --help message into two pieces so that
1687 neither is longer than 2048. For Irix4's cc. Reported by Kaveh Ghazi.
1689 1999-05-09 Jim Meyering <meyering@ascend.com>
1691 * lib/regex.c: Update from libc.
1695 * Makefile.maint (alpha): Put the announcement in
1696 /tmp/announce-$(distdir)
1698 * tests/sort/Test.pm (neg-nls): New test.
1700 1999-05-08 Jim Meyering <meyering@ascend.com>
1702 * src/system.h (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM,
1703 and all the *_MIN and *_MAX symbols): Remove definitions.
1704 * src/sys2.h: Put the definitions here instead (this file is shared
1705 between all three *utils packages, while system.h is not).
1707 1999-05-06 Paul Eggert <eggert@twinsun.com>
1709 * src/sort.c (fraccompare, numcompare): Merge the NLS and
1710 non-NLS versions into a single function.
1712 (decimal_point): Now char, since we no longer convert to unsigned
1714 (th_sep): Now int, since we use a value out of char range to denote
1715 the absence of a thousands separator.
1716 (IS_THOUSANDS_SEP): New macro.
1717 (USE_NEW_FRAC_COMPARE): Remove.
1718 (nls_set_fraction): Arg is now char, not unsigned char.
1719 Set th_sep to CHAR_MAX + 1 if there is no thousands separator.
1720 (numcompare): Don't convert to unsigned char unless necessary.
1721 (main): Turn off decimal points and thousand separators if they
1722 are multibyte characters, as we don't support that yet.
1724 1999-05-06 Paul Eggert <eggert@twinsun.com>
1726 * src/system.h (CHAR_MIN, CHAR_MAX): New macros.
1727 (SCHAR_MIN, SCHAR_MAX): Don't assume that char is signed.
1729 1999-05-06 Paul Eggert <eggert@twinsun.com>
1731 * src/sort.c (numcompare): Handle comparison of two negative
1732 numbers correctly in the ENABLE_NLS case.
1734 1999-05-04 Jim Meyering <meyering@ascend.com>
1736 * src/pr.c (usage): Break the usage message into 3 pieces instead of
1737 only 2. The strings had grown to be longer than 2048, which evokes
1738 errors when compiling with Irix4's cc. Reported by Kaveh Ghazi.
1740 * src/tsort.c (search_item): Use `1' instead of `+1'. The latter
1741 elicits a syntax error from SunOS4's cc. From Kaveh Ghazi.
1743 1999-05-03 Jim Meyering <meyering@ascend.com>
1745 * src/ptx.c <ctype.h>: Don't include.
1746 [!STDC_HEADERS]: Remove definitions of ctype macros.
1747 Convert e.g., isspace to ISSPACE to use definitions from sys2.h.
1748 Reported by Kaveh Ghazi.
1750 * src/sys2.h (TOLOWER): Define.
1752 * src/join.c (TOLOWER): Remove definition.
1753 * src/md5sum.c: (TOLOWER): Remove definition.
1755 1999-04-30 Jim Meyering <meyering@ascend.com>
1757 * src/sort.c (usage): Document the differences between the
1758 obsolescent, +POS1[-POS2] form, and the POSIX -k option.
1760 1999-04-24 Jim Meyering <meyering@ascend.com>
1762 * configure.in: Use AC_CANONICAL_HOST.
1764 * lib/Makefile.am (libtu_a_SOURCES): Add xstrtoumax.c
1765 (noinst_HEADERS): Remove xstrtoul.h.
1767 * src/csplit.c: Include new "xstrtol.h", not "xstrtoul.h".
1768 (struct control) [repeat]: Declare as uintmax_t, not int.
1769 (struct control) [lines_required]: Likewise.
1770 (handle_line_error): Use human_readable to print lines_required.
1771 (parse_repeat_count): Parse a uintmax_t.
1772 (parse_patterns): Parse a uintmax_t.
1774 * src/tail.c: Include new "xstrtol.h", not "xstrtoul.h".
1775 * src/od.c: Likewise.
1777 * src/head.c: Include new "xstrtol.h", not "xstrtoul.h".
1778 Change all U_LONG_LONG to uintmax_t.
1779 (head_lines): Move a couple dcls into an inner scope.
1780 (string_to_integer): Rename from string_to_ull.
1782 1999-04-19 Jim Meyering <meyering@ascend.com>
1784 * Makefile.maint (b_host): Remove /pub suffix.
1786 1999-04-18 Jim Meyering <meyering@ascend.com>
1790 * Makefile.maint (my-distcheck): Use AMTAR, not TAR.
1792 * src/sort.c (usage): s/DIRECT/DIRECTORY/g
1793 Rename global: s/temp_file_prefix/temp_dir/.
1794 (NAME_MAX_IN_DIR): Rename from PATH_MAX_IN_DIR. Use _POSIX_NAME_MAX,
1795 not _POSIX_PATH_MAX. Guard with #if HAVE_PATHCONF rather than
1797 (tempname): Wrap after 99999 only for length-impaired file systems.
1799 1999-04-17 Jim Meyering <meyering@ascend.com>
1801 * src/tail.c (file_lines): Fix serious bug introduced with last changes.
1802 From Andreas Schwab.
1804 1999-04-15 Jim Meyering <meyering@ascend.com>
1806 * tests/Makefile.am (EXTRA_DIST): Rename .posix-warn to .env-warn.
1807 (check-local): Warn about CDPATH in the same way
1808 we warn about POSIXLY_CORRECT, since the cp/same-file test fails at
1809 least when using bash with CDPATH set. Reported by Mark Hewitt.
1811 * src/pr.c Add comments.
1812 (init_header): Tweak white space in Date/Time header.
1813 * tests/pr/Test.pm: Updated all tests to reflect the big
1814 1999-02-13 change. From Roland Huebner.
1816 1999-04-12 Jim Meyering <meyering@ascend.com>
1818 * src/cat.c (main): Declare out_dev to be of type dev_t, not `int'.
1819 Declare out_ino to be of type ino_t, not `int'.
1822 * src/od.c (MIN, MAX): Remove definitions.
1823 * src/sys2.h (MIN, MAX): Define here instead.
1824 Reported by John Bley.
1826 1999-04-11 Jim Meyering <meyering@ascend.com>
1830 * tests/pr/Test.pm (test_vector): Disable all tests while I wait for
1833 Fix the problem whereby `yes > k & sleep 1; tail -2c k' would infloop.
1834 * src/tail.c (COPY_TO_EOF): Define.
1835 (dump_remainder): Add parameter, n_bytes, and rewrite to use it.
1837 (file_lines): Rename parameter.
1838 (tail_bytes): Remove obsolete comment.
1840 Fix the problem whereby `yes > k & sleep 1; tail -1 k' would infloop.
1841 * src/tail.c (dump_remainder): Move this function to precede the
1842 new use in file_lines.
1843 (tail_lines): Don't call dump_remainder here.
1844 (file_lines): Call dump_remainder here instead.
1845 Reported by Lehti Rami.
1847 * lib/readtokens.c (readtoken, readtokens): Protoize.
1849 1999-04-10 Jim Meyering <meyering@ascend.com>
1851 * src/tail.c (xwrite): Use STDOUT_FILENO instead of literal `1'.
1853 1999-04-04 Jim Meyering <meyering@ascend.com>
1855 * src/cat.c: Standardize --help and --version processing.
1856 * src/comm.c: Likewise.
1857 * src/csplit.c: Likewise.
1858 * src/cut.c: Likewise.
1859 * src/expand.c: Likewise.
1860 * src/fmt.c: Likewise.
1861 * src/fold.c: Likewise.
1862 * src/head.c: Likewise.
1863 * src/join.c: Likewise.
1864 * src/md5sum.c: Likewise.
1865 * src/nl.c: Likewise.
1866 * src/od.c: Likewise.
1867 * src/paste.c: Likewise.
1868 * src/pr.c: Likewise.
1869 * src/ptx.c: Likewise.
1870 * src/split.c: Likewise.
1871 * src/sum.c: Likewise.
1872 * src/tac.c: Likewise.
1873 * src/tail.c: Likewise.
1874 * src/tr.c: Likewise.
1875 * src/unexpand.c: Likewise.
1876 * src/uniq.c: Likewise.
1877 * src/wc.c: Likewise.
1879 1999-03-29 Jim Meyering <meyering@ascend.com>
1881 * configure.in (GNU_PACKAGE): Remove related code -- now it's in
1882 the catch-all for shared autoconf code, m4/jm-macros.m4.
1883 (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
1886 1999-03-26 Jim Meyering <meyering@ascend.com>
1888 * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
1889 (noinst_HEADERS): Add version-etc.h.
1891 1999-03-25 Jim Meyering <meyering@ascend.com>
1893 * src/tail.c (recheck): Factor out a block of duplicated code.
1894 Set f->size to 0 upon encountering a new file so we read it from
1895 the beginning rather than from then end of the first line or
1896 block. Otherwise, after a log rotation, tail would omit the first
1897 line or block of the new file. Reported by Ed Avis.
1899 1999-03-20 Jim Meyering <meyering@ascend.com>
1901 * tests/Makefile.am (SUBDIRS): Temporarily remove pr.
1903 1999-03-13 Jim Meyering <meyering@ascend.com>
1905 * src/tac.c: (tac_mem): `#if-0'-out this unused function.
1906 (tac_stdin_to_mem): Likewise.
1908 * doc/textutils.texi (cut invocation): Describe --output-delimiter.
1910 1999-03-12 Jim Meyering <meyering@ascend.com>
1912 * src/sys2.h (SETVBUF): Define new macro.
1913 * src/tail.c (dump_remainder): Don't fflush stdout here.
1914 (main) [if forever]: Make stdout unbuffered, instead.
1915 Akim Demaille pointed out that when running `echo x>a; tail -f a>>a' ,
1916 the file `a' didn't grow longer than two lines. Now it grows
1919 1999-03-07 Jim Meyering <meyering@ascend.com>
1921 * tests/md5sum/newline-1: Test for the actual feature.
1922 With help from Eli Zaretskii.
1924 * src/pr.c (usage): Add missing \n\.
1926 The newline test would always fail on MSDOS/Windows systems --
1927 so move it to a separate file where we can test for that.
1928 * tests/md5sum/basic-1: Remove newline test.
1929 * tests/md5sum/newline-1: New file.
1930 * tests/md5sum/Makefile.am (TESTS): Add newline-1.
1931 Pointed out by Eli Zaretskii.
1933 1999-02-13 Roland Huebner <rh@pelikan.cologne.de>
1935 (main): Redefine options -s, -w to be POSIX compliant; introduce
1936 new options -J, -S, -W to disentangle -s and -w when used together
1937 with the three column options;
1938 (add_line_number): Make POSIX compliant; use default number
1939 separator TAB with single column output.
1940 (add_line_number): Make POSIX compliant; with multicolumn output
1941 now prefer `text columns of equal width' rather than a consequent
1942 use of `default n-separator TAB'.
1943 (add_line_number): Change line number cut-off from lower-oder to
1944 higher-oder digit to avoid loss of information; no consequent
1945 handling exists in different utilities and other UNIXes.
1946 (char_to_clump): Expand input text tabs to 8 spaces, if
1947 input_tab_char doesn't equal TAB (adapted to other UNIXes).
1948 (usage): Update POSIX compliant options -s, -w; add new options -J,
1950 (main): Update the source internal documentation.
1951 Some smaller BUGFIXES (print_sep_string, init_header, skip_to_page,
1952 reset_status, print_header).
1954 * tests/md5sum/basic-1 (backslash): Use .\foo instead of \.foo so we
1955 don't tramp on root directory in MSDOS/Windows.
1956 Suggestion from Eli Zaretskii.
1958 1999-02-15 Eli Zaretskii <eliz@is.elta.co.il>
1960 * tests/md5sum/Makefile.am (TESTS_ENVIRONMENT): Run md5sum with the
1961 --text option (for MSDOS).
1963 1999-03-06 Jim Meyering <meyering@ascend.com>
1965 * src/cut.c (getstr): Change type of `delim' parameter from char to int.
1966 (cut_fields): Cast to `unsigned char' before comparing.
1967 (main): Cast to `unsigned char' before assigning.
1969 * tests/cut/Test.pm: Add a test to exercise the bug.
1971 * src/ptx.c (swallow_file_in_memory): Use a `%s' format in error call,
1972 in case the argument string contains a `%'.
1974 * src/fmt.c (main): Likewise.
1975 * src/sort.c (main): Likewise.
1977 1999-02-13 Eli Zaretskii <eliz@is.elta.co.il>
1979 * src/sys2.h [__DJGPP__]: Include <io.h> and <sys/exceptn.h>.
1981 * src/ptx.c (swallow_file_in_memory): Slurp up the whole file at
1982 once on MSDOS as well, but we have to relax the test for whether
1983 reading it succeeded.
1985 1999-03-03 Jim Meyering <meyering@ascend.com>
1987 * src/cat.c: Include long-options.h
1988 [long_options]: Remove the "help" and "version" entries.
1989 Remove declarations of show_help and show_version.
1990 (main): Use parse_long_options, including author name(s).
1991 Remove the show_version and show_help blocks.
1992 * src/cksum.c: Likewise.
1993 * src/comm.c: Likewise.
1994 * src/csplit.c: Likewise.
1995 * src/cut.c: Likewise.
1996 * src/expand.c: Likewise.
1997 * src/fmt.c: Likewise.
1998 * src/fold.c: Likewise.
1999 * src/head.c: Likewise.
2000 * src/nl.c: Likewise.
2001 * src/od.c: Likewise.
2002 * src/paste.c: Likewise.
2003 * src/pr.c: Likewise.
2004 * src/split.c: Likewise.
2005 * src/sum.c: Likewise.
2006 * src/tac.c: Likewise.
2007 * src/tail.c: Likewise.
2008 * src/tr.c: Likewise.
2009 * src/unexpand.c: Likewise.
2010 * src/uniq.c: Likewise.
2011 * src/wc.c: Likewise.
2013 * src/ptx.c: Include long-options.h
2014 [long_options]: Remove the "help" and "version" entries.
2015 Remove declarations of show_help and show_version.
2016 (main): Remove `const' attribute from dcl of argv parameter.
2017 Call bindtextdomain and textdomain.
2018 Use parse_long_options, including author name(s).
2019 Remove the show_version and show_help blocks.
2021 * src/join.c (main): Include author name argument in call to
2023 * src/md5sum.c (main): Likewise.
2024 * src/sort.c (main): Likewise.
2025 * src/tsort.c (main): Likewise.
2027 1999-02-07 Jim Meyering <meyering@ascend.com>
2031 * Makefile.maint (my-distcheck): Don't depend on dist, now that this
2032 is hooked up to the distcheck rule.
2033 * Makefile.am (distcheck-hook): New target and rule -- link to shared
2034 rule, my-distcheck, in Makefile.maint.
2036 1999-01-31 Jim Meyering <meyering@ascend.com>
2038 * doc/textutils.texi: Wrap the @top node in @ifnottex instead of
2039 @ifinfo so `makeinfo --html ...' works. From Karl Berry.
2041 1999-01-30 Jim Meyering <meyering@ascend.com>
2043 * acconfig.h: Remove lots of `#undef's, now that we use the
2044 3-argument forms of AC_DEFINE* macros.
2046 * configure.in: Require autoconf 2.13.
2047 Use 3-argument form of AC_DEFINE*.
2049 1999-01-24 Jim Meyering <meyering@ascend.com>
2051 * src/tac.c (DONT_UNLINK_WHILE_OPEN) [__MSDOS__ || _WIN32]: Define.
2053 * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
2054 (and hence that of the local `n1', too) to `int' at Paul's request.
2056 1999-01-18 Akim Demaille <demaille@inf.enst.fr>
2058 * doc/textutils.texi: Harmonization of @samp use for options.
2060 1999-01-17 Jim Meyering <meyering@ascend.com>
2062 * Makefile.am (SUBDIRS): Add djgpp.
2063 * configure.in (AC_OUTPUT): Add djgpp/Makefile.
2064 * djgpp/: New directory.
2066 * man/Makefile.maint ($(man_MANS)): Don't remove the target (the
2067 man page) until after we've created its replacement.
2069 1999-01-16 Eli Zaretskii <eliz@is.elta.co.il>
2071 * GNUmakefile: Add SHELL = /bin/sh.
2072 * man/GNUmakefile: Likewise.
2074 1999-01-16 Jim Meyering <meyering@ascend.com>
2076 * acconfig.h: Remove @BOTTOM@ section.
2077 Instead, add the define and decl via m4/jm-macros.m4.
2079 * lib/argmatch.h (XARGMATCH): Define to return a value once again.
2080 (XARGCASEMATCH): Likewise.
2082 * lib/argmatch.c (EXIT_FAILURE): Define.
2083 (ARGMATCH_DIE): Provide default.
2084 (__xargmatch_internal): New function.
2085 s/rogram_name/program_name.
2088 1999-01-14 Jim Meyering <meyering@ascend.com>
2090 * tests/md5sum/basic-1: Use `f', not `x' as temp. file name to avoid
2091 warnings from perl5.004.
2092 Reported by Volker Borchert.
2094 * lib/long-options.c (parse_long_options): Rename `usage' parameter
2095 to avoid shadowing globally scoped function.
2097 1999-01-14 Akim Demaille <demaille@inf.enst.fr>
2099 * acconfig.h: Add a @BOTTOM@ section.
2100 (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
2102 * src/*.c: Don't prototype usage as static.
2104 1999-01-10 Jim Meyering <meyering@ascend.com>
2108 All of the following new code is protected by
2109 `#if DONT_UNLINK_WHILE_OPEN'
2110 * src/tac.c (file_to_remove): New global.
2111 (fp_to_close): New global.
2112 (unlink_tempfile): New function.
2113 (record_tempfile): New function.
2114 (save_stdin): Call record_tempfile.
2116 (main): Use SET_BINARY and SET_BINARY2.
2119 1999-01-09 Jim Meyering <meyering@ascend.com>
2121 * tests/uniq/Test.pm: Add tests from Jochen Hein.
2122 * src/uniq.c: New option: --all-repeated (-D).
2123 (output_all_repeated) [output_mode]: New enum value.
2124 (usage): Describe it.
2125 (writeline): Test for new mode.
2126 (check_file): Likewise.
2127 Based on patches from Jochen Hein and Florin Iucha.
2128 (main): Diagnose `too many arguments'.
2130 * tests/head/Test.pm (null-1): Add test from Jochen Hein.
2132 * src/tail.c (parse_obsolescent_option): Interpret `number' as decimal.
2133 (parse_options): Likewise.
2134 Reported by Kamal Paul Nigam.
2136 * src/tail.c: New option: --max-unchanged-stats=N.
2137 New option: --max-n-consecutive-size-changes=N.
2139 1999-01-03 Jim Meyering <meyering@ascend.com>
2141 * src/md5sum.c (usage): Remove third program_name argument -- there
2142 were only two `%s' in the format string.
2144 1999-01-02 Jim Meyering <meyering@ascend.com>
2146 * src/tsort.c (tsort): Use a single call to error instead of two
2148 (main): Remove `%s: ' prefix on format string.
2150 * src/tail.c (parse_options): Use XARGMATCH in place of argmatch.
2152 * src/ptx.c (format_vals): New array.
2153 (main): Use XARGMATCH in place of argmatch.
2155 * lib/argmatch.h (XARGMATCH): Don't return a value; instead,
2156 modify a parameter. Add a `Die_stmt' parameter.
2158 * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
2159 (argmatch_to_argument): Add `const' attribute to first parameter.
2161 1999-01-01 Jim Meyering <meyering@ascend.com>
2163 * src/tsort.c: Move inclusion of assert.h to follow that of stdio.h.
2164 Some losing systems require this.
2165 Use STREQ macro instead of strcmp in a few places.
2167 * po/POTFILES.in: Add tsort.c.
2169 * man/Makefile.maint ($(man_MANS)): `exit 1' if any of help2man,
2170 chmod, or mv fails. Otherwise, the failure could go unnoticed.
2172 * man/Makefile.summ: Add entries for ptx and tsort.
2174 * src/tsort.c: Include readtokens.h.
2175 (zeros): Rename global from `rr'.
2176 (getstr): Remove function.
2177 (tsort) Use readtoken instead of getstr.
2179 * lib/readtokens.c: New file.
2180 * lib/readtokens.h: New file.
2181 * lib/Makefile.am (libtu_a_SOURCES): Add readtokens.c.
2182 (noinst_HEADERS): Add readtokens.h.
2184 * man/Makefile.am (man_MANS): Add ptx.1.
2185 * man/ptx.x: New file.
2187 * src/tail.c (parse_options): Use XARGMATCH in place of argmatch.
2189 * man/Makefile.am (man_MANS): Add tsort.1.
2190 * man/tsort.x: New (essentially empty) file.
2192 * src/tsort.c: Rename globals N and R so they don't shadow locals.
2193 (tsort): Rename from `sort'.
2195 1998-11-07 Mark Kettenis <kettenis@phys.uva.nl>
2196 * src/Makefile.am (bin_PROGRAMS): Add tsort.
2197 * src/tsort.c: New program.
2199 * lib/Makefile.am (libtu_a_SOURCES): Add quotearg.c.
2200 (noinst_HEADERS): Add quotearg.h.
2202 ============================
2203 All of the following are from:
2204 1998-04-17 Eli Zaretskii <eliz@is.elta.co.il>
2206 * src/system.h (SET_BINARY, SET_BINARY2, fileno, setmode): New
2209 * src/cat.c (usage) [O_BINARY]: Describe -B,--binary option.
2210 (main) [O_BINARY]: binary_files, binary_output, file_open_mode:
2211 new variables. Add --binary to long_options[]. Switch stdin and
2212 stdout to binary mode unless file contents are not important
2213 anyway. Open files in binary mode when required.
2215 * src/cksum.c (cksum) [O_BINARY]: Read redirected stdin in binary
2218 * src/expand.c (expand): Use binary I/O where appropriate.
2220 * src/head.c (head_bytes, head_lines) [O_BINARY]: Use binary I/O.
2222 * src/md5sum.c (OPENOPTS) [O_BINARY]: Use binary I/O when non-zero
2224 (md5_file) [O_BINARY]: Switch redirected stdin to binary mode.
2225 (main) [O_BINARY]: Use binary reads by default on those systems
2226 which care about the difference.
2228 * src/od.c (skip, read_char, read_block) [O_BINARY]: Switch input
2229 stream to binary mode.
2231 * src/sort.c (PATH_MAX_IN_DIR) [HAVE_UNISTD_H]: New macro, for max
2232 file name characters in a given directory.
2233 (tempname): Make sure the temp file name is unique even if long
2234 file names aren't supported.
2236 * src/split.c (cwrite) [O_BINARY]: Write output in binary mode.
2237 (main) [O_BINARY]: Read input in binary mode.
2239 * src/sum.c (bsd_sum_file, sysv_sum_file) [O_BINARY]: Read input
2242 * src/tac.c (record_tempfile, unlink_tempfile)
2243 [DONT_UNLINK_WHILE_OPEN]: New functions, for systems where a file
2244 cannot be removed before it is closed.
2245 (save_stdin) [DONT_UNLINK_WHILE_OPEN]: Record the temporary file,
2246 to be removed before exit.
2247 (tac_file, save_stdin, main): Use binary I/O when appropriate.
2249 * src/tail.c (tail_lines, tail_bytes) [O_BINARY]: Use binary I/O
2252 * src/tr.c (main) [O_BINARY]: Use binary I/O when appropriate.
2254 * src/unexpand.c (unexpand): Use binary I/O where appropriate.
2256 * src/wc.c (wc): Use binary mode for input.
2258 * doc/textutil.texi: Add comments about peculiarities of Textutils
2259 operation on MS-DOS/MS-Windows.
2261 1998-12-22 Jim Meyering <meyering@ascend.com>
2263 * configure.in (ALL_LINGUAS): Add chinese (zh).
2265 1998-12-17 Jim Meyering <meyering@ascend.com>
2267 New options for tail:
2268 --follow=name, --follow=descriptor, --allow-missing
2269 * src/tail.c (Follow_mode): New enum.
2270 (n_live_files): New function.
2271 (tail_forever): Avoid starvation with --follow=name and a
2272 continually-growing unlinked or renamed file.
2274 1998-12-13 Jim Meyering <meyering@ascend.com>
2276 * tests/uniq/Test.pm: New file.
2277 * tests/uniq/Makefile.am: New file.
2278 * tests/uniq: New directory.
2279 * tests/Makefile.am (SUBDIRS): Add uniq.
2280 * configure.in (AC_OUTPUT): Add tests/uniq/Makefile.
2283 * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
2285 (EXTRA_DIST): Add xstat.in.
2286 * lib/stat.c: Remove file.
2287 * lib/lstat.c: Remove file.
2288 * lib/xstat.in (xstat@): New file.
2290 * configure.in (ALL_LINGUAS): Add Russian (ru).
2292 1998-10-31 Jim Meyering <meyering@ascend.com>
2294 * acconfig.h (stat): New #undef.
2296 1998-10-22 Jim Meyering <meyering@ascend.com>
2298 * src/fold.c (usage): Add mention of --version and --help.
2299 Reported by Matej Vela <mvela@public.srce.hr>.
2301 1998-10-04 Jim Meyering <meyering@ascend.com>
2303 * lib/fnmatch.h: New file. (unused)
2304 * lib/fnmatch.c: New file. (unused)
2305 * lib/Makefile.am (noinst_HEADERS): Add fnmatch.h.
2307 1998-10-03 Jim Meyering <meyering@ascend.com>
2309 * man/Makefile.am: Switch to using help2man.
2310 (EXTRA_DIST): Add Makefile.summ.
2312 * man/help2man: Invoke program with --manhelp option only if
2313 --name=STRING not specified. Otherwise, this would fail with `yes'.
2314 * man/Makefile.summ: New file.
2315 * man/Makefile.maint: Include it.
2316 * man/help2man: New file.
2317 * man/GNUmakefile: New file.
2318 * man/Makefile.maint: New file.
2319 * man/*.x: New files.
2320 * man/*.1: Remove files.
2322 * src/md5sum.c (split_3): Rename local variable, to `escaped_filename'.
2323 (main): Output the leading backslash not just when there's a newline
2324 in the file name, but also when there's a backslash.
2325 Reported by Jim Dennis.
2327 * tests/md5sum/basic-1: Add tests with filenames containing newline
2328 and backslash characters. (for the bug fixed above)
2330 * tests/Makefile.am (EXTRA_DIST): Add Fetish.pm.
2331 * tests/Fetish.pm: New file.
2333 * tests/md5sum/basic-1: New file: rewrite of old tests to use Fetish.pm.
2334 * tests/md5sum/Test.pm: Remove file.
2335 * tests/md5sum/Makefile.am: Rewrite.
2337 1998-09-19 Jim Meyering <meyering@ascend.com>
2339 * src/ptx.c (program_name): Declare *not* to be const.
2341 1998-08-29 Jim Meyering <meyering@ascend.com>
2343 * src/cut.c: Don't assume ASCII.
2344 * src/pr.c: Likewise.
2345 * src/tail.c: Likewise.
2347 1998-08-15 Jim Meyering <meyering@ascend.com>
2349 * src/pr.c (usage): Reformat.
2351 * src/ptx.c: Add braces to suppress warning about ambiguous `else'.
2352 * lib/bumpalloc.h: Likewise.
2354 1998-08-13 François Pinard <pinard@iro.umontreal.ca>
2356 * src/ptx.c: New file.
2357 * src/Makefile.am (bin_PROGRAMS): Add ptx.
2358 * lib/bumpalloc.h, lib/diacrit.h, lib/diacrit.c: New files.
2359 * lib/Makefile.am (libtu_a_SOURCES): Add diacrit.c.
2360 (noinst_HEADERS): Add bumpalloc.h and diacrit.h.
2362 1998-08-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2364 * src/pr.c (long_options): Add long names for all options.
2365 (usage): Update help string.
2366 (main): Handle the special options --pages and --columns.
2368 1998-08-02 Jim Meyering <meyering@ascend.com>
2370 * lib/linebuffer.c (readline): Return zero upon error as well as upon
2371 end of file. From James Youngman.
2374 1998-08-01 Jim Meyering <meyering@ascend.com>
2376 * src/sort.c (my_setlocale): Guard definition within #ifdef ENABLE_NLS.
2377 From Manfred Hollstein.
2379 1998-07-30 Jim Meyering <meyering@ascend.com>
2381 * tests/cut/Test.pm: Avoid broken pipe message for tests that fail
2384 * src/sort.c (usage): Add angle brackets to make `Report bugs...'
2385 message consistent with all the rest.
2387 1998-07-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2389 * tests/cut/Test.pm: Avoid broken pipe for 'y' and 'z' tests.
2391 * src/sort.c (NEGATION_SIGN): Renamed from NEGATIVE_SIGN to avoid
2392 clash with <langinfo.h>. All uses changed.
2394 1998-07-26 Jim Meyering <meyering@ascend.com>
2396 * intl/localealias.c (read_alias_file): Avoid mixing `char*' and
2397 `unsigned char*' variables. Again for irix4.
2398 Mostly from Kaveh Ghazi.
2400 * src/join.c: Convert some char* dcls to `unsigned char*' and remove
2401 a cast -- to placate irix4's cc.
2402 * src/fmt.c (check_punctuation): Add cast to placate irix4's cc.
2403 Reported by Kaveh Ghazi.
2405 * src/md5sum.c (split_3): Add cast to placate irix4's cc.
2408 1998-07-25 Jim Meyering <meyering@ascend.com>
2412 * tests/cut/Test.pm: Add tests for new --output-delimiter option,
2413 as well as for NUL input delimiter (--delimiter='').
2414 * src/cut.c (cut_fields): Honor new --output-delimiter option.
2415 (main): Fix handling of --delimiter='' (-d ''). Until now, it has
2416 never worked as advertised. I guess no one tried it.
2418 * tests/sort/Test.pm: Add two tests relating to this.
2419 * src/sort.c (main): Stat all non-`-' input file files (and fail if a
2420 stat fails) when an output file is specified by `-o' but doesn't exist.
2421 Reported by Will Edgington.
2423 * tests/sort/Test.pm: New tests of -o.
2425 1998-07-16 Jim Meyering <meyering@ascend.com>
2427 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
2428 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
2429 * lib/lchown.c: Include lchown.h.
2431 1998-07-04 Jim Meyering <meyering@ascend.com>
2433 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
2434 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
2435 * acconfig.h (WITH_REGEX): Remove undef.
2436 * src/csplit.c: Remove #ifdef around <regex.h> inclusion.
2437 * src/nl.c: Likewise.
2438 * src/tac.c: Likewise.
2439 * src/csplit.c (extract_regexp): Remove #if !WITH_REGEX...#endif block.
2440 * lib/Makefile.am (noinst_HEADERS): Remove rx.h.
2441 * lib/rx.c: Remove file.
2442 * lib/rx.h: Remove file.
2444 1998-06-29 Jim Meyering <meyering@ascend.com>
2446 * src/wc.c: Update calls to human_readable -- now there's one fewer arg.
2448 * lib/Makefile.am (libtu_a_SOURCES): Add argmatch.c.
2449 (noinst_HEADERS): Add argmatch.h.
2451 1998-06-28 Jim Meyering <meyering@ascend.com>
2453 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
2455 1998-06-27 Jim Meyering <meyering@ascend.com>
2457 * tests/pr/Test.pm: Add two tests for double spacing.
2458 * src/pr.c (print_page): If cols_ready_to_print is zero,
2459 break out of loop just before the double-space test.
2460 Reported by Michael Stutz.
2462 1998-06-18 Jim Meyering <meyering@ascend.com>
2464 * tests/Makefile.am.in (check): Depend on $(maint_gen) so
2465 `make maintainer-clean; ./configure; make check' works.
2467 1998-05-25 Jim Meyering <meyering@ascend.com>
2469 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
2470 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
2471 [!_GNU_SOURCE]: Add #undef instead.
2473 1998-05-16 Jim Meyering <meyering@ascend.com>
2475 * configure.in (jm_MACROS): New wrapper macro.
2476 Remove uses of most jm_* macros.
2478 * src/tac.c (tac_seekable): Fix error in handling regex separators.
2479 * tests/tac/Test.pm (opt-b, opt-s, opt_sb, opt_r): New tests.
2480 (opt_br): New test -- exercises above-fixed bug.
2482 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
2483 lines from the m4/*.m4 macros, so the hack of including some
2484 custom-replaced C source file names here is no longer needed.
2486 * acconfig.h (chown): Add undef.
2487 (D_INO_IN_DIRENT): Likewise.
2488 (D_TYPE_IN_DIRENT): Likewise.
2489 (ssize_t): Likewise.
2491 1998-05-09 Jim Meyering <meyering@ascend.com>
2493 * src/tac.c (tac_seekable): Rename from tac_stream.
2494 Change `FILE *in' parameter to `int input_fd'. Adjust callers.
2496 1998-05-03 Jim Meyering <meyering@ascend.com>
2498 * po/: Update from gettext-0.10.35.
2500 * configure.in: Remove use of AC_LINK_FILES.
2501 (AC_OUTPUT): Remove po/Makefile-generating sed command.
2503 1998-04-26 Jim Meyering <meyering@ascend.com>
2505 * tests/tail/Test.pm: Disable test f-1, now that it fails.
2507 * src/sort.c (keycompare) (CMP_WITH_IGNORE): Don't return 0 from inside
2508 the keyspec-iterating loop. With this change, test 22a passes.
2509 Reported by Zvi Har'El.
2510 (strncoll): Remove bogus assertion.
2511 * tests/sort/Test.pm: Add tests for the above fix.
2513 * configure.in: Use jm_ASSERT.
2514 * acconfig.h: Add NDEBUG.
2516 * src/cut.c: Don't define NDEBUG.
2517 * src/csplit.c: Likewise.
2518 * src/join.c: Likewise.
2519 * src/sort.c: Likewise.
2520 * src/tr.c: Likewise.
2522 * src/cut.c: Don't define _GNU_SOURCE (now it's in config.h).
2523 * src/expand.c: Likewise.
2524 * src/fold.c: Likewise.
2525 * src/join.c: Likewise.
2526 * src/sort.c: Likewise.
2527 * src/tr.c: Likewise.
2528 * src/unexpand.c: Likewise.
2529 * src/uniq.c: Likewise.
2531 * src/tail.c (close_fd): New function -- converted from macro.
2532 [struct File_spec] (n_stat_calls): New member.
2533 [struct File_spec] (n_unchanged_stats): New member.
2534 (max_n_unchanged_stats): New global.
2535 Initialize new members.
2536 (xwrite): New function -- converted from macro.
2537 [struct File_spec] (pretty_name): Remove member.
2538 (pretty_name): New function.
2540 * src/md5sum.c (md5_check): Declare local, `md5num' as _unsigned_ char*.
2541 (hex_digits): Declare parameter `s' as _unsigned_ char*.
2542 (split_3): Declare parameter `u' as _unsigned_ char**.
2544 1998-04-17 Jim Meyering <meyering@ascend.com>
2546 * src/fmt.c (check_punctuation): Used unsigned char* pointers to avoid
2548 * src/join.c (xfields): Likewise.
2550 1998-04-12 Jim Meyering <meyering@ascend.com>
2552 * src/cat.c: Use STREQ macro rather than strcmp.
2553 * src/cksum.c: Likewise.
2554 * src/comm.c: Likewise.
2555 * src/csplit.c: Likewise.
2556 * src/cut.c: Likewise.
2557 * src/fmt.c: Likewise.
2558 * src/fold.c: Likewise.
2559 * src/head.c: Likewise.
2560 * src/join.c: Likewise.
2561 * src/md5sum.c: Likewise.
2562 * src/nl.c: Likewise.
2563 * src/paste.c: Likewise.
2564 * src/pr.c: Likewise.
2565 * src/split.c: Likewise.
2566 * src/sum.c: Likewise.
2567 * src/tac.c: Likewise.
2568 * src/uniq.c: Likewise.
2569 * src/wc.c: Likewise.
2571 1998-04-11 Jim Meyering <meyering@ascend.com>
2573 * lib/safe-read.h: New file.
2574 * lib/safe-read.c: Include it.
2575 * src/cat.c: Include it instead of merely declaring safe_read.
2576 * src/csplit.c: Likewise.
2577 * src/head.c: Likewise.
2578 * src/split.c: Likewise.
2579 * src/sum.c: Likewise.
2580 * src/tac.c: Likewise.
2581 * src/tail.c: Likewise.
2582 * src/tr.c: Likewise.
2583 * src/wc.c: Likewise.
2585 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
2587 * src/wc.c [HAVE_INTTYPES_H]: Include inttypes.h.
2588 Declare counters to be of type uintmax_t.
2589 (write_counts): Use human_readable to format potentially-long-long
2590 numbers. Suggestion from Rogier Wolff.
2591 (wc): Declare per-file counters to be of type uintmax_t.
2592 Declare bytes_read to be ssize_t.
2593 * lib/Makefile.am (libtu_a_SOURCES): Add human.c.
2594 (noinst_HEADERS): Add human.h.
2596 * lib/human.c: New file.
2597 * lib/human.h: New file.
2599 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
2601 * configure.in (jm_AC_HEADER_INTTYPES_H): Use it.
2602 (jm_AC_TYPE_UINTMAX_T): Use it.
2603 (jm_PREREQ): Use it.
2605 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
2606 know about the m4/ subdirectory.
2607 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
2608 automake-1.2h and the above change) aclocal-related rules and includes.
2610 1998-04-03 Jim Meyering <meyering@eng.ascend.com>
2612 * lib/closeout.c: New file.
2613 * lib/closeout.h: New file.
2614 * lib/Makefile.am (libtu_a_SOURCES): Add closeout.c.
2615 (noinst_HEADERS): Add closeout.h.
2617 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
2619 * lib/xstrtol.c: Merge with the version from fileutils.
2621 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
2623 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
2625 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
2627 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
2628 automatically handles it.
2630 1998-03-19 Jim Meyering <meyering@eng.ascend.com>
2632 * src/system.h (SCHAR_MIN): Define.
2634 od.c needs these when compiling with NCR's R2.0c C compiler.
2635 (TYPE_MAXIMUM): Cast result to `(t)' so this macro works with
2639 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
2641 * src/tail.c (tail_file): Merge largely-duplicated blocks of code.
2643 1998-03-03 Paul Eggert <eggert@twinsun.com>
2645 * src/sort.c (xtmpfopen): Open temporary file exclusively, to
2646 foil a common denial-of-service attack.
2647 * src/tac.c (save_stdin): Likewise.
2649 1998-02-16 Jim Meyering <meyering@eng.ascend.com>
2651 * configure.in (jm_FUNC_LSTAT): Use it.
2652 (jm_FUNC_STAT): Use it.
2653 * lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c.
2655 1998-02-06 Jim Meyering <meyering@eng.ascend.com>
2657 * configure.in: Don't use AM_MAINTAINER_MODE or
2658 AC_PATH_PROG(PERL, perl).
2659 (jm_PERL): Use this.
2661 1998-02-04 Jim Meyering <meyering@eng.ascend.com>
2663 * tests/Makefile.am.in (EXTRA_DIST): Remove mk-script.pl.
2664 (mk_script): Set to ../mk-script.
2665 (x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script.
2666 Remove @MAINT@ cruft.
2667 (Makefile.am): Likewise.
2668 Remove @MAINT@ cruft. Now `missing' will explain the failure
2669 when people don't have Perl yet modify a file whose rebuilding
2670 would lead to the use of Perl.
2672 * tests/Makefile.am (EXTRA_DIST): Add mk-script.
2673 * tests/*/mk-script.pl: Remove files.
2675 * GNUmakefile: New file.
2676 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
2677 Don't include Makefile.maint from here. It's included from GNUmakefile.
2679 1998-01-30 Paul Eggert <eggert@twinsun.com>
2681 * configure.in (AC_LFS): Put before anything that can affect or use
2682 CPPFLAGS, LDFLAGS, or LIBS.
2684 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
2686 * Makefile.maint: New file.
2687 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
2688 into Makefile.maint.
2689 Include Makefile.maint.
2690 (EXTRA_DIST): Add Makefile.maint.
2692 * src/cat.c (cat): Convert comma-expressions to pairs of
2693 semicolon-terminated stmts.
2694 Add braces around compound if/else stmts.
2696 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
2698 * src/tail.c (parse_obsolescent_option): Do not interpret `-f -n 1 ...'
2699 as obsolescent options.
2700 Accept new option: --sleep-interval=SECONDS (-s).
2701 (parse_options): Recognize it.
2702 (usage): Describe it.
2703 (tail_forever): Use it.
2704 (dump_remainder): Use it.
2705 * tests/tail/Test.pm (f-1): Add test for option-processing of `-f -n 1'.
2707 * tests/cut/: Rename directory to remove `-test' suffix.
2708 * tests/join/: Likewise.
2709 * tests/md5sum/: Likewise.
2710 * tests/pr/: Likewise.
2711 * tests/sort/: Likewise.
2712 * tests/tr/: Likewise.
2713 * configure.in (AC_OUTPUT): Reflect renamings in tests/.
2714 * tests/Makefile.am (SUBDIRS): Reflect renamings in tests/.
2716 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
2717 bug in Cray C 5.0.3.0 when T == time_t.
2719 1998-01-18 Jim Meyering <meyering@na-net.ornl.gov>
2721 * src/sort.c (strncoll, strncoll_s2_readonly, look_for_fraction,
2722 numcompare): Remove the `unsigned' from some `unsigned char*'
2723 parameter types. Add casts via UCHAR where necessary to avoid
2724 problems with unwanted sign extension. Based on a patch from
2725 Kaveh Ghazi to appease Irix4's cc compiler.
2727 1998-01-17 Jim Meyering <meyering@na-net.ornl.gov>
2729 * src/split.c (next_file_name): Rewrite. This removes an artificial
2730 limit (albeit already high, at INT_MAX :-) on the number of files
2731 split could create. Reported by Ralf W. Stephan.
2733 1998-01-16 Jim Meyering <meyering@na-net.ornl.gov>
2735 * src/sort.c: (mergefps): Add braces to avoid ambiguous `else' stmt.
2736 (nls_set_fraction): Likewise.
2738 * src/sort.c: Guard inclusion of langinfo.h also with HAVE_LANGINFO_H,
2739 for Irix-4.0.5. From Kaveh Ghazi.
2740 * configure.in: Check for langinfo.h.
2742 * lib/getline.c: Make PARAMS-defining conditionals consistent.
2743 * lib/linebuffer.h: Likewise.
2744 * lib/long-options.h: Likewise.
2745 * lib/memcasecmp.h: Likewise.
2746 * lib/xstrtod.h: Likewise.
2747 * lib/xstrtol.h: Likewise.
2748 Suggestion from Kaveh Ghazi.
2750 * tests/head/Test.pm (fail-0): Disable test. It depends on
2751 sizeof(long) being 32 bits. Reported by Kaveh Ghazi.
2753 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
2757 * src/system.h [HAVE_LIMITS_H]: Include limits.h
2758 (TYPE_SIGNED): Define.
2759 (TYPE_MINIMUM): Define.
2760 (TYPE_MAXIMUM): Define.
2762 (SCHAR_MAX): Define.
2763 (UCHAR_MAX): Define.
2768 (ULONG_MAX): Define.
2769 * src/*.c: Remove definitions of those symbols.
2771 * src/csplit.c: Move inclusion of regex.h/rx.h to follow system.h
2772 since it now includes limit.h which defines RE_DUP_MAX.
2773 * src/nl.c: Likewise.
2774 * src/tac.c: Likewise.
2776 * lib/xstrtol.c (bkm_scale): Renamed from BKM_SCALE.
2777 Rewrite macro as function. Return a value. Update caller.
2778 Cast __ZLONG_MAX `__unsigned long int' before casting to double to
2779 avoid SunOS /bin/cc compiler bug.
2781 1998-01-08 Jim Meyering <meyering@na-net.ornl.gov>
2783 * src/tac-pipe.c: New file. But not yet used.
2784 * src/Makefile.am (EXTRA_DIST): Add tac-pipe.c.
2786 * src/tac.c (tac_stream): Don't perform arithmetic on now-void* pointer
2787 result of xrealloc (until recently it was char*).
2789 * configure.in (AC_CHECK_FUNCS): Add nl_langinfo.
2790 * src/sort.c (inittables): Add && HAVE_NL_LANGINFO to the #if-test
2791 guarding the nls month-checking code.
2792 (nls_numeric_format): Remove unnecessary (and error-evoking w/SunOS' cc)
2793 `unsigned' from dcls of text and lim.
2794 (main): Cast lconvp->grouping to `unsigned char*' to appease SunOS's cc.
2796 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
2798 * lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr.
2800 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
2801 those files will be built via the ANSI2KNR-filtering rules if necessary.
2803 1997-12-25 Jim Meyering <meyering@na-net.ornl.gov>
2805 * configure.in: Remove AC_DEFINE of _GNU_SOURCE.
2806 * acconfig.h (_GNU_SOURCE): Define if not already defined.
2807 Put this code in @TOP@ section.
2808 (_GNU_SOURCE): Remove #undef.
2810 1997-12-22 Jim Meyering <meyering@na-net.ornl.gov>
2812 * configure.in: AC_DEFINE _GNU_SOURCE.
2813 * acconfig.h: Add _GNU_SOURCE.
2815 1997-12-21 Jim Meyering <meyering@na-net.ornl.gov>
2817 * configure.in (AC_CHECK_HEADERS): Add stdlib.h.
2819 * src/system.h: Merge in things from fileutils' version of this file.
2820 * src/csplit.c: s/__P/PARAMS/.
2821 * src/fmt.c: s/__P/PARAMS/.
2822 * src/od.c: s/__P/PARAMS/.
2823 * src/pr.c: s/__P/PARAMS/.
2825 1997-12-14 Jim Meyering <meyering@na-net.ornl.gov>
2827 * src/sys2.h: s/HAVE_DECLARATION_/HAVE_DECL_/g.
2829 1997-12-13 Jim Meyering <meyering@na-net.ornl.gov>
2831 * src/fmt.c (main): Add some braces.
2832 Check return code from fclose of each input file.
2833 Close stdout and check for errors.
2835 * src/csplit.c (close_output_file): Check ferror before calling fclose.
2836 (main): Close stdout and check for errors.
2838 1997-11-15 Jim Meyering <meyering@na-net.ornl.gov>
2840 * acconfig.h: Add mktime.
2841 * configure.in (jm_FUNC_MKTIME): Use it.
2842 * lib/mktime.c: New file.
2843 * lib/Makefile.am (EXTRA_DIST): Add mktime.c
2845 * intl/Makefile.in (distclean): Don't remove libintl.h here.
2846 * Makefile.am (DISTCLEANFILES): Remove it here instead.
2848 1997-11-13 Jim Meyering <meyering@na-net.ornl.gov>
2850 * lib/strftime.c: Update from FSF.
2851 * m4/strftime.m4: Check for POSIX.2's %f format spec.
2853 1997-11-12 Jim Meyering <meyering@na-net.ornl.gov>
2855 * src/system.h [!HAVE_MEMPCPY] (mempcpy): Define.
2856 * configure.in (AC_CHECK_FUNCS): Add mempcpy.
2858 1997-11-09 Jim Meyering <meyering@na-net.ornl.gov>
2860 * configure.in (jm_FUNC_STRFTIME): Use it.
2861 * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Check for localtime_r.
2862 * m4/strftime.m4 (jm_STRFTIME_PREREQS): Check for localtime_r.
2863 (jm_FUNC_GNU_STRFTIME): Use new macro.
2864 (jm_FUNC_STRFTIME): New macro. Likewise.
2865 Reported by Noel Cragg.
2867 1997-11-08 Jim Meyering <meyering@na-net.ornl.gov>
2869 * m4/lfs.m4 (AC_LFS): New file/macro.
2870 * m4/Makefile.am (EXTRA_DIST): Add lfs.m4.
2871 * configure.in (AC_LFS): Use it.
2872 (AC_CHECK_FUNCS): Add fseeko.
2873 * src/od.c (fseeko): Define a stub if ! HAVE_FSEEKO.
2874 (skip): Use fseeko if available. Don't use lseek; it causes
2875 the stdio stream to become out of sync with respect to the
2876 underyling file descriptor.
2879 1997-10-16 Paul Eggert <eggert@twinsun.com>
2881 * configure.in (AC_CHECK_FUNCS): Add fseeko.
2883 * src/od.c (skip): Use fseeko. Don't use lseek; it causes
2884 the stdio stream to become out of sync with respect to the
2885 underyling file descriptor.
2887 1997-11-06 Jim Meyering <meyering@na-net.ornl.gov>
2889 * src/sort.c (getmonth): Remove HAVE_ALLOCA #ifdefs.
2890 We always have alloca.
2891 (keycompare): Don't use variable size arrays (it's a gcc-extension).
2892 Rewrite code that increments new lengths when not `ignoring'.
2894 1997-11-02 Jim Meyering <meyering@na-net.ornl.gov>
2896 * acconfig.h: Add malloc and realloc.
2898 * src/wc.c (main): New option, --max-line-length (-L).
2899 (wc, write_counts): Implement it.
2902 1997-10-26 Jim Meyering <meyering@na-net.ornl.gov>
2904 * lib/memcasecmp.c: Convert to upper case before comparing.
2905 This makes join -i work with sort -f.
2906 Reported by Arthur Pool.
2908 1997-10-25 Jim Meyering <meyering@na-net.ornl.gov>
2910 * lib/xmalloc.c (xalloc_fail): Renamed from fixup_null_alloc.
2911 (xcalloc): #ifdef-out unused function.
2912 (xrealloc): Remove code to work around deficient versions of realloc.
2913 Now we have an autoconf-enabled replacement version.
2914 (xmalloc): Remove code to work around deficient versions of malloc.
2915 Now we have an autoconf-enabled replacement version.
2917 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
2919 * src/sort.c (NLS_STRNCMP) [!ENABLE_NLS]: s/strcmp/strncmp/.
2921 * lib/xmalloc.c (xalloc_fail_func): Initialize to 0, not NULL.
2923 * configure.in (jm_FUNC_MALLOC): Use it.
2924 (jm_FUNC_REALLOC): Use it.
2926 * lib/Makefile.am (EXTRA_DIST): Add malloc.c.
2927 * lib/malloc.c: New file.
2928 * m4/malloc.m4: New file.
2929 * m4/Makefile.am (EXTRA_DIST): Add malloc.m4.
2931 * lib/Makefile.am (noinst_HEADERS): Add xalloc.h.
2932 (EXTRA_DIST): Add realloc.c.
2933 (EXTRA_DIST): Add malloc.c.
2935 * src/system.h: Include xalloc.h.
2936 Remove dcls of xmalloc, xcalloc and xrealloc.
2938 * lib/xalloc.h: New file.
2940 * lib/xmalloc.c: Include xalloc.h.
2941 Change VOID to void.
2942 (xalloc_exit_failure): Renamed extern.
2943 (xalloc_msg_memory_exhausted): New extern.
2944 (xalloc_fail_func): New extern.
2945 (fixup_null_alloc): Use new variables.
2947 1997-10-24 Jim Meyering <meyering@na-net.ornl.gov>
2949 * src/unexpand.c: Remove old-style xmalloc and xrealloc decls.
2950 (add_tabstop): Cast first arg of xrealloc to char*.
2952 * src/sort.c: Include xalloc.h.
2953 (xmalloc): Remove function.
2954 (xrealloc): Remove function.
2955 (main): Set xalloc_fail_func to cleanup.
2956 Set xalloc_exit_failure SORT_FAILURE.
2958 * src/paste.c: Remove old-style xmalloc and xrealloc decls.
2959 (paste_parallel): Cast first arg of xrealloc to char*.
2961 * src/od.c: Remove old-style xmalloc and xrealloc decls.
2962 (decode_format_string): Cast first arg of xrealloc to char*.
2964 * src/expand.c: Remove old-style xmalloc and xrealloc decls.
2965 (add_tabstop): Cast first arg of xrealloc to char*.
2967 * lib/xalloc.h: New file.
2969 * src/cut.c (ADD_RANGE_PAIR): Cast first arg of xrealloc to char*.
2970 (getstr): Cast xmalloc return value to char*.
2972 * src/csplit.c: Include xalloc.h.
2973 (xmalloc): Remove function.
2974 (xrealloc): Remove function.
2975 (main): Set xalloc_fail_func to cleanup.
2977 * src/*.c: Remove old-style xmalloc and xrealloc decls.
2978 * src/system.h: Add prototyped xcalloc, xmalloc and xrealloc decls.
2979 Suggestion from Achim Blumensath.
2981 1997-10-23 Jim Meyering <meyering@na-net.ornl.gov>
2983 * Makefile.am (aclocal-files): Also depend on m4/Makefile.am.
2985 * src/system.h [!HAVE_DECLARATION_FREE]: Declare free.
2986 [!HAVE_DECLARATION_MALLOC]: Declare malloc.
2987 [!HAVE_DECLARATION_REALLOC]: Declare realloc.
2988 [!HAVE_DECLARATION_STPCPY]: Declare stpcpy.
2989 [!HAVE_DECLARATION_STRSTR]: Declare strstr.
2990 * src/cat.c: Remove stpcpy dcl.
2991 * src/csplit.c: Remove malloc and realloc dcls.
2992 * src/sort.c: Remove free, malloc, and realloc dcls.
2993 * src/tac.c: Remove malloc, and realloc dcls.
2994 * src/tr.c: Remove stpcpy dcl.
2995 On some systems, strstr and stpcpy are macros, so declaring them
2996 unconditionally gets syntax errors.
2997 Reported by Mark M. Kettenis.
2999 * configure.in: Use jm_CHECK_DECLS.
3000 * m4/Makefile.am (EXTRA_DIST): Add decl.m4 and check-decl.m4.
3002 1997-10-22 Jim Meyering <meyering@na-net.ornl.gov>
3004 * m4/decl.m4: New file.
3005 * m4/check-decl.m4: New file. New macro, jm_CHECK_DECLS.
3007 1997-10-16 Paul Eggert <eggert@twinsun.com>
3009 * src/od.c (LONG_MAX): Define if not defined.
3011 1997-10-16 Jim Meyering <meyering@na-net.ornl.gov>
3013 * src/sort.c (look_for_fraction): Patch from Ørn Hansen.
3014 (getmonth): Compare the two month names only to the length of the
3015 string in the month table. Patch from Ørn Hansen.
3016 (NLS_STRNCMP): New macro.
3017 (strncoll_s2_readonly): New function.
3018 (inittables): Don't use temporary `comp' to hide type of
3019 comparator function.
3020 (nls_sort_month_comp): Declare parameters to be void* to match
3021 comparator function type required for qsort.
3022 (getmonth): Use NLS_STRNCMP rather than #ifdef.
3023 Use do-while, rather than while-loop.
3025 1997-10-14 Jim Meyering <meyering@na-net.ornl.gov>
3027 * src/sort.c: (_NL_ITEM) [!defined]: Define.
3028 From from Ørn E. Hansen.
3030 * src/sort.c: Use STREQ in place of most uses of strcmp.
3031 (NLS_STRCMP): Define.
3032 (getmonth): Remove ifdef and use NLS_STRCMP instead.
3033 Use HAVE_ALLOCA, not _HAVE_ALLOCA.
3034 (zaptemp): Make parameter `const'.
3036 * tests/sort-test/Test.pm: Add tests to exercise new fraccompare.
3038 * src/sort.c (CHARS_IN_ABM): Remove definition
3039 (inittables): Remove assumption that all abbreviated month names have
3041 (getmonth): Likewise.
3042 (main): Add #if's for more efficient code when using the GNU C library.
3043 From Ulrich Drepper.
3045 * src/sort.c (strncoll): Rename parameter to LEN.
3046 (keycompare): Move assignment out of if-expression.
3048 * lib/xstrdup.c: New file.
3049 * lib/Makefile.am (libtu_a_SOURCES): Add xstrdup.c
3051 * src/sort.c: Declare xstrdup.
3052 (my_setlocale): New function.
3053 (main): Guard against failure of strdup (use xstrdup) and setlocale.
3055 * src/system.h (STREQ): Define.
3056 * src/od.c (STREQ): Remove definition.
3058 * src/sort.c (look_for_fraction): Eliminate arbitrary limit on
3059 number of `groups'. Declare as void, not int.
3060 Patch from Ørn E. Hansen.
3061 (main): When determining whether we're in the C or POSIX locale,
3062 don't rely on the form of the string returned by setlocale.
3063 Suggestion from Ulrich Drepper.
3065 1997-10-12 Jim Meyering <meyering@na-net.ornl.gov>
3067 * src/sort.c: Apply big patch from Ørn E. Hansen.
3069 (NLS_MEMCMP): Define.
3070 (keycompare): Use it instead of open-coded #ifdefs.
3071 (compare): Likewise.
3072 (NLS_MAP): Remove unused definitions.
3073 Replace with uses of UCHAR.
3074 (nls_locale_map): Remove dcl of unused file-scope array.
3076 1997-10-10 Jim Meyering <meyering@na-net.ornl.gov>
3078 * tests/sort-test/Test.pm: Add a test.
3081 1997-10-07 Jim Meyering <meyering@na-net.ornl.gov>
3083 * src/*.c: Update bug-reporting address.
3084 * src/cat.c: Indent cpp directives to reflect nesting.
3085 * src/cksum.c: Likewise.
3086 * src/csplit.c: Likewise.
3087 * src/fmt.c: Likewise.
3088 * src/nl.c: Likewise.
3089 * src/paste.c: Likewise.
3091 1997-09-27 Jim Meyering <meyering@na-net.ornl.gov>
3093 * m4/memcmp.m4: Integrate test to detect bug in memcmp from the
3094 Next x86 OpenStep C library. Test program from William Lewis.
3096 1997-09-21 Jim Meyering <meyering@na-net.ornl.gov>
3098 * src/od.c [struct tspec] (hexl_mode_trailer): Rename from `trailer.'
3099 (dump_hexl_mode_trailer): Rename from dump_string_trailer.
3100 Use fputs and putchar instead of trivial or %-less printfs.
3101 (decode_one_format): Parenthesize each field_width assignment in an
3102 argument list to make the side effect a little more apparent.
3103 (write_block): Use fputs and putchar instead of trivial or %-less
3105 (dump_strings): Cast string_min to off_t to avoid long-standing warning.
3107 * src/od.c: Implement new `z' (hexl-mode) modifier.
3108 [struct tspec] (trailer): New field.
3109 (field_width): Likewise.
3110 (dump_string_trailer): New function.
3111 (decode_one_format): Save each field_width in the tspec.
3112 Patch from John Kodis.
3114 1997-09-14 Jim Meyering <meyering@na-net.ornl.gov>
3116 * src/od.c (main) [--traditional]: Don't give diagnostic about there
3117 being more than three arguments if there are *no* arguments specified.
3118 Reported by Jochen Hein.
3120 1997-09-13 Jim Meyering <meyering@na-net.ornl.gov>
3122 * tests/sort-test/Test.pm: Add tests 19a and 19b.
3124 1997-07-21 Jim Meyering <meyering@na-net.ornl.gov>
3126 * src/tail.c (parse_obsolescent_option): #ifdef-out portability warning.
3128 1997-07-19 Jim Meyering <meyering@na-net.ornl.gov>
3130 * src/sort.c (checkfp): Print the `disorder' message. Include both
3131 the number and the contents of the first out-of-order line, in addition
3132 to the file name. Change meaning of return value.
3133 (check): Don't print disorder message here.
3134 Adjust test of checkfp's return value.
3135 Feature suggestion from Karl Heuer.
3137 1997-07-13 Jim Meyering <meyering@na-net.ornl.gov>
3139 * doc/Makefile.am (EXTRA_DIST): Remove explicit mention of texinfo.texi.
3140 Now, automake includes it automatically.
3142 * src/head.c: Include xstrtoul.h.
3143 Remove global variable, unit_size.
3144 (atou): Remove now-unused function.
3145 (parse_unit): Likewise.
3146 (string_to_ull): New function.
3147 (head): Take new parameter, count_lines. Use it instead of unit_size.
3149 (head_file): Likewise.
3150 (main): Use string_to_ull, not atou/parse_unit.
3151 The problem was that overflow wasn't detected, so `head -c 4096m'
3152 was treated just like `head -c 0'.
3153 Reported by Jerome Abela.
3155 * tests/wc: New directory.
3156 * tests/head: New directory.
3157 * tests/Makefile.am (SUBDIRS): Add head and wc.
3158 * configure.in (AC_OUTPUT): Add tests/head/Makefile and
3161 1997-07-05 Jim Meyering <meyering@na-net.ornl.gov>
3163 * src/tail.c (parse_obsolescent_option): If POSIXLY_CORRECT is set, give
3164 a diagnostic and fail when there are two or more non-option arguments.
3166 1997-07-04 Jim Meyering <meyering@na-net.ornl.gov>
3168 * tests/tac/mk-script.pl: Redirect output of cmp to /dev/null.
3170 * configure.in (ALL_LINGUAS): Add Norwegian (no).
3172 * Makefile.am (aclocal-files): Look in source directory, not build dir.
3173 From Andreas Schwab.
3175 Sun Jun 15 06:36:41 1997 Jim Meyering <meyering@na-net.ornl.gov>
3177 * src/pr.c (init_header) [T_BUF_FMT]: Output the 4-digit year (not the
3178 2-digit abbreviation) in each page header. Reported by Noah Friedman.
3180 Sat Jun 14 12:29:12 1997 Jim Meyering <meyering@na-net.ornl.gov>
3182 * src/cut.c (cut_fields): Detect when the input is empty and handle
3183 that special case. Before `cut -f1 < /dev/null' would improperly
3184 output a single newline. Reported by Phil Richards.
3186 Sun Apr 27 15:10:58 1997 Jim Meyering <meyering@na-net.ornl.gov>
3188 * man/Makefile.am (DISTFILES): Add $(man_MANS).
3190 * configure.in (ALL_LINGUAS): Add Czech (cs) and Swedish (sv).
3192 Thu Apr 3 21:14:02 1997 Jim Meyering <meyering@na-net.ornl.gov>
3194 * m4/Makefile.am (EXTRA_DIST): Update file list.
3196 * tests/cut-test/Test.pm: Add test from Phil Richards.
3198 Sat Mar 22 20:29:10 1997 Jim Meyering <meyering@na-net.ornl.gov>
3200 * missing: New file -- from the automake-1.1m distribution.
3202 Fri Mar 21 23:56:41 1997 Jim Meyering <meyering@na-net.ornl.gov>
3204 * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.1l.
3205 (aclocal.m4): Use aclocal's new -I option.
3207 Thu Mar 13 21:46:04 1997 Jim Meyering <meyering@na-net.ornl.gov>
3209 * src/tr.c (main): Make sure c1 is not -1 before using it as an
3210 array index. Patch from Greg McGary. Although this is truly a
3211 bug, I believe it would not cause tr to misbehave on most systems.
3212 I could not construct a test case with which this bug causes tr
3213 to generate invalid output.
3215 * tests/pr-test/Test.pm: Add test that -o 0 works.
3217 * src/pr.c (main): Allow use of 0 (zero) as the margin offset
3218 argument to the -o option. Patch from Gary Anderson.
3220 Fri Feb 28 22:32:51 1997 Jim Meyering <meyering@na-net.ornl.gov>
3222 * src/uniq.c (usage): Fix typo in --help output. From Andreas Schwab.
3224 Tue Feb 25 20:34:51 1997 Jim Meyering <meyering@na-net.ornl.gov>
3226 * lib/Makefile.am (noinst_HEADERS): Add obstack.h.
3227 (libtu_a_SOURCES): Add obstack.c.
3229 Sun Feb 16 08:30:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
3231 * tests/Makefile.am (SUBDIRS): Add tac.
3232 * tests/tac: New directory.
3233 * configure.in (AC_OUTPUT): Add tests/tac/Makefile.
3235 * tests/pr-test/{tt-0FF, tt-bl, tta3-0FF, ttb3-0FF, tt-FF, tt-t,
3236 tta3-FF, ttb3-FF}: New files. Renamed (s/T/tt/) to avoid name clashes
3237 on case-independent filesystems.
3238 * tests/pr-test/Test.pm (Tests '7.*'): Reflect file-renaming.
3240 * src/tail.c (parse_obsolescent_option): Reverse order of args in
3241 diagnostic. Remove `' quotes in diagnostic.
3242 (parse_options): Remove `' quotes in diagnostic.
3244 Sat Feb 8 22:43:45 1997 Jim Meyering <meyering@na-net.ornl.gov>
3246 * src/tail.c (parse_obsolescent_option): Give warning diagnostic for
3247 (but now accept) obsolescent usage with more than one file argument.
3249 Sun Feb 2 23:06:59 1997 Jim Meyering <meyering@na-net.ornl.gov>
3251 * src/join.c: Move alloca-related preprocessor code into system.h.
3252 * src/od.c: Remove alloca-related preprocessor code.
3253 * src/system.h: Add alloca-related preprocessor code.
3255 Sat Feb 1 07:21:43 1997 Jim Meyering <meyering@na-net.ornl.gov>
3257 * tests/pr-test/*: Rename files to avoid exceeding 14-character limit.
3258 * tests/pr-test/Test.pm: Reflect renamings.
3260 * tests/pr-test/mk-script.pl (spec_to_list): Warn about all filenames
3261 that exceed max-length before dying.
3263 * src/pr.c (init_parameters): For compatibility: use default
3264 separator `TAB' with full length lines. From Roland Huebner.
3266 Fri Jan 31 19:53:54 1997 Jim Meyering <meyering@na-net.ornl.gov>
3268 * src/tac.c: Rename globals buffer and buffer_size to have G_ prefix
3269 to avoid shadowing local variables.
3271 * lib/long-options.c (parse_long_options): Compare getopt_long return
3272 value against -1, not EOF. Use NULL, not `(int *) 0' as last parameter
3273 in getopt_long call.
3275 * src/pr.c (add_line_number): Rename from `number' to avoid shadowing
3278 * src/*.c: Compare getopt_long return value against -1, not EOF.
3279 Use NULL, not `(int *) 0' as last parameter in getopt_long call.
3280 (usage): Bracket bug-reporting address with <> and append a period.
3282 Wed Jan 29 20:54:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
3284 * tests/tr-test/Test.pm: Do each test twice: get input via REDIR
3287 * tests/tail/Test.pm (test_vector): Do each (non-stdin-requiring)
3290 * tests/pr-test/Test.pm: Remove common_option_prefix flag.
3291 (test_vector): Prepend the common option here instead.
3293 * tests/md5sum-test/Test.pm: Remove input_via_stdin flag.
3294 Do each test twice: get input via REDIR and PIPE.
3296 * tests/cut-test/Test.pm: Do each test three times.
3298 * tests/cut-test/mk-script.pl: Allow each test to be run any or all
3299 of three different ways. Program input may be specified via a file
3300 or files listed on the command line, via input redirection (if there's
3301 only one file), or via a pipe.
3303 Tue Jan 28 20:54:06 1997 Jim Meyering <meyering@na-net.ornl.gov>
3305 * tests/cut-test/mk-script.pl: Remove `t' prefix on all generated
3307 Change suffixes from (.in, .exp, .out, .err) to (.I, .X, .O, .E).
3308 Ensure that no test file (generated or maintainer-supplied) has a
3309 name longer than 14 characters.
3311 Sun Jan 26 12:49:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
3315 * src/tail.c (parse_options): Add quotes to make messages identical.
3317 Sat Jan 25 00:12:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
3319 * src/tail.c (parse_obsolescent_option): Comment.
3320 (parse_options): Remove unnecessary goto and label.
3322 * tests/sort-test/mk-script.pl: Interpret `input arg is a hash
3323 reference' as meaning that the tested program will read no input.
3324 Most of the tests for the date program use this feature.
3325 Also for date, the generated script now reflects specification
3326 (in Test.pm) of default and per-test environment settings.
3328 * src/csplit.c: Reflect changes to xstrtol and xstrtoul interfaces.
3329 * src/fold.c: Likewise.
3330 * src/head.c: Likewise.
3331 * src/join.c: Likewise.
3332 * src/nl.c: Likewise.
3333 * src/od.c: Likewise.
3334 * src/pr.c: Likewise.
3335 * src/uniq.c: Likewise.
3337 * lib/xstrtoul.h (XSTRTOL_H): Undefine it.
3339 * lib/xstrtol.h [!_STRTOL_ERROR]: Define the type `enum strtol_error'
3340 only if it hasn't already been defined.
3341 (_STRTOL_ERROR): Undefine.
3343 * lib/xstrtol.c (__xstrtol): Change interpretation of
3344 VALID_SUFFIXES == NULL vs VALID_SUFFIXES == "". Use the former
3345 when any suffix is valid, the later when no suffix is allowed.
3347 Fri Jan 24 23:36:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
3349 * lib/long-options.c (parse_long_options): Reset optind to zero
3350 before just returning so that getopt internals get initialized from
3351 the probably-new parameters when/if getopt is called later.
3352 From Ulrich Drepper.
3354 Thu Jan 23 19:17:03 1997 Jim Meyering <meyering@na-net.ornl.gov>
3356 * src/tail.c (parse_obsolescent_option): Recognize and fail for
3357 more malformed obsolescent options. Makes for better diagnostics.
3359 Wed Jan 22 21:34:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
3361 * tests/Makefile.am (SUBDIRS): Add tail.
3362 * tests/tail: New directory.
3363 * configure.in (AC_OUTPUT): Add tests/tail/Makefile.
3365 * src/tail.c (parse_options): New function.
3366 (parse_obsolescent_option): New function.
3367 (main): Use the new functions instead of open-coding them.
3368 This better fixes the bug in handling obsolescent `+Nc' options.
3371 Tue Jan 21 22:49:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
3373 * src/tail.c (main): Properly handle what the POSIX spec calls
3374 the `obsolescent' usage (e.g., tail +2c). It didn't work.
3375 Reported by Karl Heuer.
3377 Sun Jan 12 22:13:27 1997 Jim Meyering <meyering@na-net.ornl.gov>
3379 * tests/tr-test/Test.pm: Rename tests so that the associated files
3380 have names that are distinct even on filesystems on which file
3381 names are case insensitive.
3382 Reported by Fred Fish.
3383 * tests/cut-test/Test.pm: Likewise.
3385 * tests/tr-test/Makefile.am: Regenerated to reflect renamed tests.
3386 * tests/cut-test/Makefile.am: Likewise.
3388 Wed Jan 8 16:38:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
3392 * lib/getopt.c (_getopt_internal): Use `_', rather than the
3393 (sometimes-)expansion `gettext'.
3395 Tue Jan 7 22:50:13 1997 Jim Meyering <meyering@na-net.ornl.gov>
3397 * lib/getopt.c: New (more POSIX compliant) version from GNU libc.
3398 [_]: Define to gettext also if ENABLE_NLS is defined.
3401 Thu Jan 2 21:17:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
3403 * src/pr.c (init_fps): Initialize lines_stored field in three places.
3404 This avoids uninitialized memory reads in close_file.
3406 Wed Jan 1 17:32:18 1997 Jim Meyering <meyering@na-net.ornl.gov>
3408 * configure.in (AC_ARG_PROGRAM): Remove explicit use.
3409 It's implicit in AM_INIT_AUTOMAKE. From Wayne Stewart.
3411 Sun Dec 29 23:42:57 1996 Jim Meyering <meyering@na-net.ornl.gov>
3413 * src/pr.c (init_header): Plug a small memory leak by using stack
3414 rather than heap for a 15-byte temporary buffer.
3416 Sat Dec 28 00:03:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
3418 * src/pr.c (TAB_WIDTH): Parenthesize uses of parameters and renamed
3420 (POS_AFTER_TAB): Renamed from pos_after_tab. Define in terms of
3421 TAB_WIDTH rather than duplicating the expression.
3423 Fri Dec 27 17:29:02 1996 Jim Meyering <meyering@na-net.ornl.gov>
3425 * tests/join-test/mk-script.pl: Fix a couple of thinkos and typos.
3426 Now it works with pr's tests, too.
3428 * tests/pr-test/Makefile.am (explicit): Regenerate list of files,
3429 this time with duplicates removed.
3431 * src/pr.c (usage): Break long string literal into two separate
3432 printf statements to accomodate default maximum of 2048 characters
3433 for Irix-4.0.5. Reported by Kaveh Ghazi.
3435 * Makefile.am (aclocal.m4): No longer depend on acinclude.m4.
3437 * tests/Makefile.am (SUBDIRS): Add pr-test.
3439 * configure.in: AC_REQUIRE version 2.12 of autoconf.
3440 AC_OUTPUT: Add tests/pr-test/Makefile.
3442 Sun Dec 22 08:11:27 1996 Jim Meyering <meyering@na-net.ornl.gov>
3444 * acinclude.m4: Move macros to individual files in new directory, m4/.
3445 See ChangeLog entries in sh-utils for the details.
3447 * configure.in: Increment version to 1.20a.
3449 * tests/md5sum-test/Makefile.am: Use same framework as other tests.
3450 * tests/md5sum-test/Test.pm: New file.
3452 Sat Dec 21 20:32:58 1996 Jim Meyering <meyering@na-net.ornl.gov>
3454 * tests/Makefile.am (EXTRA_DIST): Add README and Makefile.am.in.
3456 * tests/Makefile.am.in: New file.
3458 * tests/sort-test/Makefile.am: Clone the Makefile.am from join-test.
3459 Replace only the definition of $x and the auto-generated lists of
3461 * tests/cut-test/Makefile.am: Likewise.
3462 * tests/tr-test/Makefile.am: Likewise.
3464 * tests/join-test/Makefile.am: Add @MAINT@-protected rule for
3465 verifying that Makefile.am is consistent with Test.pm.
3467 Fri Dec 20 00:08:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
3469 * tests/join-test/Makefile.am (MAINTAINERCLEANFILES): Use $(in1)
3470 and $(in2), not $(in).
3472 * tests/join-test/mk-script.pl: New option: --list.
3473 Generate lists of files used/generated.
3475 Thu Dec 19 23:28:41 1996 Jim Meyering <meyering@na-net.ornl.gov>
3477 * tests/join-test/mk-script.pl: Rewrite to be more general -- so
3478 it can be used for join, cut, sort, tr, and soon, pr test suites.
3479 * tests/tr-test/mk-script.pl: Symlink through CVS repo to join's
3481 * tests/sort-test/mk-script.pl: Likewise.
3482 * tests/cut-test/mk-script.pl: Likewise.
3484 * tests/tr-test/Test.pm: Adapted for new mk-script.pl.
3485 * tests/join-test/Test.pm: Likewise.
3487 Tue Dec 17 16:48:51 1996 Jim Meyering <meyering@na-net.ornl.gov>
3489 * tests/join-test/Makefile.am (.pl): Make generated file read-only so
3490 I don't accidentally modify it instead of the one with the .pl suffix.
3492 * acinclude.m4 (jm_SYS_PROC_UPTIME): Require AC_PROG_CC, rather than
3493 now-obsolete AC_C_CROSS.
3494 (jm_FUNC_MKTIME): When redefining, use rpl_ prefix, not gnu_ one
3495 since there's nothing GNU-specific about the replacement. Contrast
3496 with gnu_ prefix added to strftime.
3497 (jm_FUNC_MEMCMP): New macro.
3498 * configure.in: Use jm_FUNC_MEMCMP instead of AM_FUNC_MEMCMP.
3499 * acconfig.h: Add memcmp.
3500 * README: Remove warning about memcmp. The new macro handles it.
3502 Mon Dec 16 23:03:27 1996 Jim Meyering <meyering@na-net.ornl.gov>
3504 * tests/Makefile.am (pkgdata_DATA): Remove unnecessary assignment.
3506 (AUTOMAKE_OPTIONS): Likewise.
3508 Sat Dec 14 14:51:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
3510 * acinclude.m4 (jm_SYS_PROC_UPTIME): Fix typo in cache variable
3511 name for cross compiling.
3512 Remove definitions of gettext-related macros. The gettext
3513 installation procedure installs corresponding .m4 files so that
3514 aclocal will use them.
3516 1996-12-12 Paul Eggert <eggert@twinsun.com>
3518 * system.h (ISDIGIT): Replace with smaller, faster edition
3519 that yields nonzero only on ASCII digits.
3520 (ISDIGIT_LOCALE): New macro, with same meaning that ISDIGIT
3523 * tr.c (is_char_class_member): Use ISDIGIT_LOCALE instead of
3524 ISDIGIT to test for characters in CC_DIGIT class.
3526 * sort.c (digits): Remove; subsumed by new ISDIGIT.
3527 (inittables): Remove initialization of `digits'.
3528 (fraccompare, numcompare, main): Use ISDIGIT (x) instead of digits[x].
3529 (fraccompare, numcompare): Avoid casts to unsigned char that are no
3532 * csplit.c (get_format_width, get_format_prec): Avoid
3533 unnecessary comparison of digit to '\0'.
3535 Thu Dec 12 23:42:51 1996 Jim Meyering <meyering@na-net.ornl.gov>
3537 * src/sort.c (usage): Clarify description of -u option.
3540 Wed Dec 11 19:32:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3544 Tue Dec 10 00:15:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
3546 The file name, `build-script.pl' is longer than 14 characters.
3548 * tests/cut-test/mk-script.pl: Rename from build-script.pl.
3549 * tests/cut-test/Makefile.am: Reflect renaming.
3550 * tests/tr-test/mk-script.pl: Rename from build-script.pl.
3551 * tests/tr-test/Makefile.am: Reflect renaming.
3552 * tests/sort-test/mk-script.pl: Rename from build-script.pl.
3553 * tests/sort-test/Makefile.am: Reflect renaming.
3554 * tests/join-test/mk-script.pl: Rename from build-script.pl.
3555 * tests/join-test/Makefile.am: Reflect renaming.
3556 Reported by Karl Heuer.
3558 * configure.in (VERSION): Bump to 1.19r.
3559 (AC_ISC_POSIX): Remove kludgy macro.
3560 Use this test instead:
3561 (LIBS): Add -lcposix if it contains strerror.
3562 Patch from Karl Heuer.
3564 Sun Dec 8 07:22:38 1996 Jim Meyering <meyering@na-net.ornl.gov>
3566 =========== Update for automake-1.1k.
3567 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.1k.
3568 * configure.in (AM_CONFIG_HEADER): Use it.
3569 (AC_OUTPUT): Remove stamp-h timestamping statement.
3570 Now, AM_CONFIG_HEADER does it automatically.
3571 * lib/Makefile.am (noinst_LIBRARIES): Rename to libtu.a as per
3572 new automake requirement.
3573 Rename tu_* variables to libtu_a_*.
3575 Wed Dec 4 21:03:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3577 * src/pr.c: Apply big patch from Roland Huebner.
3579 * src/tr.c (main) [!POSIXLY_CORRECT]: Allow the identity mappings:
3580 [:upper:] to [:upper:] and [:lower:] to [:lower:].
3581 (main) [POSIXLY_CORRECT]: Give a more specific diagnostic for
3582 the invalid identity mappings [:upper:] to [:upper:] and [:lower:]
3584 (class_ok): Update table to reflect that tr now allows these
3585 identity mappings. Suggestion from Risto Kankkunen.
3587 Thu Nov 28 00:31:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3589 * configure.in (AM_GNU_GETTEXT): Renamed from ud_GNU_GETTEXT
3590 for gettext-0.10.25.
3592 Tue Nov 26 23:05:14 1996 Jim Meyering <meyering@na-net.ornl.gov>
3594 * src/sort.c (fraccompare): Add explicit `int' in `register' dcls,
3595 to avoid new warning from gcc.
3597 Sun Nov 24 21:02:15 1996 Jim Meyering <meyering@na-net.ornl.gov>
3599 * tests/sort-test/Makefile.am (t): Add names of those 5 tests.
3601 * tests/sort-test/Test.pm: Add 5 tests to exercize just-fixed code.
3603 * src/sort.c (set_ordering): Revert 1994-05-04 change to this function
3604 so that blanks are not unconditionally ignored when computing start
3605 and end positions for numeric keys with explicit character offsets.
3606 Reported by Markus Demleitner.
3608 Sat Nov 23 16:07:08 1996 Jim Meyering <meyering@na-net.ornl.gov>
3610 * cat.c (usage): Alphabetize option descriptions the way sort -f would.
3611 * fmt.c (usage): Likewise.
3612 * join.c (usage): Likewise.
3613 * md5sum.c (usage): Likewise.
3614 * od.c (usage): Likewise.
3615 * pr.c (usage): Likewise.
3616 * sort.c (usage): Likewise.
3617 * split.c (usage): Likewise.
3618 * wc.c (usage): Likewise.
3621 Fri Nov 22 20:20:37 1996 Jim Meyering <meyering@na-net.ornl.gov>
3623 * src/csplit.c (process_regexp): Update CURRENT_LINE only if
3624 the new value would be larger. This avoids the infinite loop
3625 otherwise provoked by situations like this:
3626 printf "\na\n" | csplit - '/a/-1' '{*}'
3629 Tue Nov 19 23:16:57 1996 Jim Meyering <meyering@na-net.ornl.gov>
3631 * configure.in (AM_SANITY_CHECK_CC): Remove it. Autoconf-2.11
3634 Sat Nov 2 08:50:01 1996 Jim Meyering <meyering@na-net.ornl.gov>
3636 * doc/Makefile.am (MAKEINFO): Set to makeinfo --no-split.
3637 Otherwise, the generated info files have names longer than
3638 the 14-byte max of some old systems.
3639 Reported by Karl Heuer.
3641 Fri Nov 1 21:33:16 1996 Jim Meyering <meyering@na-net.ornl.gov>
3643 * lib/strtol.c: Update from GNU libc.
3645 * tests/sort-test/Test.pm: Add a test to exercize this fix.
3647 * src/sort.c [!ENABLE_ASSERTIONS]: Guard NDEBUG definition.
3648 (checkfp): Fix off-by-one error that resulted in writing one byte
3649 beyond the end of a malloc'd buffer. It caused `sort -c' to segfault
3650 on Linux systems having a relatively recent libc. Before, running
3651 the command, perl -e "print 'x' x 30, \"\n\";"|sort -c
3652 would provoke the memory overrun (though not necessarily the failure).
3654 Reported by Risto Kankkunen.
3656 Thu Oct 31 17:48:24 1996 Jim Meyering <meyering@na-net.ornl.gov>
3658 * src/sort.c (key_init): New function.
3659 (main): Use key_init in the two places where it was open-coded.
3660 This fixes a UMR of the general_numeric field.
3662 * src/join.c (decode_field_spec): Always give FIELD_INDEX a value.
3663 This avoids a spurious UMR report from purify.
3664 (prjoin): Add an assertion.
3665 (add_field): Update assertion.
3667 * src/tr.c (es_free): New function.
3668 (parse_str): Use it to plug a small memory leak.
3670 Wed Oct 23 22:02:24 1996 Jim Meyering <meyering@na-net.ornl.gov>
3672 * lib/md5.c: Update from GNU libc.
3673 * lib/md5.h: Update from GNU libc.
3675 Mon Oct 21 16:48:12 1996 Jim Meyering <meyering@na-net.ornl.gov>
3677 * src/tr.c (validate): Remove TAB from diagnostic, for consistency.
3679 Sun Oct 20 13:44:07 1996 Jim Meyering <meyering@na-net.ornl.gov>
3681 * lib/Makefile.am (INCLUDES): Add -I../intl. Reported by Eric Backus.
3683 * Makefile.am (AUTOMAKE_OPTIONS): Set to `gnits'
3684 (EXTRA_DIST): Remove.
3686 * configure.in: Remove README_ALPHA related code. Automake takes
3687 care of it automatically now when in gnits mode.
3689 * lib/md5.c (md5_process_bytes): Cast void* pointer to char* before
3690 doing arithmetic with it.
3692 Sat Oct 19 23:13:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
3694 * lib/md5.c: Update from GNU libc.
3695 * lib/md5.h: Update from GNU libc.
3697 Fri Oct 18 00:08:04 1996 Jim Meyering <meyering@na-net.ornl.gov>
3699 * configure.in (AC_OUTPUT): Add tests/join-test/Makefile.
3701 * tests/Makefile.am (SUBDIRS): Add join-test.
3703 Tue Oct 15 23:25:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
3705 * src/tr.c (get_next): Rewrite to treat lower/upper mapping as a
3707 (main): Write separate loops to initialize mapping for lower->upper
3708 and upper->lower conversion.
3709 Reported by Arne Henrik Juul.
3711 Sun Oct 13 12:52:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
3713 * lib/xstrtol.c (__xstrtol): Return an error for invalid suffix.
3714 Before, e.g., `split -b 1M' would be silently accepted and treated
3715 like `split -b 1'. Reported by Franc,ois.
3717 * src/split.c (usage): Remove parameter, REASON.
3718 (main): Update callers to use combination of error (0, 0, ... and
3719 usage (EXIT_FAILURE).
3720 (main): When a string operand cannot be converted to a number of
3721 bytes or lines, include that string in the diagnostic.
3723 Sat Oct 12 00:05:11 1996 Jim Meyering <meyering@na-net.ornl.gov>
3725 * configure.in (AC_REPLACE_FUNCS): Add strpbrk and strtol.
3727 * lib/Makefile.am (EXTRA_DIST): Remove.
3729 Thu Oct 10 23:41:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
3731 * lib/md5.c (md5_stream): Apply fix from Ralph Loader
3732 <loader@maths.ox.ac.uk> via Ulrich Drepper.
3734 Wed Oct 9 07:26:40 1996 Jim Meyering <meyering@na-net.ornl.gov>
3736 * lib/Makefile.am (tu_DEPENDENCIES): Depend on $(tu_LIBADD).
3738 Tue Oct 8 21:32:17 1996 Jim Meyering <meyering@na-net.ornl.gov>
3740 * lib/error.c: Include error.h to align with libit --
3741 under protest, François :-).
3743 Sun Oct 6 08:02:28 1996 Jim Meyering <meyering@na-net.ornl.gov>
3745 * acinclude.m4 (AC_HEADER_SYS_TIME_H, AM_FUNC_MKTIME,
3746 AM_FUNC_ERROR_AT_LINE, AM_FUNC_OBSTACK): Remove definitions.
3747 They're included in automake-1.1f.
3749 * configure.in (AM_FUNC_ERROR_AT_LINE): Use it instead of
3752 Sat Oct 5 12:40:22 1996 Jim Meyering <meyering@na-net.ornl.gov>
3754 * lib/memcpy.c [HAVE_CONFIG_H]: Include config.h.
3757 Fri Oct 4 07:20:37 1996 Jim Meyering <meyering@na-net.ornl.gov>
3759 * configure.in (GNU_PACKAGE): New variable.
3760 (PACKAGE_VERSION): Remove it.
3762 * acconfig.h (GNU_PACKAGE): New variable.
3763 (PACKAGE_VERSION): Remove now-unused variable.
3765 * lib/long-options.c (parse_long_options): Separate package name
3766 and version number to accomodate new --version output requirement.
3767 * lib/long-options.h: Update prototype.
3769 Thu Oct 3 23:27:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
3771 * src/md5sum.c (main): Remove dead code that used to print --version
3774 Tue Oct 1 06:54:22 1996 Jim Meyering <meyering@na-net.ornl.gov>
3776 * configure.in: Use result of AM_FUNC_STRTOD to set POW_LIBM.
3777 * src/Makefile.am (sort_LDADD): Use any library (-lm) that
3778 gets substituted for @POW_LIBM@.
3780 * tests/md5sum-test/md5-rfc (md5sum): Use ../../src/md5sum.
3782 Mon Sep 30 23:35:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
3784 * tests/md5sum-test/md5-rfc (md5sum): Set to $srcdir/md5sum.
3786 * acinclude.m4: Update definitions from gettext-0.24.
3788 Sun Sep 29 20:04:53 1996 Jim Meyering <meyering@na-net.ornl.gov>
3790 * tests/sort-test/build-script.pl: Die if close fails.
3791 * tests/tr-test/build-script.pl: Likewise.
3793 * configure.in (AC_OUTPUT): Add tests/cut-test/Makefile.
3794 * tests/Makefile.am (SUBDIRS): Add cut-test.
3795 * tests/cut-test: New directory.
3797 Fri Sep 27 22:22:09 1996 Jim Meyering <meyering@na-net.ornl.gov>
3799 * configure.in (ALL_LINGUAS): Add spanish (es).
3801 Thu Sep 26 21:02:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
3803 * src/md5sum.c (usage): Remove references in --help output to
3804 the now-deprecated --string option. Support for it will be
3805 removed soon. Using this option can provoke a memory access
3806 violation on some systems because of (unavoidable in an efficient
3807 implementation) alignment assumptions made by functions in md5.c.
3808 md5sum.c could leave the option in and accomodate the alignment
3809 restriction, but this option was intended solely for testing, and
3810 the tests are now all file-oriented, so it's not necessary.
3812 * tests/md5sum-test/md5-rfc: Rewrite to avoid use of --string option.
3814 Wed Sep 25 21:43:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
3816 * tests/sort-test/Makefile.am (t): Factor out .in suffix.
3817 Include new test: t16a.
3818 * tests/tr-test/Makefile.am (t): Likewise.
3820 * src/Makefile.am (EXTRA_DIST): Remove md5-test.rfc.
3822 Mon Sep 23 10:00:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
3824 * tests/md5sum-test/Makefile.am (EXTRA_DIST): Distribute $(TESTS).
3826 Sun Sep 22 09:24:22 1996 Jim Meyering <meyering@na-net.ornl.gov>
3828 * src/sort.c (keycompare): Declare translate to be unsigned char *.
3829 Otherwise, sign extension caused misordering when using e.g. -f.
3830 Reported by Erick Branderhorst.
3831 * tests/sort-test/Test.pm: Add Erick's test for that fix.
3833 * tests/Makefile.am (SUBDIRS): Add md5sum-test.
3835 Sat Sep 21 13:34:59 1996 Jim Meyering <meyering@na-net.ornl.gov>
3837 * src/Makefile.am (check): Remove tests for md5sum.
3838 * tests/md5sum-test: New directory. Put them here instead.
3839 * configure.in (AC_OUTPUT): Add tests/md5sum-test/Makefile.
3841 Thu Sep 19 08:54:05 1996 Jim Meyering <meyering@na-net.ornl.gov>
3843 * tests/: Rename from checks.
3844 * Makefile.am (SUBDIRS): Change `checks' to `tests'.
3845 * configure.in (AC_OUTPUT): Likewise.
3847 * configure.in ($PACKAGE, $VERSION): Don't AC_DEFINE_UNQUOTED these.
3848 AM_INIT_AUTOMAKE now does it (as of automake-1.1e).
3850 Sun Sep 15 23:08:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
3852 * Makefile.am (EXTRA_DIST): Remove acinclude.m4.
3854 Thu Sep 12 17:05:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
3856 * lib/Makefile.am (EXTRA_DIST): Add getline.c.
3857 (tu_SOURCES): Remove getline.c
3860 Sun Sep 8 13:55:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3862 * checks/sort-test/build-script.pl: Prefix $in with \$srcdir/
3863 so make check works with VPATH build. From Uli Drepper.
3865 Sat Sep 7 12:25:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
3867 * src/system.h: Add comments justifying IS* versions of ctype.h macros.
3869 * src/fmt.c (check_punctuation): Use ISPUNCT instead of ispunct.
3870 (get_line): Use ISSPACE instead of isspace. From Bruno Haible.
3872 Mon Sep 2 10:34:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
3874 * src/*.c (usage): Tell where to report bugs.
3876 Sun Aug 25 22:50:47 1996 Jim Meyering <meyering@na-net.ornl.gov>
3878 * checks/sort-test/Makefile.am (EXTRA_DIST): Add $x-tests.
3879 ($x-tests): Guard dependencies with @MAINT@.
3880 * checks/tr-test/Makefile.am: Likewise.
3882 Sat Aug 24 14:25:41 1996 Jim Meyering <meyering@na-net.ornl.gov>
3884 * src/cat.c (cat): Cast first arg to stpcpy to char* to avoid warnings.
3886 Wed Aug 21 22:28:26 1996 Jim Meyering <meyering@na-net.ornl.gov>
3888 * configure.in (ALL_LINGUAS): Add polish (pl).
3890 Sun Aug 18 09:34:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
3892 * configure.in (AC_OUTPUT): Add checks/sort-test/Makefile.
3893 * checks/Makefile.am (SUBDIRS): Add sort-test.
3895 Sat Aug 17 18:57:17 1996 Jim Meyering <meyering@na-net.ornl.gov>
3897 * Makefile.am (EXTRA_DIST): Add acinclude.m4.
3899 Tue Aug 13 21:47:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
3901 * src/Makefile.am (EXTRA_DIST): Remove ansi2knr.1 and ansi2knr.c.
3902 Automake includes them automatically.
3904 * configure.in (AM_INIT_AUTOMAKE): Use it.
3905 (AM_PROG_INSTALL): Remove. AM_INIT_AUTOMAKE does this.
3906 (AC_PROG_MAKE_SET): Likewise.
3908 Sun Aug 11 20:49:21 1996 Jim Meyering <meyering@na-net.ornl.gov>
3910 * configure.in: Rename a few macros for automake-1.1c.
3911 (AC_REPLACE_GNU_GETOPT): Remove.
3912 (AC_PATH_PROG): Find perl -- needed only for checks if you
3913 change or remove things with e.g. make maintainerclean.
3916 * lib/Makefile.am (tu_LIBADD): Remove @REGEXOBJ@. New AM_WITH_REGEX
3917 adds .o files to @LIBOBJ@.
3918 (tu_SOURCES): Add getopt.c and getopt1.c.
3919 (EXTRA_DIST): Remove getopt.c and getopt1.c.
3921 * acinclude.m4: New file -- derived from aclocal.m4.
3922 * aclocal.m4: This file is now generated by the aclocal program
3923 (which comes with the automake package.)
3925 Sun Aug 4 10:50:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
3927 * checks/: New directory.
3928 * checks/Makefile.am: New file.
3929 * configure.in (AC_OUTPUT): Add new directories: checks,
3931 * Makefile.am (SUBDIRS): Likewise.
3933 Sat Jul 27 17:22:14 1996 Jim Meyering <meyering@na-net.ornl.gov>
3935 * src/system.h (bindtextdomain) [!ENABLE_NLS]: Undefine to avoid
3936 redefinition warnings on solaris.
3937 (textdomain) [!ENABLE_NLS]: Likewise.
3939 Thu Jul 25 23:06:35 1996 Jim Meyering <meyering@na-net.ornl.gov>
3941 * src/unexpand.c (unexpand): Move EOF check to follow code that
3942 processes and generates output for pending spaces. Before
3943 `printf ' ' |unexpand -t 1,2' generated no output.
3945 * src/md5sum.c (md5_check): Remove parameter, BINARY.
3946 Rename local TYPE_FLAG to BINARY, so md5_file uses the binary mode
3947 from the input stream rather than the one from the command line.
3948 (main): Fail with a diagnostic if --binary or --text is specified
3949 when verifying checksums.
3950 Reported by Eli Zaretskii <eliz@is.elta.co.il>.
3952 Sun Jul 21 11:58:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
3954 * configure.in: Add check for error_at_line so systems with
3955 GNU libc don't compile and link with distributed error.c.
3956 * lib/Makefile.am (tu_SOURCES): Remove error.c.
3957 (EXTRA_DIST): Add error.c.
3959 * configure.in (AC_REPLACE_FUNCS): Replace getline.c.
3960 Add related check for the getdelim function.
3961 From Ulrich Drepper -- as done in gettext.
3963 Sat Jul 20 15:59:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
3965 * configure.in (PACKAGE_VERSION): Use space instead of hyphen to
3966 separate PACKAGE and VERSION.
3968 * aclocal.m4 (AM_SANITY_CHECK_CC): New macro. Derived from
3969 macros from Bruno Haible and from Cygnus.
3970 * configure.in (AM_SANITY_CHECK_CC): Use it.
3972 Wed Jul 17 00:30:28 1996 Jim Meyering <meyering@na-net.ornl.gov>
3974 * install-sh: Get version with MIT copyright.
3976 Tue Jul 16 00:09:37 1996 Jim Meyering <meyering@na-net.ornl.gov>
3978 * aclocal.m4 (fp_C_PROTOTYPES): Improved version from
3980 Update all other macros to reference $fp_cv_prog_cc_stdc, rather
3981 than $ac_cv_prog_cc_stdc.
3983 * src/od.c (OFF_T_MAX): Remove definition.
3984 (main): Compare against LONG_MAX rather than OFF_T_MAX.
3986 Mon Jul 15 23:42:57 1996 Jim Meyering <meyering@na-net.ornl.gov>
3988 * Many files: Update FSF address.
3990 Sun Jul 14 16:53:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
3992 * src/unexpand.c (unexpand): Fix bug that contributed to endless loop
3993 when invoking `echo ' ' |unexpand -t 1,2': use print_tab_index, not
3994 tab_index in inner flush_pend: while loop. From Keith Owens
3995 <kaos@audio.apana.org.au>.
3997 * src/unexpand.c [HAVE_LIMITS_H]: Include limits.h for INT_MAX.
3998 [!INT_MAX]: Define it.
3999 (main): Append INT_MAX to command-line-specified tab list to
4000 ensure termination in unexpand's inner loop.
4001 Derived from a patch from Keith Owens.
4003 Thu Jul 11 22:04:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
4007 * configure.in (VERSION): Bump to 1.19.
4009 Wed Jul 10 22:57:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
4011 * aclocal.m4 (fp_PROG_CC_STDC): Include sys/stat.h in test program
4012 so that DYNIX/ptx V4.1.3 doesn't use `-Xc -D__EXTENSIONS__' -- with
4013 those options on that system, sys/stat.h gets compile errors.
4014 With help from Marcus Daniels.
4016 * getopt.c: Update from gettext-0.10.23.
4017 * getopt1.c: Likewise.
4018 * getopt.h: Likewise.
4020 Tue Jul 9 18:07:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
4022 * src/fmt.c (MAXCOST): Use `(unsigned long)1' rather than `(COST)1'
4023 so the left operand of the << isn't signed.
4024 From Kjetil Torgrim Homme.
4026 * po/Makefile.in.in (install-data): Don't install NLS files when
4027 they're not requested. From Ulrich Drepper. Reported by
4028 Kjetil Torgrim Homme <kjetilho@ifi.uio.no>.
4030 Fri Jul 5 21:55:58 1996 Jim Meyering <meyering@na-net.ornl.gov>
4032 * po/Makefile.in.in ($(PACKAGE).pot): Merge from gettext-0.10.23.
4033 * ABOUT-NLS: Likewise.
4035 * aclocal.m4: Likewise.
4037 Thu Jul 4 07:24:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
4039 * src/uniq.c (usage): Remove space before newline in usage message.
4041 * src/md5sum.c (MIN_DIGEST_LINE_LENGTH): New macro.
4042 [NEWLINE_REPLACEMENT_STRING*]: Remove macros.
4043 (main): Output a leading backslash for a line describing a file
4044 whose name contains a newline. Then translate each NEWLINE byte
4045 in the file name to the string, "\\n", and each backslash to "\\\\".
4046 File names that don't contain NEWLINE aren't translated.
4047 (split_3): Rewrite to handle file names with embedded newlines.
4048 Miles Bader and Jim Blandy suggested this new encoding scheme.
4050 * src/md5sum.c (md5_file): Replace obsolete comment with a description
4052 (md5_check): Don't use "s"-adding trick to form the plural of
4053 `checksum.' That doesn't work well with translation.
4054 Suggestions from Ulrich Drepper.
4055 (split_3): Add missing semicolon so it compiles. From Jim Blandy.
4057 Wed Jul 3 23:21:09 1996 Jim Meyering <meyering@na-net.ornl.gov>
4059 * src/md5sum.c (split_3): Correct test for 35-byte line to accomodate
4060 fact that leading blanks may be stripped.
4062 Tue Jul 2 21:51:40 1996 Jim Meyering <meyering@na-net.ornl.gov>
4064 * configure.in (ALL_LINGUAS): Add dutch (nl).
4066 Mon Jul 1 23:50:19 1996 Jim Meyering <meyering@na-net.ornl.gov>
4068 * src/md5sum.c [NEWLINE_REPLACEMENT_STRING]: Define.
4069 (split_3): Translate NL bytes not to NUL, but to
4070 NEWLINE_REPLACEMENT_STRING.
4071 Suggested by Ulrich Drepper.
4072 (main): Translate back to NL-containing filename.
4074 Sun Jun 30 22:42:17 1996 Jim Meyering <meyering@na-net.ornl.gov>
4076 * src/md5sum.c (split_3): Take an additional parameter, S_LEN.
4078 Map translated NEWLINE-containing filename back into the original
4079 NEWLINE-containing name.
4080 (md5_check): Translate NEWLINE bytes to NUL bytes in filename.
4082 Sat Jun 29 18:59:07 1996 Jim Meyering <meyering@na-net.ornl.gov>
4084 * configure.in (PACKAGE_VERSION): Add `GNU ' prefix so it
4085 appears in the output of --version. Reported by RMS.
4087 Wed Jun 26 21:35:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
4089 * src/Makefile.am (LDADD): Remove sort-specific hack to link
4091 * aclocal.m4 (AM_FUNC_STRTOD): New macro.
4092 * configure.in (AM_FUNC_STRTOD): Use it.
4093 (AC_REPLACE_FUNCS): Remove strtod.
4094 Suggested by Tom Tromey.
4096 * po/Makefile.in.in (install-data): Add `else true;' to avoid
4097 letting failing if-condition cause make failure.
4098 From Fred Fish (fnf@ninemoons.com).
4100 Tue Jun 25 21:55:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
4104 Tue Jun 18 20:43:20 1996 Jim Meyering <meyering@na-net.ornl.gov>
4106 * aclocal.m4: Update from gettext-0.10.20.
4107 * ABOUT-NLS: Likewise.
4110 Thu Jun 13 22:31:39 1996 Jim Meyering <meyering@na-net.ornl.gov>
4112 * configure.in (VERSION): Bump to 1.18a.
4114 * po/Makefile.in.in ($(PACKAGE).pot): Reapply change of May 30.
4115 Depend on POTFILES only when using maintainer mode.
4117 * intl/*: Update from gettext-0.10.18.
4119 Tue Jun 11 23:32:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
4123 * po/Makefile.in.in: Update from gettext-0.10.17.
4125 * ABOUT-NLS: Likewise.
4127 Mon Jun 10 18:22:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
4129 * Makefile.am (cvs-dist): Use -c option in cvs tag command.
4131 Fri Jun 7 22:06:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
4133 * configure.in (VERSION): Set to 1.18.
4135 * src/Makefile.am (sort_LDADD): Set this to -lm to get pow when using
4136 the strtod supplied with this package. Otherwise, linking failed on
4137 Solaris-2.4 systems. Reported by Wayne Stewart <wstewa@atl.com>.
4139 Thu Jun 6 21:57:08 1996 Jim Meyering <meyering@na-net.ornl.gov>
4141 * po/Makefile.in.in: Update from gettext-0.10.16.
4143 * ABOUT-NLS: Likewise.
4144 * aclocal.m4 (AC_REPLACE_GNU_GETOPT): Move definition to precede
4145 gettext-related ones.
4146 Update from gettext-0.10.16.
4148 Fri May 31 22:04:51 1996 Jim Meyering <meyering@na-net.ornl.gov>
4152 * Makefile.am (EXTRA_DIST): Set to texinfo.tex so that file is
4155 Thu May 30 00:07:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
4159 * tail.c (main): Interpret the old-style +VALUE and -VALUE options
4160 like -c VALUE and -c +VALUE (resp) when VALUE has one of the [bkm]
4161 suffix multipliers. This makes the code consistent with --help
4162 output. Reported by Karl Heuer.
4164 * sort.c (limfield): #ifdef-out a block of code that makes
4165 GNU sort incompatible with Unix sort when a key-end spec refers
4166 to the N'th character in a field that has fewer than N characters.
4167 The POSIX spec doesn't appear to specify behavior for this case.
4170 * po/Makefile.in.in (stamp-cat-id): Avoid using temp filename
4171 longer than 14 characters.
4172 (mostlyclean): Likewise.
4175 * po/Makefile.in.in ($(PACKAGE).pot): Depend on POTFILES only
4176 when using maintainer mode. Reported by Karl Heuer.
4178 * po/Makefile.in.in (.po.mo): Reenable dependency and rule.
4179 It is required when using native NLS, e.g. on Solaris.
4180 From Marcus Daniels.
4182 * od.c (decode_one_format): Use %lu (not %d) printf format
4183 corresponding to unsigned long, SIZE.
4187 * intl/Makefile.in (installcheck): New target.
4188 * po/Makefile.in.in (installcheck): New target.
4190 * od.c (decode_one_format): Take another parameter.
4191 Give a specific diagnostic for invalid format spec here rather
4192 than an overly general one from caller's caller.
4193 (decode_format_string): Update caller.
4194 (main): Don't give diagnostic here when decode_format_string fails.
4195 Remove assertions that could fail on some Crays because they don't
4196 have a two-byte type.
4197 Johan Danielsson (joda@pdc.kth.se) reported the failed assertions.
4199 Mon May 27 17:43:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
4201 * cat.c (main): Use STDIN_FILENO and STDOUT_FILENO instead of
4202 less portable fileno (stdin) and fileno (stdout).
4203 * sort.c (main): Use STDIN_FILENO instead of less portable
4206 Mon May 20 21:50:23 1996 Jim Meyering (meyering@na-net.ornl.gov)
4208 * Makefile.am (distcheck): Remove target and rule -- automake-0.33
4209 adds it automatically.
4211 Sun May 19 13:15:49 1996 Jim Meyering (meyering@na-net.ornl.gov)
4213 * configure.in (LINGUAS): Add ko.
4214 * Makefile.am (distcheck): Remove @MAINT@ prefix from first command.
4216 Thu May 16 22:18:41 1996 Jim Meyering (meyering@na-net.ornl.gov)
4218 * Makefile.am (distcheck): New target. From Gord Matzigkeit.
4220 Fri May 10 20:46:13 1996 Jim Meyering (meyering@na-net.ornl.gov)
4222 * po/Makefile.in.in (all-yes): Always depend on CATALOGS. Otherwise
4223 they won't be built and install could fail. From Ulrich Drepper.
4224 (.po.mo): Disable dependency and rule when not in maintainer mode.
4226 * aclocal.m4 (ud_WITH_NLS): Make DATADIRNAME and CATOBJEXT depend
4227 on whether we're using GNU gettext. From Ulrich Drepper.
4229 Wed May 8 21:10:43 1996 Jim Meyering (meyering@na-net.ornl.gov)
4231 * intl/Makefile.in (distdir): Renamed from dist. For compatibility
4233 * po/Makefile.in.in (distdir): Likewise.
4235 * po/Makefile.in.in (all-yes): Depend on GMOFILES.
4236 Depend on CATALOGS and GMOFILES files only in maintainer mode.
4238 Tue May 7 22:10:20 1996 Jim Meyering (meyering@na-net.ornl.gov)
4240 * configure.in: Require autoconf-2.10.
4242 * aclocal.m4 (jm_MAINTAINER_MODE): New macro.
4243 * configure.in (jm_MAINTAINER_MODE): Use it.
4245 Sat May 4 20:40:01 1996 Jim Meyering (meyering@na-net.ornl.gov)
4247 * configure.in (LINGUAS): Add de.
4248 * po/de.po: New file.
4250 * memcasecmp.c [IN_CTYPE_DOMAIN]: Rename from ISASCII.
4251 * regex.c [IN_CTYPE_DOMAIN]: Likewise.
4252 * system.h [IN_CTYPE_DOMAIN]: Likewise.
4254 Sun Apr 28 17:10:03 1996 Jim Meyering (meyering@na-net.ornl.gov)
4256 * fmt.c (copy_rest): Don't copy past end of prefix. Output
4257 trailing spaces if the prefix had any. Before, fmt would
4258 improperly output NUL bytes. The command
4259 perl -e 'print "| S";' |fmt -p' | '|tr '\0' @
4260 output `|@S'. Reported by François Pinard.
4262 * sort.c (main): Give a better diagnostic for `sort -0'.
4263 Reported by Karl Berry.
4265 * configure.in: Make fp_C_PROTOTYPES precede AC_C_INLINE.
4266 Otherwise, some systems lose because the value AC_C_INLINE choses
4267 with plain `cc' is different from that chosen when using the ANSI-mode
4268 C compiler. From Kaveh Ghazi.
4270 Tue Apr 23 22:05:35 1996 Jim Meyering (meyering@na-net.ornl.gov)
4272 * aclocal.m4 (AC_REPLACE_GNU_GETOPT): New macro.
4273 * configure.in: Use it.
4274 * lib/Makefile.am (tu_SOURCES): Remove getopt.c and getopt1.c.
4275 (EXTRA_DIST): Add getopt.c and getopt1.c
4277 * src/*.c, src/*.h: Update Copyright years to include 1996.
4279 Sun Apr 21 08:04:51 1996 Jim Meyering (meyering@na-net.ornl.gov)
4281 * getline.c: New version from gettext-0.10.12.
4282 * getline.h: Likewise.
4283 * configure.in (AC_CHECK_FUNCS): Add getdelim.
4284 Suggested by Ulrich Drepper.
4286 * md5sum.c (md5_check): Remove spurious newline at end of error
4289 * od.c (decode_one_format): Use printf's L modifier for long doubles,
4290 not `l'. From Eric Backus.
4292 * Makefile.am (LDADD): Put @INTLLIBS@ before package library.
4294 * od.c: Include <values.h>.
4295 [!BITSPERBYTE]: Define.
4296 [OFF_T_MAX]: Use BITSPERBYTE, not 8, and cast the result to off_t.
4297 * configure.in (AC_CHECK_HEADERS): Add values.h.
4299 Fri Apr 19 23:48:53 1996 Jim Meyering (meyering@na-net.ornl.gov)
4301 * Makefile.am (cvs-dist): New rule. Based on the one from
4302 Tom Tromey's automake.
4304 Thu Apr 18 22:13:14 1996 Jim Meyering (meyering@na-net.ornl.gov)
4306 * tail.c (main): Make code clearer: use new variable `n_files' in
4307 place of `argc - optind'. Use `file' instead of `argv + optind'.
4309 Sat Apr 13 13:08:29 1996 Jim Meyering (meyering@na-net.ornl.gov)
4311 * lib/Makefile.am (noinst_HEADERS): Include memcasecmp.h,
4314 * memcasecmp.c: Unprotoize.
4318 * join.c (decode_field_spec): Rename local variable `valid'
4319 to invalid (and reverse sense) to avoid conflict with the
4320 macro definition in /usr/include/locale.h on SunOS 4.1.3.
4322 Tue Apr 9 22:43:57 1996 Jim Meyering (meyering@na-net.ornl.gov)
4324 * uniq.c: Add new option --ignore-case (-i).
4325 Include memcasecmp.h.
4326 (different): Compare with memcasecmp if ignoring case.
4329 * join.c (memcasecmp): Remove static definition of function.
4330 Include memcasecmp.h instead.
4332 * memcasecmp.c: New file.
4333 * memcasecmp.h: New file.
4334 * lib/Makefile.am (tu_SOURCES): Add memcasecmp.c.
4335 (noinst_HEADERS): Add memcasecmp.h.
4337 Thu Apr 4 17:05:33 1996 Jim Meyering (meyering@na-net.ornl.gov)
4339 * tr.c: The following commands all failed unnecessarily.
4340 tr -cs '[:upper:]' '[X*]'
4341 tr -dcs '[:lower:]' n-rs-z
4342 tr -ds '[:xdigit:]' [:alnum:]'
4343 tr -dcs '[:alnum:]' [:digit:]'
4345 Reported by Ross Ridge (ross@worf.mks.com).
4346 (validate): Add missing conjunct (translating) in test for
4347 `translating and complementing character classes' error. Before,
4348 valid uses of tr could fail. E.g. `tr -dcs '[:cntrl:]' '[:alnum:]''.
4349 (homogeneous_spec_list): New function.
4350 (validate): Use it to relax the old (overly restrictive) restriction
4351 that prohibited use of complemented character classes when translating.
4352 Now, that is allowed as long as the translation maps many to one.
4353 (get_spec_stats): Rename and redefine global has_char_class from
4356 Wed Apr 3 07:08:57 1996 Jim Meyering (meyering@na-net.ornl.gov)
4358 * aclocal.m4: Update NLS macros from gettext-0.10.11.
4360 * src/Makefile.am (INCLUDES): Add -I$(srcdir) to get system.h
4361 when srcdir != builddir. From Kaveh Ghazi.
4363 Wed Mar 27 23:33:36 1996 Jim Meyering (meyering@na-net.ornl.gov)
4365 * cksum.c (cksum): Use format "%lu %ld" (instead of "%10lu %8ld")
4366 to be POSIX compliant. From Stephen Gildea <gildea@x.org>.
4368 Sun Mar 24 08:47:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4370 * join.c (main): Use EXIT_FAILURE, not 2, as exit code in error call.
4371 * od.c (skip, main): Likewise.
4372 * tr.c (main): Likewise.
4374 * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c fold.c head.c
4375 join.c md5sum.c nl.c od.c paste.c pr.c split.c sum.c tac.c tail.c
4376 tr.c unexpand.c uniq.c wc.c: Exit with status EXIT_SUCCESS or
4377 EXIT_FAILURE, rather than 0 or 1.
4379 Sat Mar 23 23:14:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4381 * system.h [EXIT_FAILURE]: Undefine and define to 1 also if it
4382 is defined to zero. Suggested by Paul Eggert.
4384 * sort.c [SORT_FAILURE]: New macro.
4385 Be careful to exit with 1 only when -c is used and the
4386 input is not properly sorted. In all other cases, use
4387 SORT_FAILURE as required by POSIX.
4388 (main): Change some `error (1, ...' to use SORT_FAILURE.
4389 Upon successful termination, exit with EXIT_SUCCESS instead of `0'.
4390 Replace all uses of `2' (as exit code) with SORT_FAILURE.
4392 Thu Mar 21 22:47:50 1996 Jim Meyering (meyering@na-net.ornl.gov)
4394 * csplit.c: Include assert.h, but disable assertions.
4395 (process_line_count): Replace if-abort with a slightly relaxed
4396 assertion. Before, `echo |csplit - 1 1' would abort.
4397 Reported by Samuli.Karkkainen@hut.fi.
4398 (parse_patterns): Disallow uses like `csplit FILE 0' with zero
4399 line number, `csplit FILE 2 1' with decreasing line numbers, and
4400 warn about uses like `csplit FILE 3 3' that have equal line numbers.
4402 * sort.c (main): Declare to be of type int, not void.
4403 From Peter Seebach <seebs@taniemarie.solon.com>.
4404 * cat.c cksum.c comm.c csplit.c cut.c expand.c fold.c head.c join.c
4405 nl.c paste.c pr.c split.c sum.c tac.c tail.c tr.c unexpand.c uniq.c
4406 wc.c (main): Likewise.
4408 Sat Mar 16 16:30:07 1996 Jim Meyering (meyering@na-net.ornl.gov)
4410 * configure.in (PACKAGE_VERSION): New macro.
4411 * acconfig.h (PACKAGE_VERSION): Add it.
4412 * src/Makefile.am: Remove rules for generating version.c.
4413 Remove references to version.o, version.h, and stamp-v.
4414 * version.c: Remove file.
4415 * version.h: Remove file.
4416 * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c fold.c
4417 head.c join.c md5sum.c nl.c od.c paste.c pr.c sort.c split.c
4418 sum.c tac.c tail.c tr.c unexpand.c uniq.c wc.c: Don't include
4420 (main): Use PACKAGE_VERSION instead of version_string.
4422 Mon Mar 11 16:07:08 CST 1996 Jim Meyering (meyering@na-net.ornl.gov)
4424 * sort.c (write_bytes): Renamed from xfwrite.
4425 Remove SIZE parameter. It was always 1. Update all callers.
4426 Rename NELEM parameter to N_BYTES and change its type to size_t.
4428 Sat Mar 9 13:30:12 1996 Jim Meyering (meyering@na-net.ornl.gov)
4430 * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c
4431 fold.c head.c join.c md5sum.c nl.c od.c paste.c pr.c sort.c
4432 split.c sum.c tac.c tail.c tr.c unexpand.c uniq.c wc.c (main):
4433 Initialize for internationalized message support: call setlocale,
4434 bindtextdomain, and textdomain.
4435 * system.h: Add definitions and includes for NLS.
4436 * Makefile.am (SUBDIRS): Add intl and po.
4437 * src/Makefile.am (datadir): Define.
4438 (localedir): Define.
4439 (DEFS): Add LOCALEDIR definition.
4440 (LDADD): Add @INTLLIBS@.
4441 * aclocal.m4: Add NLS-related macro definitions from
4442 gettext distribution.
4443 * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_LC_MESSAGES,
4444 HAVE_STPCPY): New macros.
4445 Add PACKAGE and VERSION.
4446 * configure.in (PACKAGE): Define with AC_DEFINE_UNQUOTED.
4447 (VERSION): Likewise.
4448 (ALL_LINGUAS): Define.
4449 (AC_CHECK_HEADERS): Add float.h.
4450 (ud_GNU_GETTEXT): Use it.
4452 (AC_OUTPUT): Reflect addition of two new directories, intl and po.
4454 From François Pinard.
4456 * tr.c (star_digits_closebracket): Declare formal param, IDX,
4457 and local I to be of type size_t (rather than int) to avoid
4458 warnings from gcc -Wall.
4460 Wed Feb 28 20:32:48 1996 Jim Meyering (meyering@na-net.ornl.gov)
4462 * src/Makefile.am: Adapt for automake-0.30.
4463 (noinst_HEADERS): Rename from HEADERS.
4464 (INCLUDES): Remove -I.. and -I$(srcdir). automake-0.30 adds these
4465 to DEFS automatically.
4466 * lib/Makefile.am: (noinst_HEADERS): Rename from HEADERS.
4468 Wed Feb 21 18:56:27 1996 Jim Meyering (meyering@na-net.ornl.gov)
4470 * join.c (xfields) [without -t]: Ignore leading blanks.
4471 From David Dyck (dcd@tc.fluke.COM).
4473 Sun Feb 18 12:07:27 1996 Jim Meyering (meyering@na-net.ornl.gov)
4475 * join.c [TOLOWER]: Define.
4476 (usage): Briefly describe new --ignore-case (-i) option.
4477 (memcasecmp): New function.
4478 (main): Set IGNORE_CASE for -i.
4479 (keycmp): Compare with memcasecmp if IGNORE_CASE is set.
4480 Suggestion and an initial patch from Alberto Accomazzi
4481 <alberto@cfa0.harvard.edu>.
4483 Sat Feb 17 18:54:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4485 * sort.c: Add -z option. Change all occurrences of '\n' to `eolchar'.
4486 (usage): Describe it.
4487 (main): Set eolchar to 0 for -z.
4488 From Mark W. Eichin <eichin@cygnus.com>.
4490 Fri Feb 16 21:44:14 1996 Jim Meyering (meyering@na-net.ornl.gov)
4492 * join.c (main): Mark two strings for translation.
4493 * md5sum.c (md5_check): Mark a string for translation.
4494 From François Pinard.
4496 Mon Feb 12 21:12:28 1996 Jim Meyering (meyering@na-net.ornl.gov)
4498 Update for automake-0.29.
4499 * Makefile.am (CONFIG_HEADER): Don't define. Automake now does it.
4500 * src/Makefile.am: Likewise.
4501 * lib/Makefile.am: Likewise.
4502 * doc/Makefile.am (info_TEXINFOS): Renamed from TEXINFOS.
4503 * man/Makefile.am (man_MANS): Renamed from MANS.
4505 * fmt.c [TRUE]: Undefine before defining to avoid warning on NeXT.
4507 From Derek Clegg (dclegg@next.com).
4509 Sat Feb 3 16:20:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4513 Wed Jan 31 23:26:13 1996 Jim Meyering (meyering@na-net.ornl.gov)
4515 * tail.c (dump_remainder): Flush stdout when tailing-forever on
4516 multiple files. From Carlos Canau <Carlos.Canau@relay.puug.pt>.
4518 Fri Jan 5 18:30:28 1996 Jim Meyering (meyering@na-net.ornl.gov)
4520 * aclocal.m4: For SVR4 systems, use -Xc -D_POSIX_C_SOURCE in CFLAGS,
4521 not just -Xc. From François Pinard.
4523 * doc/Makefile.am (DIST_OTHER): Don't set to mdate-sh. mdate-sh is
4524 distributed automatically. From Tom Tromey.
4526 Thu Jan 4 20:32:52 1996 Jim Meyering (meyering@na-net.ornl.gov)
4528 * nl.c: Include rx.h after limit.h (not before) to avoid warning
4529 about the redeclaration of RE_DUP_MAX in limit.h. rx.h protects
4530 its definition. From Kaveh Ghazi.
4532 * src/Makefile.am (DIST_OTHER): Include md5-test.rfc so make check
4533 works again. Reported by François Pinard and Kaveh Ghazi.
4535 * rx.c [SYNTAX]: Rename from SYNTAX_TABLE.
4536 [SYNTAX_TABLE]: Remove extern dcl of re_syntax_table.
4537 (RE_SEARCH_2_FN): Cast string1 and string2 to avoid pointer type
4538 mismatch errors from e.g. SunOS's /bin/cc.
4539 Reported by Kaveh Ghazi.
4541 Wed Jan 3 23:34:39 1996 Jim Meyering (meyering@na-net.ornl.gov)
4543 * configure.in (VERSION): Set variable directly rather than from
4545 * Makefile.am (DIST_OTHER): Remove VERSION.
4546 * src/Makefile.am (version.c): Depend on Makefile, not ../VERSION.
4547 (stamp-v): New target; depend on Makefile.
4548 (DISTCLEANFILES): Add stamp-v, version.c.
4550 Tue Jan 2 00:08:08 1996 Jim Meyering (meyering@na-net.ornl.gov)
4552 * sort.c (keycompare): Rewrite cases handling ignored characters
4553 so that they really are ignored. Reported by Carl Johnson
4554 <carlj@cjlinux.home.org>.
4556 Fri Dec 22 21:34:55 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4558 * configure.in: Touch stamp-h only if config.h is remade.
4560 * csplit.c (extract_regexp) [!WITH_REGEX]: Intialize
4561 syntax_parens field.
4563 Mon Dec 18 21:42:44 1995 Jim Meyering (meyering@comco.com)
4565 Use automake to generate Makefile.in files.
4566 * Makefile.am: New file.
4567 * doc/Makefile.am: New file.
4568 * lib/Makefile.am: New file.
4569 * man/Makefile.am: New file.
4570 * src/Makefile.am: New file.
4572 Thu Dec 14 21:13:22 1995 Jim Meyering (meyering@comco.com)
4574 * fmt.c (main): Use xstrtol instead of atoi.
4576 * fold.c (main): Use xstrtol instead of atoi.
4577 (fold_file): Make a couple locals `int', not size_t, and cast
4578 fwrite's third parameter to size_t.
4580 * nl.c (main): Use xstrtol instead of atoi.
4581 Rename misleading --first-page=N option to --starting-line-number=N.
4584 * uniq.c (main): Use xstrtol instead of atoi.
4586 Fri Dec 8 20:48:00 1995 Jim Meyering (meyering@comco.com)
4588 * aclocal.m4 (fp_C_PROTOTYPES): Set ANSI2KNR to ./ansi2knr.
4590 Thu Dec 7 19:55:03 1995 Jim Meyering (meyering@comco.com)
4592 * aclocal.m4 (ud_WITH_REGEX): New macro.
4593 * configure.in: Use it.
4594 * rx.c, rx.h: New files.
4595 * lib/Makefile.in (REGEX): Set to @REGEXOBJ@, not regex.o.
4596 (SOURCES, DISTFILES): Add rx.c, rx.h.
4597 * acconfig.h (WITH_REGEX): Add it.
4598 * csplit.c [!WITH_REGEX]: Include rx.h.
4599 * nl.c [!WITH_REGEX]: Likewise.
4600 * tac.c [!WITH_REGEX]: Likewise.
4601 From Ulrich Drepper and François Pinard.
4603 Tue Dec 5 17:49:53 1995 Jim Meyering (meyering@comco.com)
4605 * sort.c (main): Diagnose invalid arguments to -k, then fail.
4607 * sort.c (numcompare): Properly handle all cases in which signs differ.
4610 * Makefile.in (mandir): @mandir@ is just $(prefix)/man.
4611 Append `/man1'. Reported by Karl Heuer.
4613 * sum.c (bsd_sum_file): Remove misleading comment. From Karl Heuer.
4615 * src/Makefile.in [.c._o]: Don't create $<-tmp. From Kaveh Ghazi.
4617 Fri Dec 1 01:02:36 1995 Jim Meyering (meyering@comco.com)
4619 * lib/Makefile.in (default): New target.
4621 * sort.c (numcompare): Properly order `-' and valid integers;
4622 treat `-' as if it were zero. Reported by Ross Alexander
4623 <r.alexander@auckland.ac.nz>.
4625 * Makefile.in (DISTFILES): Remove unused mkdep-Makefile.
4626 (.PHONY): Depend on default.
4628 Wed Nov 29 21:50:53 1995 Jim Meyering (meyering@comco.com)
4630 * aclocal.m4 (jm_PROG_C_MKDEP): Remove, for now.
4631 (jm_AUTODEPS): Likewise.
4632 (jm_WITH_GNU_MAKE): Likewise.
4633 * configure.in (jm_AUTODEPS): Remove.
4635 * sort.c (begfield): Replace loop with equivalent if-else.
4636 (limfield): Fix bug that made field specs like -k1.5 return a
4637 pointer into LINE beyond the first field.
4638 Don't try to trim trailing blanks here; it's not
4639 possible because we don't know where the field begins.
4640 Replace loop with equivalent if-else.
4641 (trim_trailing_blanks): New function.
4642 (findlines): Call it.
4643 (keycompare): Likewise.
4644 (main): Don't decrement T2 corresponding to `x' in field
4645 specs like -ku.v,w.x.
4647 Sun Nov 26 15:50:23 1995 Jim Meyering (meyering@comco.com)
4649 * csplit.c [!UINT_MAX]: Define.
4652 (string_to_number): Remove function.
4653 (check_for_offset): Use xstrtoul instead of string_to_number.
4654 (parse_repeat_count): Likewise.
4655 (parse_patterns): Likewise.
4658 Wed Nov 22 23:12:47 1995 Jim Meyering (meyering@comco.com)
4660 * Makefile.in (all et. al.): If make was invoked with -k and a
4661 sub-make fails, fail after the loop rather than exiting right away.
4662 Otherwise, make's -k option could be ineffective.
4664 Sat Nov 18 12:04:30 1995 Jim Meyering (meyering@comco.com)
4666 * src/Makefile.in (version.c): Depend on ../VERSION, not Makefile.
4668 Update for autoconf-2.5:
4669 * src/Makefile.in (libdir): Set to @libdir@.
4670 (bindir): Set to @bindir@.
4671 * doc/Makefile.in (infodir): Set to @infodir@.
4672 * man/Makefile.in (exec_prefix): Remove it.
4673 (mandir): Set to @mandir@.
4674 (bindir): Remove it.
4676 Thu Nov 16 21:25:45 1995 Jim Meyering (meyering@comco.com)
4678 * Makefile.in (default): New default target. Depend on `all' to
4679 work around bug in AIX-3.2.5's /bin/make. Reported by Andreas Luik
4682 Wed Nov 15 23:48:31 1995 Jim Meyering (meyering@comco.com)
4684 * mkdep-Makefile (.deps/empty.P): Depend on BUILT-HEADERS.
4686 * aclocal.m4 (jm_PROG_C_MKDEP): Rename from jm_PROG_MKDEP.
4687 * src/Makefile.in (C_MKDEP): Rename from MKDEP.
4688 * lib/Makefile.in (C_MKDEP): Likewise.
4689 * mkdep-Makefile (C_MKDEP): Likewise.
4692 * csplit.c [__P]: Don't define it here.
4693 * pr.c [__P]: Don't define it here.
4694 * fmt.c [__P]: Don't define it here.
4695 * system.h [__P]: Define it here.
4697 * aclocal.m4 (jm_AUTODEPS): Rename from jm_WITH_AUTODEPS.
4698 Revamp, with suggestions from Franc,ois Pinard.
4699 (jm_WITH_GNU_MAKE): New macro.
4700 (jm_PROG_MKDEP): New macro.
4701 * configure.in (jm_PROG_MKDEP): Use it.
4702 * src/Makefile.in (MKDEP): Set it.
4703 * lib/Makefile.in (MKDEP): Likewise.
4704 * mkdep-Makefile: Use MKDEP, not DEP_CC.
4705 (DEP_CFLAGS): Remove it.
4707 Tue Nov 14 23:10:54 1995 Jim Meyering (meyering@comco.com)
4709 * sort.c: Add support for sorting numbers in scientific notation.
4711 (struct keyfield): Add field: general_numeric.
4712 (usage): Describe -g option.
4713 (general_numcompare): New function.
4714 (keycompare): Use new comparison function when general_numeric
4716 (set_ordering): Honor `g' flag.
4717 (main): Initialize and use new field.
4718 From Marcus Daniels <marcus@sysc.pdx.edu>.
4720 * configure.in (AC_REPLACE_FUNCS): Add strtod.
4721 * lib/Makefile.in (SOURCES): Add xstrtod.c.
4722 (OBJECTS): Add xstrtod.o.
4723 (DISTFILES): Add xstrtod.h.
4725 * csplit.c (cleanup): Don't exit.
4726 (interrupt_handler): Rewrite to reset default signal handler
4727 then repost caught signal.
4728 (xmalloc, xrealloc, read_input, write_to_file, handle_line_error,
4729 process_line_count, process_regexp, create_output_file,
4730 close_output_file): Call cleanup_fatal, not cleanup.
4731 Add const attribute to lots of parameters.
4732 (cleanup_fatal): Renamed from cleanup. Call cleanup, then exit.
4735 * tac.c: (cleanup): Don't exit.
4736 (cleanup_fatal): New function. Call cleanup, then exit.
4737 (sighandler): New function.
4738 (cleanup_fatal): Renamed from cleanup. Call cleanup, then exit.
4740 (tac_stdin): Set up sighandler as signal handler, not `cleanup'.
4742 Sat Nov 11 15:46:02 1995 Jim Meyering (meyering@comco.com)
4744 * od.c (skip): Cast fseek's offset argument to `long'.
4745 Erik Bennett <bennett@cvo.oneworld.com> reported that this is
4746 necessary on BSDI systems. And if offset doesn't fit in a long,
4747 then try using lseek instead.
4749 * sort.c (xmalloc): Declare static.
4750 (xrealloc): Likewise.
4752 * tac.c (cleanup): Add signal number parameter.
4755 * cat.c (main): Don't die when dev/ino of input and output are
4756 the same and the file descriptors correspond to stdin and stdout.
4757 This is necessary on at least Digital UNIX (aka OSF1) 3.2C.
4758 Otherwise, running `cat << X > $$' would fail with `cat: -: input
4759 file is output file'. From Jarkko Hietaniemi <jhi@epsilon.hut.fi>.
4761 * Makefile.in (DISTFILES): Add @README_ALPHA@.
4762 (config.status) Depend on VERSION.
4763 * configure.in: Set README_ALPHA if the version number ends in [a-z].
4765 Fri Nov 10 21:13:42 1995 Jim Meyering (meyering@comco.com)
4767 * fold.c (usage): Clarify meaning of --spaces. From Karl Berry.
4769 src/Makefile.in (.c._c): Don't redirect directly to $@.
4770 (._c._o, .c._o): Remove temporary src file.
4772 Tue Nov 7 23:55:24 1995 Jim Meyering (meyering@comco.com)
4774 * VERSION: New file.
4775 * configure.in (VERSION): New variable.
4776 (PACKAGE): New variable.
4778 * Makefile.in (DISTFILES): Add VERSION.
4779 (distdir): Use @PACKAGE@-@VERSION@, not distname.
4780 Remove all references to distname.
4781 * src/Makefile.in (version.c): Generate it.
4782 (SOURCES): Remove now-generated version.c.
4783 (distclean): Delete version.c.
4784 * doc/Makefile.in (version.texi): Use @PACKAGE@-@VERSION@,
4787 * */Makefile.in (distdir): Use @PACKAGE@-@VERSION@, not distname.
4788 Remove all references to distname.
4790 * split.c: New option: --verbose.
4791 (main): Recognize it.
4792 (usage): Document it.
4793 From Marty Leisner <leisner@sdsp.mc.xerox.com>.
4795 Sun Nov 5 06:59:27 1995 Jim Meyering (meyering@comco.com)
4797 * src/Makefile.in: Reflect protoization of csplit.c, fmt.c, pr.c,
4801 (store_columns): Remove spurious 2nd argument in call to read_line.
4802 [__P]: Define. Use it in prototyped forward decls.
4804 * csplit.c: Move prototypes after struct declarations.
4805 Remove prototypes for xmalloc, xrealloc.
4806 Protect prototypes with __P.
4807 (new_control_record): Cast arg 1 to realloc.
4809 * fmt.c [__P]: Test PROTOTYPES, not __STDC__.
4812 Sat Nov 4 23:51:30 1995 Jim Meyering (meyering@comco.com)
4814 * csplit.c (close_output_file): Set output_stream to NULL so we
4815 don't recurse endlessly between this function and cleanup.
4817 * unexpand.c: Reorder functions to obviate forward dcls. Remove
4818 forward dcls. Protoize. Add `const' attribute to some parameters.
4820 Mon Oct 30 23:15:56 1995 Jim Meyering (meyering@comco.com)
4822 * wc.c: Reorder functions to obviate forward dcls. Remove
4823 forward dcls. Protoize. Add `const' attribute to some parameters.
4825 * split.c: Likewise.
4827 * split.c (isdigits, convint): Remove these.
4828 (main): Use xstrtol instead.
4830 Sun Oct 29 14:04:36 1995 Jim Meyering (meyering@comco.com)
4832 * paste.c (main): Move function body to end of file.
4833 Remove forward dcls and protoize.
4834 * sum.c (main): Likewise.
4835 * nl.c: Protoize. Reorder functions to obviate forward dcls.
4836 Remove forward dcls.
4838 * src/Makefile.in (OBJECTS): Reflect that all of the above
4841 * sum.c (bsd_sum_file): Give file name parameter const attribute.
4842 (sysv_sum_file): Likewise.
4844 * tac.c (xwrite): Give output buffer parameter const attribute.
4845 (output): Likewise for both parameters.
4846 (tac): Likewise for file name parameter.
4847 (tac_file): Likewise.
4849 Sat Oct 28 16:02:39 1995 Jim Meyering (meyering@comco.com)
4851 * md5sum.c (md5_check): Use the same message format when there is
4852 a single file and it gets a read error or checksum mismatch as when
4853 there are more. Write that warning to standard error, not standard
4854 output. Suggestions from Greg Troxel (gdt@b-sgi.bbn.com).
4856 Thu Oct 26 00:11:35 1995 Jim Meyering (meyering@comco.com)
4858 * sort.c (xtmpfopen): New function to set proper permissions on
4859 temporary files. Use it instead of xfopen. Reported by Erik Corry
4860 (erik@kroete2.freinet.de).
4862 Mon Oct 23 23:17:04 1995 Jim Meyering (meyering@comco.com)
4864 * aclocal.m4 (jm_WITH_AUTODEPS): New directive.
4865 * configure.in: Use it.
4867 * lib/Makefile.in (INCLUDE, COMPILE): New variables.
4868 (.c.o): Rewrite to be more like src/Makefile.in.
4870 * src/Makefile.in (distclean): Remove .deps.
4871 Include @top_srcdir@/mkdep-Makefile.
4873 * mkdep.Makefile: New file.
4874 * Makefile.in (DISTFILES): Add mkdep-Makefile.
4875 * doc/Makefile.in (mostlyclean): Also remove *.info.
4877 Thu Oct 19 17:38:28 1995 Jim Meyering (meyering@comco.com)
4879 * od.c: Indent cpp directives.
4881 * tr.c (BEGIN_STATE): Use INT_MAX - 1 so as not to interfere
4882 with large repeat counts.
4883 (struct E_string): New struct.
4884 (find_closing_delim): Take E_string arg rather than char* and length.
4885 (find_bracketed_repeat): Likewise.
4886 (star_digits_closebracket): New function.
4887 (append_char_class): No longer give diagnostic.
4888 (append_equiv_class): Likewise.
4889 (build_spec_list): Give them here instead, allowing string1 like
4890 [:*][:upper:] that got errors before.
4891 Take E_string arg rather than char*.
4892 Convert switch stmts into if-then so as to use ES_MATCH.
4894 Tue Oct 17 22:48:00 1995 Jim Meyering (meyering@comco.com)
4896 * cat.c: Protoize. Reorder functions to obviate forward dcls.
4897 Remove forward dcls.
4898 * expand.c: Likewise.
4905 * src/Makefile.in (OBJECTS): Reflect that all of the above
4908 * head.c: Add `const' attribute to dcls of lots of formals.
4910 * sort.c: Add `const' attribute to dcls of lots of formals.
4911 Move struct dcls to precede dcls of file-scope variables.
4912 (monthtab, keyhead): Separate variable dcls from type dcls.
4914 Fri Oct 13 20:38:39 1995 Jim Meyering (meyering@comco.com)
4916 * join.c (add_field_list): Allow SPACE and TAB as well as `,' as
4917 list item separators, per POSIX spec.
4918 (prjoin): Rewrite loop that iterates over field specs.
4919 Handle case in which file spec is 0.
4921 Sun Oct 8 22:41:15 1995 Jim Meyering (meyering@comco.com)
4923 * strpbrk.c: New file.
4924 * lib/Makefile.in (SOURCES): Add strpbrk.c.
4927 Sat Oct 7 22:27:01 1995 Jim Meyering (meyering@comco.com)
4929 * join.c (add_field): No longer return a value.
4930 (decode_field_spec): New function.
4931 (add_field_list): Rewrite to be more strict.
4932 Before, `,1.2' was accepted as valid.
4933 (main): Use xstrtol instead atoi.
4934 Combine nearly identical -a and -v cases.
4937 Fri Oct 6 23:10:01 1995 Jim Meyering (meyering@comco.com)
4939 * join.c (main): Report `too few/many non-option arguments'
4940 then print --help output rather than just the latter.
4941 Properly interpret obsolescent usage like `join -o 2.1 2.1 2.2'.
4942 (usage): Describe POSIX -1, -2 options and deprecate -j* ones
4944 * join.c (usage): Move to precede all other functions.
4948 Tue Oct 3 22:44:05 1995 Jim Meyering (meyering@comco.com)
4950 * csplit.c, sort.c, tac.c: Test SA_INTERRUPT, not _POSIX_VERSION,
4951 to determine whether `sigaction' functions are available.
4952 Reported by Paul Nevai <nevai@ops.mps.ohio-state.edu>.
4953 Fix suggested by Karl Berry.
4955 * md5sum.c (main): Declare counter, N_STRINGS, to be an integral
4958 * cut.c: Convert many declarations using `int' to use `unsigned int'
4959 to avoid warnings from `gcc -Wall' about comparing signed and
4961 (set_fields): Use memset (not open coded loop) to initialize array.
4963 Thu Sep 28 23:16:05 1995 Jim Meyering (meyering@comco.com)
4967 * Makefile.in (DISTFILES): Remove README.alpha for major release.
4969 * od.c (decode_one_format): Remove spurious semicolon.
4972 Tue Sep 26 23:05:01 1995 Jim Meyering (meyering@comco.com)
4974 * man/Makefile.in (install-data, uninstall): Use sed not basename.
4975 The GNU Coding Standard suggests that only a select set of
4976 relatively standard utilities be used in Makefiles. basename is
4977 not among them. Suggested by Ulrich Drepper.
4979 Sun Sep 24 08:36:47 1995 Jim Meyering (meyering@comco.com)
4981 * cksum.c: Protoize.
4984 * src/Makefile.in (OBJECTS): Reflect that cksum.c and cut.c use
4986 (cksum): Depend on cksum$O.
4987 (cut): Depend on cut$O.
4989 Sat Sep 23 15:43:46 1995 Jim Meyering (meyering@comco.com)
4993 * Makefile.in (DISTFILES): Add README.alpha.
4995 * lib/Makfile.in: (GETOPT, MEMCHR, REGEX): New variables.
4996 (OBJECTS): Use them instead of hardcoding object file names.
4997 Suggested by Ulrich Drepper.
4999 * md5sum.c (md5_check): Distinguish between open/read failure
5000 and checksum mismatch.
5002 Mon Sep 18 23:15:05 1995 Jim Meyering (meyering@comco.com)
5004 * md5sum.c: Protoize.
5005 * src/Makefile.in (OBJECTS): Change md5sum.o to md5sum$O.
5006 (join.o, md5sum$O, sort.o) Depend on ../lib/long-options.h.
5007 (md5sum): Depend on md5sum$O.
5009 * md5sum.c (main, usage): Remove -h, -s, -v short options.
5010 Rename --verbose to --warn, --quiet to --status.
5011 (main): Handle --help and --version using parse_long_options.
5012 (md5_check): Check ferror.
5014 * sort.c (tempname): Replace `16' with a more readable expansion.
5015 Make sure that counter never exceeds 99999.
5016 (checkfp): Rearrange loop to avoid duplicate test.
5017 Move a couple dcls from function scope into inner block.
5019 Tue Aug 8 21:49:27 1995 Jim Meyering (meyering@comco.com)
5021 * md5sum.c (main): Fail if either --verbose or --quiet is specified
5022 when not verifying checksums.
5024 * md5sum.c (md5_check): Fail if no valid line is found.
5025 Don't use the word `fail' unless there were failures --
5026 instead, say `all N tests passed.'
5028 * md5sum.c (main) [handling --string option]: Don't output
5029 nonstandard `b' binary flag. From Greg Troxel (gdt@bbn.com).
5030 * md5-test.rfc: Remove now-inconsistant `b' marker.
5031 (usage): Clarify help message. With suggestions from Greg Troxel.
5033 Mon Aug 7 23:27:54 1995 Jim Meyering (meyering@comco.com)
5035 * sort.c (mergefps) [lint]: Initialize SAVEALLOC to avoid spurious
5036 compiler warning. From Ulrich Drepper.
5038 * pr.c (read_line) [lint]: Initialize CHARS to avoid spurious
5039 compiler warning. From Ulrich Drepper.
5041 * Makefile.in (DISTFILES): Don't distribute unneeded COPYING.LIB.
5044 Mon Aug 7 00:02:59 1995 Jim Meyering (meyering@comco.com)
5046 * system.h (_): Define macro -- as empty for now.
5047 * src/*.c: Annotate localizable strings with _(...). From Franc,ois.
5049 Sat Aug 5 23:51:25 1995 Jim Meyering (meyering@comco.com)
5053 * configure.in: Add fp_C_PROTOTYPES.
5055 Fri Aug 4 23:21:46 1995 Jim Meyering (meyering@comco.com)
5057 * src/Makefile.in (DISTFILES): Include ansi2knr.c and ansi2knr.1.
5058 Add suffixes, dependencies, and rules to convert ANSI source to K&R
5059 when required. Mark tr.o and comm.o as the only such files (for now).
5064 * Makefile.in (DISTFILES): Add aclocal.m4 and acconfig.h.
5065 (configure): Depend on aclocal.m4.
5066 (stamp.h.in): Depend on aclocal.m4 and acconfig.h.
5068 Sun Jul 30 00:01:58 1995 Jim Meyering (meyering@comco.com)
5070 * md5sum.c (md5_check): Use getline instead of fgets.
5072 * lib/Makefile.in: (SOURCES): Add getline.c.
5073 (OBJECTS): Add getline.o.
5074 (DISTFILES): Add getline.h.
5075 (getline.o): Depend on getline.h.
5077 * md5.c [memcpy]: Define to bcopy if needed.
5078 (md5_buffer): Explicitely cast SWAP expressions to unsigned
5081 * lib/Makefile.in (strtoul.o): Depend on strtol.c.
5083 * sort.c (check): Print `disorder on...' message on standard error,
5084 not stdout. This is a minor concession to POSIX which says
5085 `no output shall be produced...'.
5087 * sort.c (main): Fix -k so it works. -k 2,3 was being treated
5088 like -k 2. Reported by Marcus Daniels <marcus@sysc.pdx.edu>.
5090 Wed Jul 26 22:54:48 1995 Jim Meyering (meyering@comco.com)
5092 * man/Makefile.in (install, uninstall): Strip off `.1', not just `1'
5093 before applying $(transform) to manual name. From Karl Berry.
5095 * md5sum.c (have_read_stdin): New global variable.
5096 (md5_file, md5_check): Set it.
5099 * md5sum.c [OPENOPTS]: Depend explicitly on BINARY.
5100 (md5_file): Take a new parameter, MD5_RESULT, and no longer
5102 (md5_check): Invoke md5_file instead of calling fopen directly.
5103 When giving a diagnostic for a line with invalid format, also report
5105 (main): Generate output after a successful md5_file call.
5106 [in many places]: Upon detection of an error, rather than exiting
5107 immediately, issue a diagnostic, note that an error occurred and
5110 Mon Jul 24 21:48:26 1995 Jim Meyering (meyering@comco.com)
5112 * tail.c (tail_bytes) [from_start]: For regular files, seek
5113 relative to the initial input file pointer position, not
5114 necessarily from the beginning of the file.
5115 [!from_start]: Don't back up past the initial position of the
5117 (tail_lines): Call file_lines only if FD refers to a regular file
5118 with its file pointer positioned at beginning of file. Otherwise,
5119 call pipe_lines. This is a kludge. Once there's a decent test
5120 suite, fix this properly.
5121 Before, (echo 1; echo 2) > k; sh -c 'read x; tail' < k
5122 would output both lines of the input file even though the first had
5123 already been read. Reported by John Roll (john@panic.harvard.edu).
5125 * md5sum.c [_LIBC || STDC_HEADERS] (TOLOWER): Define to tolower.
5127 * csplit.c (main): When too few arguments are given, don't just
5128 issue the usage message; also report why.
5130 Sat Jul 22 00:16:01 1995 Jim Meyering (meyering@comco.com)
5132 * md5sum.c (md5_check): New function -- extracted from main.
5134 Fri Jul 21 01:21:49 1995 Jim Meyering (meyering@comco.com)
5136 * md5sum.c (md5_file): New function -- extracted from main.
5137 (main): Call the new function instead of doing all that in an
5138 if-stmt. Always use "%s" format rather than raw filename as
5139 format argument in printf-style functions like error. Otherwise,
5140 filenames containing `%' are likely to lose.
5141 Remove all mention of `old format'.
5142 (split_3): No longer parse the `new format.' There is only one
5143 valid format now: the compatible one.
5145 * lib/Makefile.in: (SOURCES): Add md5.c.
5146 (OBJECTS): Add md5.o.
5147 (DISTFILES): Add md5.h.
5148 (md5.o): Depend on md5.h.
5150 * system.h [!EXIT_FAILURE, !EXIT_SUCCESS]: Define them.
5151 * lib/md5.c (md5_stream): Check for read failure and return
5152 indication of success rather than second argument.
5153 * lib/md5.h (md5_stream): Update prototype.
5154 [__P]: Define macro.
5155 * md5sum.c: Use EXIT_FAILURE and EXIT_SUCCESS.
5156 (main): Report an error if md5_stream fails. Otherwise, running
5157 `md5sum dir-on-mounted-filesystem' always reported the checksum
5158 for an empty file. Now it gets the `is a directory' error.
5159 Greg McGary (gkm@magilla.cichlid.com) reported that the released
5160 version got stuck in an infinite loop with such arguments.
5162 * lib/md5.c: New file.
5163 * lib/md5.h: New file.
5164 * md5sum.c: Rewritten to use library interface.
5165 From Ulrich Drepper.
5167 Sun Jul 16 18:42:34 1995 Jim Meyering (meyering@comco.com)
5169 * configure.in: Add AC_C_INLINE: md5sum.c uses inline keyword.
5171 Tue Jul 11 21:56:02 1995 Jim Meyering (meyering@comco.com)
5173 * md5sum.c Add #else block after #ifdef VMS.
5174 (main): Rename local variable.
5175 Detect and report failed fclose calls on stdout and checkfile_stream.
5177 * tr.c (unqote): Comment out unreachable break stmts.
5178 (append_range): Declare FIRST and LAST parameters to be unsigned int,
5180 (find_closing_delim): Clean up interface, separating boolean success
5181 indicator and index.
5182 (find_bracketed_repeat): Likewise.
5183 (build_spec_list): Adapt to use new interfaces.
5184 Declare CLOSING_DELIM_IDX and CLOSING_BRACKET_IDX to be of
5185 type size_t, not int.
5186 (main): Declare NR and CHARS_READ to be of type long, not int.
5188 * sort.c (main): Comment out unreachable break stmt.
5190 * tail.c (tail): Explicitly cast to long the N_UNITS argumennt in
5191 call to tail_lines. Otherwise, NetBSD lost because N_UNITS (of type
5192 off_t, a 64-bit type on NetBSD) wasn't converted to the target type,
5193 long. Reported by Dan Hagerty (hag@gnu.ai.it.edu).
5195 * comm.c: Reorder functions so main is last, so no forward dcls
5198 Sun Jul 9 11:41:15 1995 Jim Meyering (meyering@comco.com)
5200 * sort.c (main): When using obsolescent +pos -pos syntax, allow
5201 omission of field spec only when character offset is specified.
5202 Otherwise, -. +. would be accepted.
5204 Sat Jul 8 13:48:06 1995 Jim Meyering (meyering@comco.com)
5206 * sort.c (main): Allow field spec, M, to be omitted in +M.N or -M.N
5207 position specification. For compatibility with existing practice
5208 (what vendors?), omitting M is now equivalent to specifying `0' for M,
5209 but only when using the +pos -pos syntax, not with the -k option.
5210 From Rick Sladkey (jrs@world.std.com).
5212 Thu Jul 6 23:44:20 1995 Jim Meyering (meyering@comco.com)
5214 * od.c (dump): Correct loop-termination criterion.
5215 Before, running `printf 1234| ./od --width=4 --read-bytes=4'
5216 printed output for 8 bytes -- the last four were garbage.
5217 This happened only when the dump limit, N, was specified (with
5218 --read-bytes=N) and N was a multiple of bytes_per_block
5219 (usually 16, but 4 in this example). From Andreas Schwab.
5221 Sun Jul 2 22:12:40 1995 Jim Meyering (meyering@comco.com)
5223 * lib/Makefile.in (check): Depend on libtu.a.
5225 * md5sum.c (split_3): Rewrite to parse Plumb/Lankester format as well.
5226 (main): Print each sum line in (de facto) standard Plumb/Lankester
5228 New option: --quiet.
5229 Check option no longer takes an argument.
5230 When checking, exit status reflects success.
5232 Sat Jun 24 16:18:01 1995 Jim Meyering (meyering@comco.com)
5234 * md5sum.c [__GNUC__]: Don't conditionalize use of "inline".
5235 Autoconf (via config.h) defines it away for compilers that don't
5238 * cat.c, comm.c, join.c, sort.c, uniq.c: Undefine min/max before
5239 defining to avoid redefinition warning on some systems.
5241 * csplit.c (read_input): Rename paramater MAX to MAX_N_BYTES.
5242 This avoids potential conflict with max macro from some system's
5243 header files when using bad pre-ANSI compilers.
5245 * uniq.c (usage): Fix typo in text of --help output.
5246 From Steve McConnel <steve@acadcomp.sil.org>
5248 * md5sum.c [uint32]: When testing for 32-bit arithmetic type,
5249 also check `unsigned long', as a concession to systems with
5250 int's smaller than 32 bits.
5252 * configure.in (AC_REPLACE_FUNCS): Remove memcmp (again!) since
5253 AC_FUNC_MEMCMP already handles it. This avoids warnings from
5254 ranlib on nextstep systems. From Kaveh Ghazi.
5256 * csplit.c (interrupt_handler): Declare to have a single integer
5257 parameter. Otherwise, some compilers fail with a type mismatch
5258 error in sa_handler assignment.
5260 * fmt.c [word]: Redefine. Otherwise, systems (Unicos for one) with
5261 headers that typedef `word' get syntax errors because of the
5262 variable by the same name.
5264 * join.c [join]: Redefine to avoid conflict with prototype in some
5265 system header file. Also for Unicos.
5267 * md5sum.c (main): Remove spurious colon in getopt spec string.
5268 From Ken Pizzini <kenp@spry.com>.
5270 Tue Jun 20 06:59:16 1995 Jim Meyering (meyering@comco.com)
5272 * md5sum.c (md5_file): Initialize two elements of LEN portably,
5273 rather than with ANSI aggregate initialization. Reported by
5274 Edzer Pebesma <Edzer.Pebesma@rivm.nl>.
5276 Sun Jun 18 09:15:57 1995 Jim Meyering (meyering@comco.com)
5280 * md5sum.c (process_buffer): Copy values from struct into
5281 individual local variables before performing computation on them,
5282 then copy results back into returned struct. Solely for better
5283 optimization by compilers that can't keep struct members in
5284 registers. From Ulrich Drepper.
5286 Thu Jun 15 22:09:14 1995 Jim Meyering (meyering@comco.com)
5288 * md5sum.c: Remove unnecessary uses of `defined' in #if* tests.
5289 Don't use #elif. Some older compilers don't grok it.
5290 (split_3): New function to parse out sum, flag, and filename
5291 when reading check file.
5292 (hex_digits): Remove length parameter since string parameter is
5294 (main): Don't allocate separate arrays for filename and sum
5295 when checking. Get pointers into line buffer with split_3 instead
5297 (main): Treat `no file args' just like `-' when not checking
5299 (hex_digits): Unprotoize.
5301 * md5sum.c (main): Don't use a separate loop to convert to lower
5302 case. Suggested by Ulrich Drepper.
5305 From Ulrich Drepper.
5307 * md5sum.c: Don't include values.h.
5310 * md5sum.c: [UNIX || unix]: Also test __UNIX__, __unix__,
5311 and _POSIX_VERSION. Reported by Arne H. Juul.
5313 Tue Jun 13 21:20:10 1995 Jim Meyering (meyering@comco.com)
5315 * tr.c [NDEBUG]: Define it to disable assertions. Some systems
5316 have a broken <assert.h> header.
5317 (is_char_class_member): Set a variable in each branch of switch
5318 stmt and return that value after the switch (rather than returning
5319 directly from every branch).
5320 (unquote): More int->size_t changes.
5321 (build_spec_list): More int->size_t changes.
5322 Be very careful about comparison now that variables are unsigned:
5323 Use i + 2 < len rather than i < len - 2. The latter didn't work
5324 for len < 2. Caught early thanks to a thorough regression test
5327 Mon Jun 12 23:07:59 1995 Jim Meyering (meyering@comco.com)
5329 * sort.c (xfclose): Don't try to flush stdin, only stdout.
5330 Otherwise, at least Ultrix-4.3's fflush would return EOF.
5331 Reported by Jim Blandy (jimb@cyclic.com).
5333 * tr.c (non_neg_strtol): Don't compare signed and unsigned.
5334 [struct Spec_list] (indefinite_repeat_element): New member.
5335 Use size_t rather than int or unsigned long where reasonable.
5336 (get_spec_status): Make interface cleaner.
5337 (get_s1_spec_status): New function.
5338 (get_s2_spec_status): New function.
5339 (validate): Use new functions instead of get_spec_status.
5341 Sun Jun 11 00:39:50 1995 Jim Meyering (meyering@comco.com)
5343 * md5sum.c: New file. From Ulrich Drepper.
5344 * md5-test.rfc: New file.
5345 * Makefile.in: (PROGS): Add md5sum.
5346 (check): Run a recursive make in each subdirectory.
5347 * man/Makefile.in: (MANFILES): Add md5sum.1.
5348 * src/Makefile.in: (SOURCES): Add md5sum.c.
5349 (OBJECTS): Add md5sum.o.
5350 (PROGS): Add md5sum.
5351 (check): Add basic checks for md5sum.
5352 (md5sum): Add dependency and link rule.
5353 (DISTFILES): Add md5-test.rfc.
5355 * tr.c (look_up_char_class, append_char_class, append_equiv_class):
5356 Use const attribute when appropriate.
5358 Sun May 28 14:48:58 1995 Jim Meyering (meyering@comco.com)
5360 * join.c: Overhauled to make -a1 and -a2 options work.
5361 Passed all tests in a fairly thorough test suite.
5362 Reported by Michael Hasselberg (mikelh@zonta.ping.de).
5364 Sat May 27 00:35:47 1995 Jim Meyering (meyering@comco.com)
5366 * tail.c (main): Remove dcl of and statements that set now-unused
5369 * system.h [!STDC_HEADERS && HAVE_MEMORY_H]: Include memory.h.
5370 Without this, SunOS doesn't get type for memchr.
5371 Reported by Kaveh Ghazi.
5373 Thu May 25 00:06:50 1995 Jim Meyering (meyering@comco.com)
5375 * tail.c (tail_lines): Change one more `long' to `off_t'.
5376 Otherwise, tail didn't work on NetBSD. From Arne H. Juul.
5378 * csplit.c [struct control]: Change type of `repeat' to unsigned
5379 long to avoid conversion warning.
5381 Sun May 21 07:50:00 1995 Jim Meyering (meyering@comco.com)
5383 * Makefile.in (.PHONY): TAGS is not a phony target. From Franc,ois.
5385 * xstrtol.c (__strtol): Remove prototype altogether.
5386 Move inclusion of xstrtol.h back so that it follows system headers.
5390 Sat May 20 06:44:14 1995 Jim Meyering (meyering@comco.com)
5392 * join.c (ADD_FIELD): Declare in K&R style, not ANSI.
5395 * xstrtol.c: Define NDEBUG for systems with losing assert.h.
5396 (__strtol): Add __unsigned to prototype and use __P.
5397 Move inclusion of xstrtol.h to precede prototype.
5400 * memmove.c: Include config.h for definition of const.
5403 * All Makefile.in (install-exec, install-exec): New targets.
5406 * tr.c (look_up_char_class): Take a string length argument -- required
5407 because the argument is a string that is *not* NUL-terminated.
5408 Use strncmp, not strcmp and add string lengths comparison.
5409 (append_char_class): Update caller. Before this change,
5410 tr '[:upper:]' '[:lower:]' read one uninitialized byte.
5411 From Andreas Schwab.
5413 * split.c (next_file_name): Move dcls of file-scope variables into
5414 this function. Don't rely on arithmetic being two's complement.
5416 * paste.c [CLOSED, ENDLIST]: Don't cast constants to FILE pointers.
5417 Instead, declare two FILE structs and use their addresses.
5419 * csplit.c (record_line_starts): Remove set-but-not-used,
5420 file-scope variable.
5422 Sat May 13 08:57:20 1995 Jim Meyering (meyering@comco.com)
5424 * all source files (usage): Include one- or two-line synopsis
5425 in --help output. From Karl Berry.
5427 * lib/Makefile.in [.c.o]: Remove -I. since safe-l?stat.h are no
5430 Wed May 10 22:26:35 1995 Jim Meyering (meyering@comco.com)
5434 Sun May 7 13:35:49 1995 Jim Meyering (meyering@comco.com)
5436 * all Makefile.in (maintainer-clean): Renamed from realclean
5439 Thu May 4 23:15:58 1995 Jim Meyering (meyering@comco.com)
5441 * sort.c (main): Use stat, not safe_stat. The latter was unnecessary.
5442 Don't include safe-stat.h.
5444 * lib/Makefile.in (DISTFILES): Remove safe-xstat.hin.
5445 Remove all associated rules. safe-l?stat.h are no longer used.
5447 * sort.c Don't hard-code /tmp.
5448 [DEFAULT_TMPDIR]: Use this instead.
5449 * tac.c (save_stdin): Likewise.
5451 * sort.c (set_ordering): Properly parse arguments like `+x.yn'.
5452 Reported by John Salmon (johns@mullet.anu.edu.au).
5453 Patch from Mike Haertel.
5455 Wed Apr 26 23:48:13 1995 Jim Meyering (meyering@comco.com)
5457 * sort.c (tempname): AND-off high bits of pid so that its decimal
5458 string representation is no longer than five digits.
5459 From Hans Verkuil (hans@wyst.hobby.nl).
5461 Thu Apr 20 23:09:33 1995 Jim Meyering (meyering@comco.com)
5463 * expand.c (add_tabstop): Give correct size when reallocating
5464 tab_list buffer. From Geoff Odhner (geoff@franklin.com).
5465 Reproduce with expand --t=`perl -e "print join (',', (1..300));"`.
5467 Tue Apr 18 22:57:43 1995 Jim Meyering (meyering@comco.com)
5469 * configure.in: (AC_OUTPUT): Use echo, not date, to avoid creating
5470 unnecessary conflicts for people using version control software
5472 (AC_ARG_PROGRAM): Use it.
5474 Thu Apr 13 23:22:57 1995 Jim Meyering (meyering@comco.com)
5476 * head.c: Remove block of redundant comments describing options.
5477 (usage): Remove reference to -l option. It's not valid.
5479 * od.c (write_block): Declare index I as unsigned int, not int.
5480 (get_lcm): Likewise.
5481 (dump_strings): Likewise.
5483 (dump): Cast BYTES_PER_BLOCK to off_t in MIN expression.
5484 (dump_strings): Declare bufsize to be of type size_t, not int.
5486 * split.c (next_file_name): Don't reuse X as an index.
5487 Declare new variable I instead.
5489 Sat Mar 25 15:07:23 1995 Jim Meyering (meyering@comco.com)
5491 * csplit.c: Declare as `unsigned int' all variables that were
5493 (make_filename): Change type of arg to unsigned int.
5494 (split_file): Change type of indices to unsigned int.
5496 Thu Mar 16 22:05:05 1995 Jim Meyering (meyering@comco.com)
5498 * od.c (main): Detect and fail when argument to -N is too large
5501 Sun Mar 12 12:02:39 1995 Jim Meyering (meyering@comco.com)
5503 * configure.in (AC_REPLACE_FUNCS): Add memcmp.c.
5504 Remove check for sizeof long.
5506 * linebuffer.h: Undefine __P before defining it.
5507 * long-options.h: Likewise.
5508 * xstrtol.h: Likewise.
5510 * memcpy.c: New file.
5511 * lib/Makefile.in (SOURCES): Add memcpy.c.
5513 Fri Mar 10 21:14:11 1995 Jim Meyering (meyering@comco.com)
5515 * src/*.c: Update Copyright dates.
5517 Sat Feb 11 07:31:08 1995 Jim Meyering (meyering@comco.com)
5519 * system.h: Remove index/rindex and bcmp/bcopy/bzero references.
5520 Separate errno declaration from STDC_HEADERS.
5522 * wc.c (wc): For efficiency, handle separately the cases in which
5523 words need not be counted. Suggested by Karl Heuer.
5525 * wc.c (wc): Don't overcount the number of bytes when reading
5526 from a regular file on stdin with file pointer not at BOF.
5527 From Karl Heuer <karl@gnu.ai.mit.edu>. Before, the command
5528 `(dd ibs=99k skip=1; wc -c) < /etc/group' made wc wrongly output
5529 the size of the file. Now it outputs `0'.
5531 Sat Jan 28 07:07:23 1995 Jim Meyering (meyering@comco.com)
5533 * cat.c (cat): Use memmove rather than bcopy.
5534 * csplit.c (load_buffer): Use memcpy rather than bcopy.
5535 (extract_regexp): Use strrchr, not rindex.
5536 * fmt.c (isopen, isclose, isperiod): Use strchr, not index.
5537 (flush_paragraph): Use memmove instead of bcopy.
5538 * fold.c (fold_file): Use memmove instead of bcopy.
5539 * od.c (decode_format_string): Use memmove instead of bcopy.
5540 [EQUAL_BLOCKS]: Use memcmp, not bcmp.
5541 (parse_old_offset): Use strchr, not index.
5542 (dump): Use memset, not bzero.
5543 * sort.c (checkfp, mergefps): Use memcpy instead of bcopy.
5544 (fillbuf): Use memmove instead of bcopy.
5545 * split.c (main): Use memset, not bzero.
5546 (line_bytes_split): Use memmove instead of bcopy.
5547 * tac.c (tac): Use memmove instead of bcopy.
5548 (output): Use memcpy instead of bcopy.
5549 * tail.c (pipe_lines, pipe_bytes): Use memcpy instead of bcopy.
5550 * tr.c (substr): Use memcpy instead of bcopy.
5551 (card_of_complement, set_initialize): Use memset, not bzero.
5553 * tr.c (substr): Don't allocate a byte for trailing NUL in result
5554 since the result needn't be NUL-terminated. Don't NUL terminate it.
5556 * configure.in (AC_REPLACE_FUNCS): Check for memmove and memcpy,
5558 (AC_CHECK_FUNCS): Add strchr and strrchr.
5560 * lib/Makefile.in (SOURCES): Add memmove.c and memcpy.c.
5561 * memmove.c: New file.
5562 * memcpy.c: New file.
5564 Tue Jan 24 22:18:19 1995 Jim Meyering (meyering@comco.com)
5566 * fmt.c (copy_rest): Replace `||' with `&&'. Before, a paragraph
5567 not followed by a newline would be followed by data copied from
5568 uninitialized storage. Repeat by `printf abc|fmt|od -ac'.
5569 Reported by Franc,ois Pinard.
5571 * od.c: Rename macros with FP_ prefix. Use FLOAT_ instead.
5572 AIX-2.2.1 declares a typedef, FP_DOUBLE, that conflicted.
5573 Be careful to use off_t instead of explicit `unsigned long'.
5574 Otherwise, systems like 4.4BSD lose on calls to fseek that
5575 expect off_t (which is long long on that system).
5576 (parse_old_offset): Use xstrtoul
5579 * src/Makefile.in (od.o, tail.o): Depend on ../lib/strtol.h.
5581 Mon Dec 19 22:13:55 1994 Jim Meyering (meyering@comco.com)
5583 * tail.c (numerous functions): Give char* filename arguments the
5586 * lib/Makefile.in (SOURCES): Remove xwrite.c. It was no longer used.
5587 Add xstrtol.c and xstrtoul.c.
5588 (OBJECTS): Likewise for .o files.
5589 (DISTFILES): Add error.h and xstrtol.h and xstrtoul.h.
5591 * lib/Makefile.in (DISTFILES): Remove safe-xstat.cin.
5592 (distclean): Remove references to safe-l?stat.c.
5593 Remove all related rules and dependencies.
5595 * src/Makefile.in: $(OBJECTS): Depend on ../lib/error.h.
5597 Thu Dec 15 23:14:04 1994 Jim Meyering (meyering@comco.com)
5599 * tail.c (tail_file): Fix call to error with %s in format, but
5600 no corresponding argument.
5602 * src/*.c: Include "error.h" instead of simply declaring
5604 * od.c (main): Use %lu, not %d for unsigned long.
5605 (my_strtoul, uint_fatal_error): Remove functions. Use xstrtoul
5606 and STRTOL_FATAL_ERROR instead.
5608 Sun Dec 11 17:24:09 1994 Jim Meyering (meyering@comco.com)
5610 * sort.c (main): Fix interpretation of field offsets when specified
5611 via -k option. They were being interpreted as zero-indexed. POSIX
5612 says they are 1-based indices. From Rik Faith <faith@cs.unc.edu>.
5613 (keycompare): Don't ignore characters at the end of words when
5614 otherwise they would compare equal. From Rik Faith.
5616 * tail.c (<most functions>): Change the type of n_units/n_lines/n_bytes
5617 to off_t because n_bytes is used as the option to fseek and off_t may
5618 be long long (e.g. on BSD4.4). The only place where a 32-bit limit is
5619 imposed is in the string-to-integer converstion of xstrtol.
5620 (main): Use xstrtol instead of manual string to integer conversion.
5622 * csplit.c (get_format_width, get_format_prec): Use ISDIGIT instead of
5623 comparisons against '0' and '9'.
5625 * tr.c [!ULONGMAX]: Define it.
5626 [!LONGMAX]: Define in terms of ULONGMAX instead of as a 32-bit constant.
5628 * full-write.c: Declare (or not) errno based on definedness or
5629 errno, not STDC_HEADERS.
5630 * safe-read.c: Likewise.
5631 * xwrite.c: Likewise.
5633 Thu Nov 17 06:37:33 1994 Jim Meyering (meyering@comco.com)
5635 * tail.c (dump_remainder): Flush standard output just before
5636 sleeping so that `tail -f' will output partial lines sooner.
5637 This applies only when following the end of a single file.
5638 From Leonard N. Zubkoff <lnz@dandelion.com>.
5640 * tail.c (file_lines, pipe_lines, pipe_bytes, start_bytes,
5641 start_lines, dump_remainder): Use STDOUT_FILENO instead of `1' in
5643 * tac.c (output): Use STDOUT_FILENO instead of `1' in xwrite call.
5644 * system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Define if
5645 not already defined.
5647 Wed Nov 16 07:01:38 1994 Jim Meyering (meyering@comco.com)
5649 * tr.c: Include <getopt.h> instead of "getopt.h".
5651 * sort.c (tempname): Merge two very similar sprintf stmts into one.
5653 * tail.c: Use BUFSIZ instead of BUFSIZE.
5655 * cut.c: Declare DELIM to be `int' rather than unsigned char.
5657 * fmt.c: Use index, not strchr -- per GNU Standards.
5658 Reported by Kaveh Ghazi.
5659 Always include <config.h>.
5660 (main): Include program name in --version output.
5662 Sun Nov 06 00:17:21 1994 Jim Meyering (meyering@comco.com)
5666 Sat Nov 05 15:14:44 1994 Jim Meyering (meyering@comco.com)
5668 * memcmp.c, srtoul.c: Use up-to-date versions.
5669 Reported by Franc,ois Pinard.
5671 * src/Makefile.in (DEFS): Remove -Dlint... again.
5673 * src/Makefile.in (PROGS): Add fmt!
5674 Reported by Andreas Stolcke (stolcke@ICSI.Berkeley.EDU).
5676 Fri Nov 04 17:26:16 1994 Jim Meyering (meyering@comco.com)
5680 Thu Nov 03 23:23:08 1994 Jim Meyering (meyering@comco.com)
5682 * linebuffer.h: Use __P instead of _P since the latter conflicts
5683 with a definition in some <ctype.h>. From Kaveh Ghazi.
5685 Wed Nov 02 17:36:34 1994 Jim Meyering (meyering@comco.com)
5687 * tr.c: Add const attribute where appropriate.
5689 * tail.c (BUFSIZ): Use definition from <stdio.h>.
5691 Tue Nov 01 23:54:09 1994 Jim Meyering (meyering@comco.com)
5693 * tail.c (XWRITE): Allow n_bytes == 0 but call fwrite only if
5694 n_bytes is positive. Turn off assertions. `tail /dev/null' was
5695 getting a failed assertion. Reported by Doug McLaren
5698 * cut.c (cut_bytes): Print at least a newline for every line of input.
5699 (cut_fields): Print a newline even for lines whose only selected
5700 field is empty. But print nothing when using -s without -f1.
5701 And print nothing for empty input. Reported by
5702 Richard_Sharman@software.mitel.com.
5704 Tue Nov 01 06:05:23 1994 Jim Meyering (meyering@comco.com)
5706 * fmt.c: Change #ifdef __STDC__ to #if defined (__STDC__) && __STDC__.
5707 * linebuffer.h: Likewise.
5709 Mon Oct 31 06:53:32 1994 Jim Meyering (meyering@comco.com)
5711 * configure.in (AC_REPLACE_FUNCS): Remove memcmp since AC_FUNC_MEMCMP
5712 already handles it. From Kaveh Ghazi.
5714 * {lib,src}/Makefile.in (DEFS): Don't use -Dlint. Some systems
5715 get failures when it's defined. From Kaveh Ghazi.
5717 * cat.c (cat): Conditionalize test for errno == ENOSYS. It's not
5718 defined on some Next and Alliant systems. From Kaveh Ghazi.
5720 * sort.c join.c (main): Include version.h and call parse_long_options
5721 with the proper number of arguments. Reported by Franc,ois Pinard.
5723 Sun Oct 30 01:30:41 1994 Jim Meyering (meyering@comco.com)
5725 * (configure.in): Add AC_OFF_T and rearrange by type along the
5726 same lines as autoscan.
5728 * fmt.c, fmt.1: New files.
5729 Both from Ross Paterson (rap@doc.ic.ac.uk).
5731 * Makefile.in (PROGS): Add fmt.
5732 * src/Makefile.in (SOURCES, OBJECTS): Add fmt.c and fmt.o respectively.
5733 (fmt): Add a link rule.
5734 * man/Makefile.in (MANFILES): Add fmt.1.
5736 Sat Oct 08 10:44:30 1994 Jim Meyering (meyering@comco.com)
5738 * Makefile.in (All of them): Update from the ones in sh-utils.
5739 From now on, rules and definitions that are comon to the fileutils,
5740 textutils, and sh-utils will get ChangeLog entries only in the
5743 Tue Oct 04 20:42:46 1994 Jim Meyering (meyering@comco.com)
5745 * od.c (my_strtoul): Set errno to zero before calling strtoul.
5746 Otherwise, od can fail complaining about a valid integer argument.
5747 From Andreas Schwab.
5749 Sun Oct 02 17:57:09 1994 Jim Meyering (meyering@comco.com)
5751 * tr.c (main): Give an error and fail when squeezing repeats
5752 and no non-options are given. Reported by Tony Robinson
5753 (ajr@eng.cam.ac.uk).
5755 * sort.c (main): Temporarily copy each input file that might be
5756 another name for the output file. When in doubt (e.g. a pipe),
5757 copy. This allows the dangerous (historical -- in cnews) idiom
5758 `cat file | sort -o file' to work properly. Don't rely on this
5759 behavior in new shell scripts. From Paul Eggert (eggert@twinsun.com).
5761 Mon Sep 26 18:01:47 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
5763 * lib/xwrite.c safe-read.c memchr.c linebuffer.c full-write.c:
5764 Remove CONFIG_BROKETS ifdef.
5765 * src/Makefile.in lib/Makefile.in: Don't define it.
5767 Sat Sep 24 21:26:27 1994 Jim Meyering (meyering@comco.com)
5769 * full-write.c (full_write): Declare argument LEN to be size_t.
5771 Mon Sep 12 13:35:27 1994 Jim Meyering (meyering@comco.com)
5773 * tail.c (tail_file): [For multiple files only]: Report truncation
5774 of monitored file and reset current file size. From Franc,ois Pinard.
5776 Sat Aug 27 16:57:20 1994 Jim Meyering (meyering@comco.com)
5778 * system.h [BROKEN_STAT_MACROS]: Remove unnecessary #ifdef's.
5779 From Franc,ois Pinard.
5781 Tue Jul 26 11:33:53 1994 Jim Meyering (meyering@comco.com)
5783 * system.h: Remove `|| defined(_POSIX_VERSION)' from test that
5784 decides whether to include <fcntl.h>. From Francois Pinard.
5786 Wed Jul 13 12:33:34 1994 Jim Meyering (meyering@comco.com)
5788 * tr.c (substr): Fix off-by-one allocation error.
5790 Wed Jun 22 01:02:50 1994 Jim Meyering (meyering@comco.com)
5792 * tac.c (tac_file): Use O_RDONLY instead of zero in call to open.
5793 (tac): Fix typo that had `1' as arg #2 of error after failed read.
5794 Use errno instead. From Michael I Bushnell <mib@gnu.ai.mit.edu>.
5796 Thu May 26 08:46:32 1994 Jim Meyering (meyering@comco.com)
5798 * configure.in [INSTALL]: Revert change of March 25. autoconf
5801 Mon Apr 11 17:25:43 1994 Jim Meyering (meyering@comco.com)
5803 * join.c (prline): Remove unused function. Indent.
5805 Fri May 6 05:44:24 1994 Jim Meyering (meyering@comco.com)
5807 * tail.c (tail_forever): Don't print headers when asked not to.
5808 From Karsten Thygesen <karthy@kom.auc.dk>.
5810 * wc.c (wc): Optimize for the case when only bytes are being counted
5811 and the input is not a regular file. From Jeff Moore <jbm@mordor.com>.
5813 Sun Apr 24 10:54:08 1994 Jim Meyering (meyering@comco.com)
5815 * configure.in [AC_SIZEOF_TYPE]: Update for autoconf-1.9.
5816 * memchr.c: Test SIZEOF_LONG instead of LONG_64_BITS.
5818 Mon Apr 11 17:55:52 1994 Jim Meyering (meyering@comco.com)
5820 * csplit.c (struct control): Add new field, repeat_forever.
5821 Remove now-unneeded definition of INT_MAX.
5822 (process_regexp): Test repeat_forever instead of comparing `repeat'
5824 (split_file): Don't even reference `repeat' count if repeat_forever
5826 (new_control_record): Initialize repeat_forever field.
5827 (parse_repeat_count): Set it instead of setting repeat count to
5829 (process_line_count): Abort for internal error instead of calling
5832 * long-options.c (parse_long_options): Take a new argument indicating
5833 the utility name (e.g. "join", not "gjoin") for version output.
5834 Print both the utility and the package names, e.g. `join - GNU
5835 textutils-1.9.1' instead of just the package name.
5837 * join.c (main): Call parse_long_options with program name arg.
5838 * sort.c (main): Ditto.
5840 * All source except sort.c and join.c (main): Change --version output
5841 to include utility name as well as package name and version info.
5843 Wed Mar 30 08:53:21 1994 Jim Meyering (meyering@comco.com)
5845 * configure.in: Use AC_SET_MAKE.
5846 * Makefile.in: Edit MAKE assignments into @SET_MAKE@.
5848 Mon Mar 28 09:55:05 1994 Jim Meyering (meyering@comco.com)
5850 * tr.c (main): In addition to the --help usage pointer, give an
5851 explicit error message for too many arguments.
5853 Fri Mar 25 18:11:19 1994 Jim Meyering (meyering@comco.com)
5855 * configure.in: Use AC_VERBOSE, AC_CHECKING, and AC_WARN instead
5856 of explicit echo commands.
5857 [INSTALL]: When AC_PROG_INSTALL resorts to setting this to
5858 `./install.sh', make it `../install.sh' instead since that
5859 script will be invoked only from subdirectories.
5860 [AC_SIZEOF_TYPE]: Use this instead of deprecated AC_LONG_64_BITS.
5862 * cat.c (cat): The command `:|cat -s' failed on Irix5 because
5863 ioctl (d, FIONREAD,... now returns ENOSYS for pipes -- under Irix4
5864 it returned EINVAL. Detect this.
5865 (main) [lint]: Initialize variables to suppress `used before
5866 initialized' warnings.
5868 * csplit.c: Change long option name from --suffix to --suffix-format.
5870 * od.c (skip): Correct a comment.
5871 (main): Don't output anything to stdout if the sole input file
5872 doesn't exist. Reported by Bauke Jan Douma <bjd@dds.hacktic.nl>.
5874 * od.c (dump) [lint]: Initialize a variable to suppress `used before
5875 initialized' warning.
5876 (main) [lint]: Ditto.
5877 * paste.c (paste_parallel) [lint]: Ditto.
5879 Fri Jan 28 11:02:21 1994 Jim Meyering (meyering@comco.com)
5881 * configure.in: Don't set LDFLAGS since linking now uses both
5884 Wed Jan 18 16:14:00 1994 Jim Meyering (meyering@comco.com)
5886 * unexpand.c (unexpand): Don't segfault when given a name of a
5888 * expand.c (expand): Ditto.
5889 Both from Bauke Jan Douma <bjd@dds.hacktic.nl>.
5891 Thu Jan 13 17:27:38 1994 Jim Meyering (meyering@comco.com)
5893 * src/Makefile.in: Change all link commands to use both $(CFLAGS)
5896 * csplit.c (load_buffer): Rather than incrementing buffer size,
5897 double it each time we fail to find a newline. Otherwise, csplit
5898 would run out of memory when processing files with very long lines.
5900 Mon Jan 10 01:20:38 1994 Jim Meyering (meyering@comco.com)
5902 * man/Makefile.in (manprefix): Use binprefix as the default.
5904 Sat Jan 08 22:22:45 1994 Jim Meyering (meyering@comco.com)
5906 * cat.c: Use full_write and safe_read instead of write and read resp.
5912 * sum.c: Use safe_read instead of read.
5916 * tail.c: Replace calls to xwrite with calls to fwrite.
5917 Use fopen/fclose instead of open/close.
5918 (write_header): Use a single call to printf instead of four to xwrite.
5919 Use safe_read instead of read.
5922 Tue Dec 28 15:49:32 1993 Jim Meyering (meyering@comco.com)
5924 * install.sh: New file.
5925 Makefile.in [DISTFILES]: Add it.
5927 Wed Dec 22 18:52:44 1993 Jim Meyering (meyering@comco.com)
5929 * memcmp.c: Use the latest version from the GNU C library.
5931 * cut.c [ADD_RANGE_PAIR]: New macro.
5932 (set_fields): Collect the list of all selected ranges before
5933 allocating and initializing the boolean lookup table.
5934 (cut_bytes, cut_fields): Complete rewrite. Avoid copying
5935 into buffer whenever possible. Properly handle input without
5937 (getstr): New function. Copied from getline.c, but with minor changes.
5939 * sort.c (main): Properly handle -Tdir.
5940 Before, `sort -T/var/tmp' gave `sort: unrecognized option `-v''.
5941 Reported by Kristoffer Rose (kris@diku.dk).
5943 * cut.c (main): Give separate errors for `-s without -f'
5944 and `-d without -f'.
5945 (main): Now -d '' means `use the NUL byte as the delimiter'.
5946 Before, it got an error.
5948 Mon Dec 20 23:29:30 1993 Jim Meyering (meyering@comco.com)
5950 * configure.in [test for 8-bit clean memcmp]: Add a test to detect
5951 losing memcmp from SunOS4.1.x. From Robert H. de Vries
5954 Sat Dec 18 01:12:24 1993 Jim Meyering (meyering@comco.com)
5956 * configure.in (AC_OUTPUT): Put `touch stamp-config' in second arg
5957 so it goes in config.status. This eliminates unnecessary second run
5960 Thu Dec 02 23:53:03 1993 Jim Meyering (meyering@comco.com)
5962 * configure.in (AC_HAVE_FUNCS): Add isascii.
5963 * system.h [!defined (isascii) || defined (STDC_HEADERS)]: This failed
5964 on AIX PS/2 1.3 systems because isascii is a function and it is used
5965 in definitions (with the necessary side effect of assigning to a
5966 global variable) of the is* macros. Also test HAVE_ISASCII and
5967 redefine ISASCII(c) instead of isascii.
5968 Reported by Minh Tran-Le (tranle@intellicorp.com).
5970 Fri Nov 19 22:41:48 1993 Jim Meyering (meyering@comco.com)
5972 * configure.in: Don't run the test for 8-bit clean memcmp if we
5973 already know we'll be using our replacement.
5975 Fri Nov 12 00:44:49 1993 Jim Meyering (meyering@comco.com)
5979 * tac.c (usage): Fix typo in long usage.
5980 * sort.c (usage): Likewise.
5981 From Philippe.Schnoebelen@imag.fr.
5983 * cut.c [FATAL_ERROR]: New macro.
5984 (main): Call both error and usage (2) through FATAL_ERROR in
5985 many places. Before, only `error (2...' was called.
5986 (invalid_list): Removed. This function is subsumed by FATAL_ERROR.
5988 * cut.c (cut_fields): Properly handle input lacking a terminating
5989 newline. Before, the command `printf "a\tb" |cut -f 1' generated
5992 Tue Nov 09 17:26:25 1993 Jim Meyering (meyering@comco.com)
5994 od.c (usage): Change --backward-compatible to --traditional in
5995 the long usage message.
5997 Sun Nov 07 00:50:05 1993 Jim Meyering (meyering@comco.com)
6001 Sat Nov 06 22:51:31 1993 Jim Meyering (meyering@comco.com)
6003 * cut.c (cut_fields): Revert July 27 change. Instead, strip off
6004 trailing delimiter unless given a range of fields like `3-' that
6005 extends to end of line.
6006 (set_fields): Moved local `eol_range_start' to file-scope.
6007 Reported by Arne H. Juul (arnej@solan.unit.no).
6009 Tue Nov 02 00:53:41 1993 Jim Meyering (meyering@comco.com)
6011 * fold.c (fold_file): Don't get stuck in an endless loop when
6012 width is smaller than 8 and there are TABs in the input.
6014 Sat Oct 30 15:31:28 1993 Jim Meyering (meyering@comco.com)
6016 * join.c: Remove now-unused dcls of show_help and show_version.
6018 Fri Oct 29 13:58:50 1993 Jim Meyering (meyering@comco.com)
6020 * csplit.c [INT_MAX]: Make sure it's defined.
6021 [not HAVE_LIMITS_H]: Don't include limits.h.
6022 From Kaveh R. Ghazi (ghazi@noc.rutgers.edu).
6024 Wed Oct 27 01:13:52 1993 Jim Meyering (meyering@comco.com)
6028 Mon Oct 25 20:16:33 1993 Jim Meyering (meyering@comco.com)
6030 * sort.c: Accept but ignore -y0 for compatibility with Solaris 2.
6031 From Chuck Hedrick (hedrick@klinzhai.rutgers.edu).
6033 * sort.c (main): Handle --help and --version options.
6034 * Makefile.in (sort.o): Depend on long-options.h.
6036 Sun Oct 24 00:31:02 1993 Jim Meyering (meyering@comco.com)
6038 * csplit.c, cut.c, expand.c, fold.c, head.c, nl.c, od.c, paste.c,
6039 split.c, tac.c, tail.c, unexpand.c, uniq.c: Use the preferred
6040 `--longopt=arg' syntax in --help message rather than `--longopt arg'.
6041 From Francois Pinard.
6043 * tail.c: Don't include <signal.h>. It hasn't been necessary
6044 since the Dec 12, 1992 change.
6046 * join.c (main): Accept `-v 1' again. Adding the --version
6047 long option had broken it, although -v1 still worked. Call
6048 parse_long_options instead of adding "help" and "version"
6049 to join's longopt strct.
6050 * Makefile.in [SOURCES, OBJECTS, DISTFILES]: Add long-options.c
6052 * (join): Depend on and link with long-options.o.
6053 * (join.o): Depend on long-options.h.
6055 * od.c: Change --compatible (-C) to --backward-compatible (-B).
6057 * csplit.c: Change --abandon-null-files to --elide-empty-files.
6059 Sat Oct 23 01:00:12 1993 Jim Meyering (meyering@comco.com)
6061 * tr.c (get_next, string2_extend): Add default: label to switch stmt.
6063 * cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fold.c, head.c,
6064 join.c, nl.c, od.c, paste.c, pr.c, split.c, sum.c, tac.c, tail.c,
6065 tr.c, unexpand.c, uniq.c, wc.c (usage): Add long --help.
6066 Exit successfully for --help, non-zero for usage error.
6067 From Francois Pinard.
6069 * configure.in: Add AC_STAT_MACROS_BROKEN.
6070 * system.h [AC_STAT_MACROS_BROKEN]: Test it.
6072 Fri Oct 22 23:26:17 1993 Jim Meyering (meyering@comco.com)
6074 * linebuffer.c, memchr.c [HAVE_CONFIG_H, CONFIG_BROKETS]: Include
6075 <config.h> or "config.h".
6076 * cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fold.c, head.c,
6077 join.c, nl.c, od.c, paste.c, pr.c, sort.c, split.c, sum.c, tac.c,
6078 tail.c, tr.c, unexpand.c, uniq.c, version.c, wc.c: Ditto.
6080 * configure.in: Use AC_CONFIG_HEADER.
6081 * Makefile.in [DIST]: Add config.h.in.
6083 * Makefile.in: Convert so make may be run from subdirectories.
6084 Add dependencies on config.h.
6085 * src/Makefile.in: Ditto.
6086 * lib/Makefile.in: Ditto.
6087 * man/Makefile.in: Ditto.
6089 Wed Oct 20 20:05:48 1993 Jim Meyering (meyering@comco.com)
6091 * memchr.c (memchr): Do the 32-bit assignment only if !LONG_64_BITS.
6092 In the 64-bit assignment, be careful to cast the shift operand to
6094 Abort if sizeof (unsigned long) > 8.
6096 Tue Oct 19 22:37:58 1993 Jim Meyering (meyering@comco.com)
6098 * csplit.c: Allow repeat counts to be specified via `{*}'.
6099 New option --suffix=format. Supercedes --digits option.
6100 New option --abandon-null-files.
6101 From Ronald F. Guilmette (rfg@netcom.com).
6103 * csplit.1: Updated.
6104 From Ronald F. Guilmette.
6106 * csplit.c: Remove register keyword (replace with `int' in two cases).
6108 * csplit.c: [MAX]: Macro renamed from max and moved to top of file.
6109 (bytes_to_octal_digits): New static array.
6110 (get_format_flags): Combine '+' and ' ' cases of switch stmt.
6111 Return count if for loop terminates.
6112 (get_format_width): Use `bytes_to_octal_digits' instead of just 11.
6113 (get_format_prec): Make sure is_negative is defined before used.
6114 (get_format_conv_type): Give a different error message if there
6115 is no conversion specifier.
6116 Test ISPRINT (ch) instead of `ch < '~' && ch > ' ''.
6117 (max_out): Use `%%' rather than `%' in format string.
6119 Sat Oct 16 10:45:17 1993 Jim Meyering (meyering@comco.com)
6121 * pr.c (main): When argc == 1, don't try to xmalloc (0).
6123 Tue Oct 12 00:53:26 1993 Jim Meyering (meyering@comco.com)
6125 * xwrite.c [HAVE_CONFIG_H, CONFIG_BROKETS]: Include <config.h>
6128 Sat Oct 09 23:37:43 1993 Jim Meyering (meyering@comco.com)
6130 * configure.in: Remove AC_UNISTD_H; add unistd.h to AC_HAVE_HEADERS.
6132 Thu Sep 9 21:52:10 1993 Jim Meyering (meyering@comco.com)
6134 * src/*.c: Print version on standard output, not stderr.
6136 * configure.in: Add AC_LONG_64_BITS.
6137 * memchr.c: Use #ifdef LONG_64_BITS instead of
6138 `if (sizeof(longword) > 4)'.
6140 Tue Jul 27 22:19:39 1993 Jim Meyering (meyering@comco.com)
6142 * cat.c (cat): Don't fail just because ioctl (d, FIONREAD,... can't
6143 always handle devices. Ignore errno == EINVAL and errno == ENODEV.
6144 `cat -v /dev/null' was failing on many systems.
6146 * cut.c (cut_fields): Don't strip off trailing delimiter e.g.
6147 `echo 'a:b:c:' | cut -d: -f3-' should print `c:', not just `c'.
6148 From William Dowling <will@franklin.com>.
6150 Thu May 27 01:37:51 1993 Jim Meyering (meyering@comco.com)
6154 * memchr.c: De-ansify the fixed version from glibc.
6155 It is supposed to work on systems with 64-bit long ints.
6157 Mon May 24 00:32:43 1993 Jim Meyering (meyering@comco.com)
6161 Sat May 22 02:13:12 1993 Jim Meyering (meyering@comco.com)
6165 Fri May 21 22:57:53 1993 Jim Meyering (meyering@comco.com)
6167 * pr.c (cols_ready_to_print): New function. It replaces a global
6168 variable by the same name and computes on the fly the value that
6169 was supposed to be maintained through that variable. This should
6170 put to rest the `pr -2a' bug.
6171 (main): Don't let getopt_long reorder arguments so we can
6172 distinguish between `pr -1 -2' and `pr -12'. Rework handling of
6175 * fold.c: Declare xmalloc.
6177 Wed May 19 19:12:18 1993 Karl Berry (karl@owl.hq.ileaf.com)
6179 * sort.c (main): fflush before exit, so a closed stdout doesn't lose.
6181 Tue May 18 23:49:26 1993 Jim Meyering (meyering@comco.com)
6183 * mkinstalldirs: New file.
6184 * Makefile.in (installdirs): Use it to create installation directories.
6186 Fri May 14 23:45:52 1993 Jim Meyering (meyering@comco.com)
6188 * all source: With --version, print version and exit immediately.
6190 Thu May 13 01:03:16 1993 Jim Meyering (meyering@comco.com)
6192 * Makefile.in (installdirs): New rules for creating installation
6193 directories. (install): depend on it.
6195 * tail.c (main): Remove --compatible since `+1f' may be used
6196 to get the BSD `-0f' behavior portably.
6198 * fold.c (main): Turn -N arguments, where N is a digit, into -wN.
6199 From Ian Lance Taylor (ian@cygnus.com).
6201 Mon May 10 22:33:44 1993 Jim Meyering (meyering@comco.com)
6203 * tail.c (main): New option -C, --compatible to make `tail -0f'
6204 work like `tail +1f' for compatibility with BSD tail.
6206 Thu May 6 23:28:56 1993 Jim Meyering (meyering@comco.com)
6208 * pr.c (print_page): Decrement cols_ready_to_print even when
6209 lines_to_print == 0. The command `echo |pr -2ta' *still* didn't
6210 terminate. Add parentheses for clarity.
6212 Mon May 3 23:57:47 1993 Jim Meyering (meyering@comco.com)
6216 * od.c (main): Remove set-but-not-used variable, `usage_error'.
6218 * split.c (main): Call usage with an argument.
6220 Sun May 2 16:05:04 1993 Jim Meyering (meyering@comco.com)
6222 * configure.in: Reverse if-else branches in AC_TEST_PROGRAM test
6223 for 8-bit clean memcmp.
6225 * cat.c (usage, main): Remove unused argument.
6227 * csplit.c (remove_line): Remove set-but-not-used variable, `line_got.'
6228 (check_for_offset): Remove unused argument `argnum.'
6230 * configure.in: Add AC_SIZE_T.
6232 Sat May 1 09:03:19 1993 Jim Meyering (meyering@comco.com)
6234 * uniq.c (main): Interpret non-option arguments with a leading `+'
6235 only if we haven't seen `--'.
6237 * tr.c (main): Change variable name to avoid shadowed dcl.
6238 * wc.c (write_counts): Ditto.
6240 * sum.1: Make documentation agree with the code.
6242 * od.c: Depend only on HAVE_LONG_DOUBLE for long double support.
6244 Fri Apr 30 20:16:03 1993 Jim Meyering (meyering@comco.com)
6246 * configure.in [AC_HAVE_HEADERS]: Add limits.h.
6248 * configure.in [CFLAGS, LDFLAGS]: Assign reasonable defaults.
6250 * od.c (parse_old_offset): Don't use prototype in function
6251 definition. Remove unnecessary conjunct from test for hexadecimal
6254 * od.c: Depend on __GNUC__ || HAVE_LONG_DOUBLE rather than __STDC__
6255 for long double support; there are compilers (Stardent Vistra svr4)
6256 without long double but still define __STDC__.
6258 Thu Apr 29 02:01:27 1993 Jim Meyering (meyering@comco.com)
6260 * src/*.c and man/*.c except for sort: Add --help and --version
6263 * pr.c: Convert to use getopt_long.
6265 * lib/memcmp.c: Use version from glibc.
6266 [WORDS_BIGENDIAN]: Test this instead of the using glibc's
6268 * configure.in: Use AC_WORDS_BIGENDIAN to set it.
6270 * od.c (parse_old_offset): Allow `0X' as well as `0x' prefix to
6273 * Makefile.in (dist): Depend on Makefile so that changes to
6274 Makefile.in (like adding new files to DISTRIB) are reflected
6275 in the new distribution.
6277 Fri Apr 23 21:53:47 1993 Jim Meyering (meyering@comco.com)
6279 * {lib,src}/Makefile.in [.c.o]: Make CPPFLAGS and CFLAGS follow
6280 other options so users can use them to override DEFS.
6281 * src/Makefile.in [.c.o]: Add -I$(srcdir) for version.h.
6283 * Makefile.in [CFLAGS, LDFLAGS]: Don't set to -g explicitely;
6284 configure's AC_SUBST will set these.
6286 * Makefile.in [Makefile]: Add dependencies and a rule to remake it.
6287 [targets that cd then run make in subdirectories]: Don't depend
6288 on `cd ..'; use a subshell instead.
6290 * Makefile.in [info, install-info, dvi, check, installcheck]:
6291 New targets but no rules; comply with standards.
6293 * configure.in [CFLAGS]: Default to -g -O if CC is gcc and the user
6294 hasn't specified CFLAGS.
6295 [LDFLAGS]: Substitute into Makefile.
6297 Tue Mar 30 21:36:11 1993 Jim Meyering (meyering@comco.com)
6299 * od.c: New option --compatible, -C.
6300 (parse_old_offset): New function.
6301 * od.1: Document new option.
6303 Mon Mar 29 21:27:56 1993 Jim Meyering (meyering@comco.com)
6305 * cut.c, expand.c, join.c, nl.c: Always call error with errno
6306 (not zero) after failed fclose or non-zero ferror.
6308 Sun Mar 28 16:59:31 1993 Mike Haertel (mike@cs.uoregon.edu)
6310 * configure.in: Add check for working memcmp; use GNU's if
6311 the system's doesn't grok the 8th bit.
6312 * memcmp.c: Fix it so it groks the 8th bit.
6313 TODO: We really need to provide a fast memcmp, since most
6314 machines will have a broken memcmp. Probably should get
6316 * sort.c (mergefps): Maintain keybeg and keylim when copying
6317 the current line to `saved'.
6318 (numcompare): Skip white space here since -n no longer implies -b.
6319 (getmonth): Skip white space here since -M no longer implies -b.
6320 (compare): Completely overhauled to make the 8th bit work right,
6321 also to properly handle the global reverse option.
6322 (set_ordering): -n no longer implies -b, according to Posix.
6323 For consistency, -M also no longer implies -b.
6324 (main): Correct treatment of -r and global keys.
6325 (findlines): Clear keybeg and keylim if no keys are used.
6326 (sort): Avoid overwriting tempfiles[] array bounds.
6328 Sun Mar 21 22:29:29 1993 Jim Meyering (meyering@comco.com)
6330 * pr.c (close_file): Reverse May 13, '92 change, but add the condition
6331 that cols_ready_to_print not be decremented when printing across.
6332 The command `echo |pr -2ta' didn't terminate.
6333 (print_page): Rewrite conditional (that had side effects in second
6334 conjunct) using nested if statements to make it clear that we do
6335 indeed want those semantics.
6337 Tue Jan 19 13:35:24 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
6341 * system.h: Try BBSIZE if BSIZE isn't defined.
6342 From Tony Robinson <ajr@eng.cam.ac.uk>.
6344 Sat Dec 12 12:37:00 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
6346 * tail.c (tail_forever): Use an array of file descriptors
6347 instead of forking processes.
6348 (dump_remainder): Return number of bytes read.
6349 (tail_file): Fill in the new array.
6350 From Ian Lance Taylor.
6352 Fri Dec 11 17:18:16 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
6354 * system.h: Only define index, bcmp, etc. if not already defined.
6356 Tue Dec 8 10:31:14 1992 Jim Meyering (meyering@idefix.comco.com)
6358 * tr.c (is_char_class_member): Remove unreached return after abort.
6360 Sun Dec 6 22:34:52 1992 Jim Meyering (meyering@idefix.comco.com)
6362 * csplit, cut.c, expand.c, fold.c, head.c, join.c, od.c, pr.c,
6363 sort.c, split.c, tail.c, tr.c, unexpand.c, uniq.c: Remove inclusion
6364 of <ctype.h> and definitions of is* ctype macros to system.h.
6365 Change a few more uses of is* ctype macros to (protected) upper
6368 * system.h: Add isascii-protected ctype IS* macros.
6370 Wed Dec 2 12:28:10 1992 Jim Meyering (meyering@idefix.comco.com)
6372 * all files using getopt.h: Convert static declarations of
6373 struct option to use new macros from getopt.h: no_argument,
6374 required_argument, and optional_argument.
6376 Tue Dec 01 10:57:24 1992 Jim Meyering (meyering@idefix.comco.com)
6378 * od.c, pr.c, sort.c: Make uses of ctype.h macros consistent.
6380 * tr.c (main): Close stdin and stdout and check return status.
6382 Tue Nov 24 09:26:08 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6384 * system.h, csplit.c: Use HAVE_FCNTL_H and HAVE_STRING_H
6387 Tue Nov 24 08:42:30 1992 Jim Meyering (meyering@idefix.comco.com)
6389 * tr.c: Define new macros ISPRINT, ISALNUM, ISXDIGIT, ... that
6390 use isascii if it is defined.
6391 (is_char_class_member, make_printable_char, make_printable_str,
6392 non_neg_strtol): Use new macros instead of lower case ones
6395 * od.c (print_ascii, dump_strings): Use ISDIGIT and ISPRINT
6396 macros like pr.c. Suggested by David J. MacKenzie.
6398 * od.c (print_ascii, dump_strings): Check for isascii before isprint.
6399 (dump_strings): Free malloc'd buffer before returning.
6400 (skip): Return non-zero if an error occurred, zero otherwise.
6401 Exit only if asked to skip beyond end of combined input.
6402 (check_and_close): New function.
6403 (skip, read_block, read_char): Call check_and_close when done
6404 processing the file associated with in_stream.
6405 (skip, read_block, read_char): Set have_read_stdin.
6406 (main): Close stdin (if it was ever read) and check for errors
6407 just before exiting.
6408 (write_block, dump_strings, dump): Don't test return value from
6409 functions that operate on streams. Rely on later ferror tests.
6411 Sat Nov 21 12:41:49 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6413 * sort.c (main, usage): Add -T option.
6415 Thu Nov 19 14:33:40 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6417 * tail.c (tail_forever, sigusr1, kill_kids): New functions to
6418 do -f on multiple files.
6419 (main): Call tail_forever.
6420 From Ian Lance Taylor.
6422 Tue Nov 10 14:29:11 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6424 * cut.c (cut_fields): Add cast.
6426 * od.c (decode_one_format): Remove '#' from pre_fmt_string;
6427 many systems don't support it.
6428 Conditionalize long double support on __STDC__, not __GNUC__.
6429 From Ian Lance Taylor.
6431 Mon Nov 9 00:24:41 1992 Jim Meyering (meyering@idefix.comco.com)
6433 * sort.c (numcompare, keycompare): Add parentheses suggested
6434 by gcc -Wall. Put braces around individual monthtab initializers.
6436 * cksum.c: Declare error. Make checksum table `const.'
6438 * pr.c: Remove comment and dcl of unused variable, `print_a_number'.
6440 * split.c (main): Add `default: abort();' to enumeration switch.
6442 * All files: Make all functions and extern variables static.
6443 Make all longopts arrays const as well as static.
6444 Make a couple statically initialized aggregates `const.'
6446 Sun Nov 8 19:46:59 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6448 * od.c (main): Make old-style format options accumulate.
6451 Sat Nov 7 00:26:14 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6453 * tr.c (look_up_char_class): Add cast.
6455 * nl.c (build_type_arg), csplit.c (extract_regexp), tac.c (main):
6456 Add `const' to variable receiving value from re_compile_pattern.
6458 * wc.c (wc): If doing only -c, use st_size for regular files.
6460 * fold.c (fold_file): Was folding 1 column too early.
6461 From Eric Backus <ericb@lsid.hp.com>.
6463 * memset.c: New file.
6465 Fri Nov 6 20:14:51 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6467 * cksum.c: New file.
6469 Tue Oct 13 16:24:06 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6471 * tac.c (tac_stdin): Handle SIGPIPE.
6472 * sort.c (main): Handle SIGTERM.
6476 * system.h [USG || STDC_HEADERS]: Define bcmp.
6478 Sat Oct 3 20:41:24 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6480 * sort.c (main): Handle SIGPIPE. From trq@dionysos.thphys.ox.ac.uk.
6482 Tue Sep 29 01:10:05 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6484 * paste.c (main): Don't write on a string constant.
6486 Mon Aug 24 00:02:45 1992 Jim Meyering (meyering@churchy.gnu.ai.mit.edu)
6488 * tr.c: Minor cleanup. Replaced some assert(0) with abort().
6490 Tue Jul 7 02:14:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6492 * cmp.c, cmp.1: Move to diff distribution.
6494 Fri Jul 3 16:37:59 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6496 * system.h: Change FOO_MISSING to HAVE_FOO.
6498 Wed May 13 20:05:41 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
6500 * pr.c (COLUMN): Add structure member to remember filename.
6501 (main, init_fps, open_file, close_file): Use it.
6503 (close_file): Don't decrement cols_ready_to_print when closing
6504 a file. From cdl@mpl.UCSD.EDU (Carl Lowenstein).
6506 Mon May 11 19:17:33 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
6508 * cmp.c: --show-chars -> --print-chars.
6510 * pr.c: Rename some variables.
6512 Sat May 9 18:39:47 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6514 * system.h: Define DEV_BSIZE if not defined.
6516 Wed Apr 22 02:15:09 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
6518 * system.h, tac.c: SIGTYPE -> RETSIGTYPE.
6520 Fri Apr 17 10:42:23 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6522 * sort.c (main): Don't stop processing args when we hit "-";
6523 treat it like a regular filename.
6524 From ian@airs.com (Ian Lance Taylor).
6526 * pr.c (print_page): Fix off by one line count when ^L is in input.
6527 From Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de).
6529 Mon Apr 6 20:52:29 1992 Jim Meyering (meyering@churchy.gnu.ai.mit.edu)
6531 * tr.c (validate): Change error message so it doesn't mention
6532 actual name of --truncate-set1 option. From David MacKenzie.
6534 Sun Apr 5 14:22:42 1992 Jim Meyering (meyering@hal.gnu.ai.mit.edu)
6536 * tr.c (string2_extend, validate): Give an error message when
6537 translating without --truncate-set1, with empty string2, and
6538 with non-empty string1. "tr 1 ''" produced a failed assertion.
6540 Mon Mar 30 02:20:56 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6542 * system.h: Change how ST_BLKSIZE is calculated to allow for
6543 non-POSIX systems that don't define BSIZE in sys/param.h.
6545 Sat Mar 28 11:18:01 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6547 * sum.c (main, bsd_sum_file): Don't print filename if BSD
6548 algorithm is used and only one file was given.
6550 Wed Mar 25 11:34:41 1992 Jim Meyering (meyering@wombat.gnu.ai.mit.edu)
6552 * tr.c (get_spec_stats): Fix assertion to allow ranges like a-a
6553 with starting character equal to ending character. This is
6554 contrary to the POSIX spec, but what is already implemented
6555 in find_closing_delim.
6557 Mon Mar 16 00:15:11 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6561 * sort.c (numcompare, checkfp): Add parens to placate gcc2.
6563 * sort.c (mergefps): For -u, output the first, not last, of
6564 the lines that compare equal. From Mike Haertel.
6566 Tue Mar 10 10:51:38 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6568 * tr.c: Remove initial capitals and periods from error messages.
6570 Sun Mar 8 22:03:45 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6572 * sum.c (main): Add -r option for SYSV compat.
6574 Thu Feb 27 22:26:25 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6576 * sort.c (compare): If -s given, leave lines in their original order.
6577 (main): Recognize -s.
6578 (usage): Document -s.
6581 Tue Feb 18 20:29:45 1992 Randall Smith (randy at geech.gnu.ai.mit.edu)
6583 * sort.c (sort): Check for complete parsing of buffer into
6584 lines before nixing temp files.
6586 Mon Feb 17 10:35:58 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6588 * sum.c (sysv_sum_file): Use %lu instead of %u to print a
6589 long. Not that it matters for GNU . . .
6591 * tr.c (unquote, make_printable_str): Use \007 instead of ANSI \a.
6592 (append_normal_char, append_range, append_char_class,
6593 append_repeated_char, append_equiv_class, spec_init):
6594 Initialize `next' field of new `struct List_element'.
6595 From rommel@informatik.tu-muenchen.de (Kai-Uwe Rommel).
6597 Sat Feb 8 17:16:49 1992 David J. MacKenzie (djm at apple-gunkies.gnu.ai.mit.edu)
6599 * join.c (get_line): Renamed from getline to avoid GNU libc conflict.
6601 Sun Feb 2 21:22:01 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6605 * nl.c: Support multiple files and "-" for stdin.
6606 (main): Check for read and write errors.
6607 (nl_file): New function.
6609 Wed Jan 29 10:09:10 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6611 * tr.c (main): -t option was called -b in getopt spec.
6612 (validate): Don't warn that set1 is longer than set2.
6614 * tr.c: Rename --sysv-string2-truncate to --truncate-string1.
6616 Fri Jan 17 16:29:05 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6618 * nl.c: New program from bin-src.
6620 * nl.c (main): Use a struct linebuffer for line_buf.
6621 (process_file): Use readline instead of fgets, to preserve NULs.
6622 (check_section): Use memcmp instead of strncmp.
6623 (proc_text): Print line_buf with fwrite instead of printf.
6625 * nl.c (main): Usage message if too many args given. Check
6626 for error in closing input file. Lengths of section delimiter
6627 strings were 1 too large. Take separator_str into account in
6628 length of print_no_line_fmt.
6629 (build_print_fmt): Allocate space for print_fmt, in case
6630 separator_str is long.
6631 (proc_text): A blank line is one that contains nothing, not
6632 even nonprinting characters.
6634 Fri Jan 17 01:04:22 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6636 * All programs: Document `--' instead of `+' to introduce
6637 long-named options, in usage messages.
6639 * sum.c (bsd_sum_file): Renamed from sum_file.
6640 (sysv_sum_file): New function.
6641 (main): Recognize an option to select between the algorithms.
6643 Sun Jan 5 17:41:18 1992 Jim Meyering (meyering at churchy.gnu.ai.mit.edu)
6645 * pr.c (close_file, print_page): Fixed bug that had the command
6646 yes |head |pr -t printing "yyyyyyyyyy".
6647 * (print_page): Fixed bug that had pr -3 -a printing two too few
6648 trailer lines per page.
6649 * (main): Added restriction that -a and -m are incompatible.
6650 Although the POSIX spec doesn't explicitly say they shouldn't
6651 be used together, it says -a modifies the -column option and
6652 that -column shouldn't be used with -m.
6654 Thu Jan 2 15:23:59 1992 David J. MacKenzie (djm at albert.gnu.ai.mit.edu)
6656 * nl.c: Include regex.h after, not before, sys/types.h.
6658 Thu Jan 2 12:18:10 1992 Tom Lord (lord at geech.gnu.ai.mit.edu)
6660 * sort.c (fillbuf) return bytes buffered instead of bytes read.
6662 Fri Dec 27 22:53:36 1991 Jim Kingdon (kingdon at geech.gnu.ai.mit.edu)
6664 * sort.c (LINEALLOC): New #define.
6665 (struct lines): New field ``limit''.
6666 (initlines): Set it from new arg ``limit''.
6667 (sort, mergefps, checkfp): Pass new arg to initlines().
6668 (findlines): Don't realloc past lines->limit.
6670 Tue Dec 24 01:24:03 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6672 * tac.c, sort.c, csplit.c, system.h: Change POSIX ifdefs to
6673 HAVE_UNISTD_H and _POSIX_VERSION.
6675 * xwrite.c: Change POSIX ifdef to HAVE_UNISTD_H.
6677 Sat 14 Dec 1991 11:46:42 Jim Meyering (meyering at wombat)
6679 * tr.c: Fixed an inaccurate comment on posix_pedantic.
6681 Thu 12 Dec 1991 21:15:20 Jim Meyering (meyering at hal)
6683 * tr.c: Changed underscores to hyphens in long option name
6684 "sysv_string2_truncate".
6686 Wed Dec 11 13:33:34 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6688 * tac.c (main): Set obscure_syntax to tell re_search to
6689 allocate memory for the group registers.
6691 Fri Dec 6 18:26:27 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6693 * tac.c, sort.c, csplit.c [POSIX]: Use sigaction instead of
6694 signal, which POSIX doesn't have.
6695 * sort.c: Replace inthandler and huphandler with sighandler.
6696 * csplit.c (main): Only handle signals if they were not being
6699 * tr.c: POSIX_ME_HARDER -> POSIXLY_CORRECT.
6701 Wed Dec 4 00:47:47 1991 Jim Meyering (meyering at wombat)
6703 * tr.c (unquote): Reformat code so it doesn't go beyond column 80.
6704 * tr.c (squeeze_filter): Comment a little on why it's better
6705 to step through the input by two.
6706 * tr.c (set_initialize): Write a comment describing the function.
6707 * tr.c: Eliminated the variable `portability_warnings' and replaced
6708 references to it by references to `!posix_pedantic'. One of the
6709 uses of portability_warnings had been wrong.
6711 Tue Dec 3 14:03:35 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6713 * tr.c: New program.
6715 Sun Dec 1 15:07:35 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6717 * linebuffer.[ch] (freebuffer): New function (used by cron).
6719 Thu Oct 17 22:30:22 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6721 * system.h, configure, Makefile.in: Don't include memory.h if
6722 STDC_HEADERS, removing need for MEMORY_H_MISSING.
6724 Thu 17 Oct 1991 16:53:07 Jim Meyering (meyering at wombat)
6726 * pr.c (print_page): REALLY fixed `extra newline at EOF' problem.
6727 Somehow, part of my patch didn't make it last time.
6729 Sat Oct 12 12:04:47 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu)
6731 * tail.c (pipe_lines, pipe_bytes): Initialize `first->next'.
6733 * cmp.c (cmp): Print EOF message to stderr, not stdout, for
6736 * sort.c (xfwrite): fwrite never returns < 0, so check if
6737 number written is number we asked to write.
6738 (fillbuf, main): fread never returns < 0, so check ferror instead.
6741 Tue Oct 8 18:07:08 1991 Jim Meyering (meyering at churchy)
6743 * pr.c (print_page): Really fixed `extra newline at EOF' problem.
6744 * (store_columns): Fixed bug that caused `pr -b -2' to coredump
6745 on files of certain lengths.
6747 Fri Oct 4 22:30:25 1991 Jim Meyering (meyering at churchy)
6749 * pr.c (print_page): Fixed to not add single spurious newline
6750 at EOF when using -t.
6752 Wed Oct 2 01:02:05 1991 David J. MacKenzie (djm at apple-gunkies)
6754 * pr.c (print_page): Don't pad the page if -t given.
6756 * csplit.c (load_buffer), sort.c (mergefps): Use bcopy, not memcpy.
6758 Thu Sep 26 12:35:00 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu)
6762 * configure, system.h: Include memory.h if it works.
6764 * split.c: Allow `b' unit as well as `k' and `m'.
6766 * head.c, tail.c: Replace -b +blocks option with specifying
6767 units (b, k, or m) after the number.
6768 (parse_unit): New function.
6770 * fold.c (main): Check that -w arg is a number.
6772 * cut.c: +delimiter takes an arg.
6774 Mon Sep 16 14:52:38 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu)
6776 * pr.c (close_file): Don't close an already closed file.
6778 Thu Sep 12 00:14:43 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6780 * memchr.c: New file.
6781 * configure: Check if it's needed.
6783 * csplit.c, gcsplit.1: New program.
6785 * pr.c (cleanup): Only free buffers if they were allocated.
6787 * sort.c [!USG && !STDC_HEADERS]: Declare memchr.
6789 Wed Sep 11 20:54:16 1991 Jim Meyering (meyering at churchy)
6791 * pr.c: The following 3 bugs appeared (at least) when printing
6792 a single file with the options `-3 -f'.
6793 * (print_white_space): Single spaces were being replaced
6795 * (print_page): Some lines were getting too much white space
6796 at the beginning because spaces_not_printed wasn't being reset
6798 * (read_line): The single space between a truncated column
6799 on its left and the column on its right was omitted. Fixed
6800 so that previous value of input_position is restored before
6803 Sat Sep 7 03:22:18 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6805 * configure: Only remove /etc from PATH when it's not part of
6808 Wed Sep 4 17:09:24 1991 David J. MacKenzie (djm at apple-gunkies)
6810 * linebuffer.c (readline): Fix incorrect recalculation of `end'.
6812 * head.c, tail.c: Replace `mode' variables and bitmasks with
6813 separate variables for each option.
6815 Mon Sep 2 04:00:37 1991 David J. MacKenzie (djm at apple-gunkies)
6817 * wc.c: New program.
6819 Sun Sep 1 01:18:38 1991 David J. MacKenzie (djm at apple-gunkies)
6821 * fold.c (fold_file): Read in an int, not a char, for EOF
6824 * configure: Check whether st_blksize is missing.
6826 * tac.c (save_stdin): Put copy of pipe input in TMPDIR if
6827 defined, instead of /tmp.
6829 Thu Aug 29 14:48:15 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6831 * xwrite.c [POSIX]: unistd.h might require sys/types.h.
6833 Wed Aug 28 11:57:39 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6835 * paste.c (main): Consider -d "" to be like -d "\0",
6836 for POSIX (if I read it right).
6838 * sort.c, join.c: New programs.
6840 * cut.c (set_field): Allow blanks as well as commas to
6841 separate numbers in ranges.
6843 Sun Aug 25 19:57:40 1991 Jim Meyering (meyering at apple-gunkies)
6845 * pr.c: Failure to open an input file is no longer a fatal error.
6846 A message is printed for each failed open. When printing
6847 in parallel, each failed open results in one fewer output column.
6848 Added POSIX -r option to suppress the message.
6849 * pr.c: Added variables: failed_opens, ignore_failed_opens.
6850 These changes were based in part on work by David MacKenzie.
6852 Sat Aug 24 15:27:39 1991 Jim Meyering (meyering at pogo)
6854 * pr.c: Complain if user gives both -m and -[0-9]+ options.
6856 Wed Aug 21 22:04:57 1991 David J. MacKenzie (djm at apple-gunkies)
6860 Mon Aug 19 00:16:51 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6862 * expand.c: Rename some variables.
6863 (expand): Don't access value off end of array.
6864 * unexpand.c: Rename some variables.
6865 (unexpand): Don't access value off end of array.
6866 Instead of copying tabs verbatim and flushing pending spaces
6867 when one is reached, count them as the proper number of
6868 pending spaces. Instead of changing tabs to single spaces if
6869 the tabstop list is exhausted, print the rest of the line
6870 unchanged (for POSIX).
6872 Sat Aug 17 01:49:41 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6874 * cut.c (cut_file), paste.c (paste_parallel, paste_serial):
6875 Clear EOF and error conditions on stdin so it can be reused.
6877 * expand.c, unexpand.c (parse_tabstops): Allow blanks as well
6878 as commas to separate tabstops, for POSIX.
6879 * expand.c (expand), unexpand.c (unexpand): Don't line-buffer
6880 the output; send it directly to stdout.
6881 * unexpand.c (main): Make -t stupidly imply -a for POSIX.
6882 (unexpand): If a tab stop list was given and we move past its end,
6883 copy the rest of the line verbatim.
6885 * split.c (convint): New function to allow 'm' and 'k' after
6887 (main): Use it. Change -c option to -b for POSIX.
6889 Fri Aug 9 02:47:02 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6891 * pr.c: Protect isdigit with isascii, if required.
6893 Tue Aug 6 21:42:25 1991 David J. MacKenzie (djm at wheat-chex)
6895 Most of the following is from Paul Eggert:
6896 * cat.c (main): If stdin is read, check close at end.
6897 * cmp.c (main): Check for stdin being closed.
6898 Check for close errors on stdin and stdout.
6899 (cmp): Return a value instead of exiting.
6900 * cut.c (cut_file): New function, from code in main.
6901 Check for read errors.
6902 (main): Check for close errors.
6903 * expand.c, unexpand.c (main): Check for close errors.
6904 (next_file): Go to next file if one can't be opened.
6905 Check for close errors.
6906 * head.c (main), tail.c (main): If stdin was read, check for
6908 * head.c (head_file), tail.c (tail_file): Check for close errors.
6909 * paste.c (main, paste_parallel, paste_serial), tac.c (main):
6910 Check for close errors. Close stdin if it was read.
6911 * split.c (main): Check for close errors.
6913 * configure, Makefile.in's: Support +srcdir option.
6914 Make config.status. Fix up clean targets.
6916 Wed Jul 31 01:32:59 1991 David J. MacKenzie (djm at hal)
6918 * linebuffer.h (struct linebuffer): Add a field to indicate
6919 the number of valid chars in the line.
6920 * linebuffer.c (initbuffer, readline): Fill it in.
6921 * uniq.c, comm.c: Use it.
6923 * pr.c (main): Check stdin and stdout fclose for errors.
6924 (init_parameters): If there's no room for header and footer,
6925 omit them rather than dying (for POSIX).
6926 (init_header): Take a file descriptor as additional arg.
6927 (init_fps): Change callers. Note when stdin is read.
6928 (open_file): For filename "-" use stdin.
6929 (close_file): Don't close stdin. Check close for errors.
6930 (print_char, char_to_clump): Use isprint instead of explicit
6933 * memcmp.c: New file (needed for comm).
6934 * bcopy.c: New file (needed for fold).
6935 * system.h: Don't define bcopy as memcpy.
6936 * configure: Check for bcopy and memcmp.
6938 * uniq.c (main): Use "-" instead of NULL to mean stdin or
6940 (check_file): Use "-" instead of NULL to mean stdin or stdout.
6941 Check readline return instead of for NUL character to
6943 Check fclose for errors.
6944 (find_field): Use linebuffer length, not NULs, to detect end
6946 (different): New function, replaces compare. Uses memcmp
6948 (writeline): Use fwrite instead of fputs so NULs are preserved.
6950 * comm.c (compare_files): Return an error indication.
6951 Don't take a filename of NULL to mean stdin.
6952 Use memcmp instead of strcmp to allow for NULs.
6953 Check fclose for errors.
6954 (writeline): Use fwrite instead of fputs so NULs are preserved.
6956 * sum.c (sum_file): Take an arg indicating whether to print
6957 the filename, and don't take NULL meaning stdin. Set a flag
6958 when we read stdin. Check fclose return for errors.
6959 (main): If stdin was read, check fclose return for errors.
6960 Use filename of "-" if no args given.
6962 Thu Jul 25 15:17:10 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6964 * fold.c: Rewritten from scratch for POSIX.
6966 Wed Jul 24 01:55:41 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6968 * split.c (line_bytes_split): Use xmalloc instead of alloca.
6969 * system.h: Don't declare alloca.
6971 * tac.c, tail.c: Use SEEK_ instead of L_ for lseek.
6972 * system.h: Define SEEK_ macros if not defined.
6974 * pr.c: Rename variable `truncate' to avoid library function conflict.
6976 Tue Jul 23 13:21:48 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6978 * linebuffer.c, linebuffer.h: New files.
6979 * comm.c, uniq.c (initbuffer, readline): Functions
6980 removed (use versions in linebuffer.c).
6982 Mon Jul 22 13:23:53 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6984 * sum.c (sumfile): Always print 5 digits for second number, too.
6985 Interpret "-" to mean stdin.
6987 Sat Jul 20 14:24:40 1991 David J. MacKenzie (djm at bleen)
6989 * uniq.c: Use isblank instead of isspace, to support POSIX.2.
6990 * comm.c, pr.c, uniq.c (concat, fatal, error,
6991 pfatal_with_name, xmalloc, xrealloc): Functions removed.
6993 Sat Jul 13 02:04:53 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
6995 * nl.c: Add long-named options. Doc fixes.
6997 Sat Jul 6 02:19:09 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
6999 * expand.c, unexpand.c [STDC_HEADERS]: Include stdlib.h.
7001 * xwrite.c [POSIX]: Include unistd.h.
7002 [STDC_HEADERS]: Don't declare errno.
7004 Sun Jun 30 23:35:16 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7006 * uniq.c: Add long-named options. Remove marginally useful -z
7007 option (zero padded repeat counts).
7009 Thu Jun 27 16:31:45 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7011 * tail.c (tail_file), tac.c (save_stdin, tac_file), split.c
7012 (cwrite), head.c (head_file), cat.c (main): Check close return
7013 value for delayed error report due to NFS.
7015 Tue Jun 11 00:12:15 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7017 * cat.c: Replace "uchar" with "unsigned char", to avoid
7018 problems with various systems' typedefs.
7020 Thu Jun 6 12:54:26 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7022 * cat.c (cat): Interpret ENOTTY return from FIONREAD ioctl to mean
7023 operation is unsupported, for HP-UX 7.0.
7025 Sun Apr 14 21:49:17 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
7027 * sum.c: Always print five digits for first number.
7029 Fri Mar 15 16:16:54 1991 David J. MacKenzie (djm at geech.ai.mit.edu)
7031 * cat.c, cmp.c: Don't use fileno(); not needed.
7033 Thu Jan 10 02:16:55 1991 David J. MacKenzie (djm at albert.ai.mit.edu)
7035 * tac.c, tail.c: Change _POSIX_SOURCE to POSIX.
7037 Thu Dec 27 00:06:45 1990 David J. MacKenzie (djm at egypt)
7039 * cut.c (cut_file_bytes, cut_file_fields): Make inbufp and
7041 (enlarge_line): Adjust inbufp and outbufp.
7043 Sun Sep 9 16:54:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7045 * cat.c: Declare free returning void, not int, so it
7046 doesn't bomb on Xenix.
7048 Mon Sep 3 22:23:57 1990 David J. MacKenzie (djm at coke)
7050 * tac.c: Print error messages before calling cleanup, not after.
7052 Tue Aug 28 18:05:24 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7054 * tac.c (cleanup): Return SIGTYPE, not int.
7056 Tue Aug 7 12:51:18 1990 David J. MacKenzie (djm at apple-gunkies)
7058 * cut.c (main, usage): Add -b and -n options for POSIX.
7059 (set_fields): Don't allow SPC or TAB as number separators.
7061 * paste.c (paste_parallel): If open of any file fails, quit
7064 Mon Aug 6 22:14:13 1990 David J. MacKenzie (djm at apple-gunkies)
7066 * pr.c: Add POSIX -F option (same as -f).
7068 * uniq.c (check_file): Allow '-' to mean stdin or stdout.
7070 Mon Aug 6 14:43:30 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7072 * head.c, tail.c: Change `chars' to `bytes' globally.
7073 (main, usage): Use POSIX.2 draft 10 option syntax.
7075 Sun Aug 5 11:51:12 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7077 * cat.c (main): Don't delay error messages, so they appear
7079 (main, simple_cat, cat): Make errors in input files nonfatal.
7081 Sat Aug 4 10:11:30 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7083 * cat.c: Remove -c option added for POSIX draft 9, since POSIX
7084 draft 10 removed it.
7086 * tac.c (tac_stdin): Use fstat instead of lseek to determine
7087 whether stdin is seekable, because lseek silently fails on
7088 some special files, like tty's.
7089 tail.c (tail_chars, tail_lines): Use fstat instead of lseek;
7090 don't turn off -f for non-regular files (assume the user knows
7091 what he's doing; it might work for fifo's and sockets).
7093 * paste.c (main): If no files given, use stdin.
7094 Don't let collapse_escapes write on string constant (delim default).
7095 (paste_parallel): Don't close stdin.
7097 * cut.c (main): Use standard input for filename of "-".
7099 * comm.c (compare_files): Allow '-' to mean stdin.
7101 Fri Aug 3 13:38:28 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7103 * cut.c (enlarge_line): Take an arg giving the required amount
7104 of space. Change callers.
7105 (main): Don't allow -t'<TAB>' without -f.
7106 Make `delim' unsigned to fix sign extension problem in comparison.
7108 Tue Jul 17 12:36:11 EDT 1990 Jay Fenlason (hack@ai.mit.edu)
7110 * pr.c Deleted excess whitespace from ends of lines.
7111 Modified to work with current version of getopt, which
7112 returns 1 instead of 0 for non-options.
7113 Reversed the meaning of the -f option, to be compatable
7116 Sun Jul 8 00:39:31 1990 David J. MacKenzie (djm at apple-gunkies)
7118 * cmp.c (main, usage): Rename -L option to -c and don't have
7120 (printc): Take an arg to specify number of chars to pad to,
7121 for column alignment.
7122 (cmp): Respect flag_print_chars in default output format.
7123 Align columns for cmp -cl.
7125 Sat Jul 7 17:23:30 1990 David J. MacKenzie (djm at apple-gunkies)
7127 * cmp.c: For +show-chars, have getopt return 'L' so
7128 `flag_print_chars' gets set.
7130 Fri Jun 29 01:04:19 1990 David J. MacKenzie (djm at apple-gunkies)
7132 * tac.c (main): Initialize fastmap and translate fields of
7133 regex before compiling it.
7135 Fri Jun 22 00:38:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7137 * tac.c: Change +regexp to +regex for consistency with GNU find.
7139 Wed Jun 20 01:46:09 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7141 * cat.c (cat): If FIONREAD is available, only use it if it is
7142 supported by the filesystem that the file is on.
7144 Sun Jun 3 20:26:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7146 * cat.c (main): Add a variable to control whether the check
7147 for input file == output file is made, because no values of
7148 st_dev and st_ino should be assumed to be available for this
7149 purpose. Only do the check for regular files.
7151 * tac.c: Use bcopy instead of memcpy.
7153 Thu May 31 00:55:36 1990 David J. MacKenzie (djm at apple-gunkies)
7155 * head.c: Use longs instead of ints for file offsets, for 16
7158 Tue May 22 00:56:51 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7160 * cmp.c: Change some ints to longs for 16 bit machines.
7161 (bcmp_cnt): Make char-pointer counting slightly simpler.
7163 Sat May 12 01:16:42 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7165 * cat.c (main): Allow input file to be output file for devices
7166 (ttys, etc.). Check whether input file is output file when
7167 reading standard input. Print any error messages for standard
7170 * cmp.c (bcmp_cnt): Handle int comparisons correctly on 16 bit
7171 machines as well as 32 bit ones.
7172 * cmp.c, tail.c: Use longs instead of ints for file offsets.
7174 Fri May 11 02:11:03 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7176 * cmp.c: Fix some exit statuses for POSIX.
7178 Tue May 8 03:41:42 1990 David J. MacKenzie (djm at abyss)
7180 * tac.c: Use regular expressions as the record boundaries.
7181 Give better error messages.
7182 Reformat code and make it more readable.
7183 (main): Use getopt_long to parse options.
7184 (tac_stdin): Do not make a temporary file if standard input
7186 (tac_file): New function.
7187 (tac): Take an open file desc as an arg.
7188 (output): Rewrite to use its own efficient buffering.
7189 (xmalloc, xrealloc, xwrite): New functions.
7191 Sun Apr 8 20:33:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7193 * head.c, tail.c: Use `error' instead of `fatal_perror' and
7194 `nonfatal_perror'. Remove some unnecessary info from messages.
7196 Wed Mar 21 09:30:18 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7198 * comm.c (main): Pass the list of files to compare_files as a
7199 char ** instead of a char *.
7200 (compare_files): Make arg a char **.
7202 * uniq.c: Declare some functions as void.
7203 Change global vars `countmode' and `mode' from ints to enums.
7204 (main): Use getopt to parse options and support POSIX options.
7205 Don't use integer_arg to parse numbers, since `-#' can't be
7206 parsed that way using getopt.
7207 (find_field): Use isspace for finding fields boundaries.
7209 Tue Mar 20 14:28:25 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7211 * comm.c (main): Call usage if given bad option or wrong
7212 number of args. Exit with 0 status normally.
7213 (usage): New function.
7214 Declare some other functions as void.
7216 Wed Mar 14 10:48:40 1990 David J. MacKenzie (djm at rice-chex)
7218 * cmp.c (main, cmp, usage): Replace -q +quick option with -L
7219 +show-chars option to add ASCII representation of bytes to -l format.
7221 Tue Mar 13 00:50:14 1990 David J. MacKenzie (djm at rice-chex)
7223 * cmp.c (cmp): Change EOF message for POSIX compatibility.
7224 For -l format, clear bits > FF.
7226 Mon Mar 5 17:21:00 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7228 * tail.c: Move global `errors' into main instead of having
7229 nonfatal_perror set it.
7230 (tail, tail_chars, tail_file, tail_lines, pipe_chars, pipe_lines):
7231 Return an error status.
7232 (file_lines, start_chars, start_lines): Reverse the meaning of
7234 (tail_lines, tail_chars): Account for that reversal.
7236 Mon Mar 5 00:34:36 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7238 * head.c: Move global `errors' into main and have the various
7239 functions return an error status instead of setting it in
7242 Sat Mar 3 11:27:27 1990 Torbj|rn Granlund (tege at echnaton)
7244 * cmp.c (cmp): Call function bcmp_cnt for flag == 0 (i.e. no
7245 options specified), to compare the two blocks and count
7246 newlines simultaneously.
7247 * cmp.c New function: bcmp_cnt.
7249 * cmp.c (main): Test if output is redirected to /dev/null, and
7250 assume `-s' if this is so.
7252 Tue Feb 20 17:09:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7254 * cat.c: Change `argbad' from a char to a short, so it will
7255 work on machines with unsigned chars.
7257 Sat Feb 10 02:16:40 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7259 * cmp.c (cmp): Rename `r' to `first_diff', and `x' to `smaller'.
7260 Remove unneccessary variable `c1'. If -l was given, increase
7261 `char_number' by the number of bytes read, after producing output,
7262 rather than by the offset of the first differing bytes, before
7264 Replace if-else-if constructions with case statements for clarity.
7265 (bcmp2): Rename `n' to `nread'.
7267 Wed Dec 20 01:32:06 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7269 * nl.c (proc_text): Use re_search instead of re_match.
7271 Tue Dec 19 01:26:34 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7273 * nl.c: Indent. Un-nest statements. Use GNU regexp functions
7274 instead of System V ones. Move function declarations together.
7275 (quit): Remove useless function.
7276 (program_name): New variable for error messages.
7277 (main): Use perror in error message.
7278 (xmalloc): New function to replace myalloc.
7279 (myalloc): Function removed.
7280 Global: use program_name and xmalloc.
7282 Sun Dec 17 00:36:36 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7284 * uniq.c: Declare some functions.
7285 (main): Initialize infile and outfile. Call usage if given
7286 invalid args. Normally exit with 0 status instead of garbage.
7287 (usage): New function to print usage message and exit.
7288 (check_file): Remove unused variable.
7289 (readline): Compare against EOF, not < 0.
7290 (xmalloc, xrealloc): Return char *, not int.
7291 Ok to return 0 if 0 bytes requested.
7292 (lb1, lb2): Remove unused global vars.
7293 (concat): Remove unused function.
7295 Sat Dec 16 15:15:50 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7297 * comm.c: Remove unused global variables lb1, lb2.
7298 (main): Remove unneeded variable.
7299 (compare_files): Remove unused arg.
7300 (readline): un-nest assignment. Test against EOF instead of < 0.
7301 (error): Print to stderr, not stdout.
7302 (xmalloc, xrealloc): Return char * instead of int.
7303 Returning 0 is ok if 0 bytes requested (ANSI C).
7307 version-control: never