1 2001-03-04 Jim Meyering <meyering@lucent.com>
5 * Makefile.maint (alpha): Use $(PACKAGE)-$(VERSION), not $(distdir),
6 since the latter now has a `$(top_distdir)/' prefix.
8 2001-03-01 Paul Eggert <eggert@twinsun.com>
10 * src/sort.c (die): New function.
11 (create_temp_file, xfopen, xfclose, write_bytes, sort_buffer_size,
12 fillbuf, main): Use it to regularize error messages. The only change
13 in behavior is that write_bytes and the final close used to say "write
14 error" but now give just the output file name, which should be enough.
16 2001-03-01 Paul Eggert <eggert@twinsun.com>
18 * src/sort.c (xfclose): Add FILE arg, and report the file name
19 on error. All callers changed.
21 2001-03-01 Paul Eggert <eggert@twinsun.com>
23 * src/sort.c (main): When fclose (stdin) fails, do not mention
24 the output file in the error message; mention "-" instead.
26 2001-02-28 Paul Eggert <eggert@twinsun.com>
28 * src/sort.c (xfopen): Set have_read_stdin to 1 only if file is "-".
29 Use fopen_safer, not fopen, to avoid subtle bugs when fopen returns
30 stdin, stdout, or stderr.
31 (xfclose): stdout is no longer a special case.
32 (main): Close output file, don't just flush it; there might be
33 an error on the close.
35 2001-02-27 Paul Eggert <eggert@twinsun.com>
37 * src/sort.c (initbuf): If the desired size cannot be
38 allocated, repeatedly halve it until allocation succeeds.
39 Reported by Solar Designer.
41 2001-02-26 Paul Eggert <eggert@twinsun.com>
43 * src/sort.c (parse_field_count): Comment fix.
45 2001-02-25 Paul Eggert <eggert@twinsun.com>
47 * src/sort.c: Tune allocation and comparison of nodes
48 representing temp files. This improved CPU performance of
49 'sort -S 1 *.[ch]' by 17% on my host.
51 (struct tempnode): name member now uses struct hack.
52 (temphead): Now a pointer, not a structure. All uses changed.
53 (create_temp_file): Allocate node using struct hack.
54 (zaptemp): Free node using struct hack. Use pointer comparison, not
57 2001-02-25 Paul Eggert <eggert@twinsun.com>
59 * src/sort.c (eolchar, trim_trailing_blanks): Now static.
61 2001-02-25 Paul Eggert <eggert@twinsun.com>
63 'sort' race condition fixes.
65 Defend against a DoS attack where someone else creates a
66 temporary file with the same name as ours. Use mkstemp to do
67 this, supplying our own mkstemp if the system doesn't have one.
69 Also, fix a race condition during cleanup on hosts without
72 * src/sort.c (NAME_MAX_IN_DIR): Remove.
73 (sigprocmask, sigset_t): New macros, defined only on older hosts.
74 (caught_signals): New var.
75 (xtmpfopen, tempname): Removed.
76 (create_temp_file): New function, combining the functions of the old
77 xtmpfopen and tempname. All callers changed.
78 Use mkstemp to create the file.
79 (sighandler): On hosts without sigaction, ignore signals while
80 cleaning up, instead of letting them interrupt cleanup.
81 (main): Initialize caught_signals. On hosts with sigaction, block all
82 caught signals while handling one. Remove duplicate code.
84 2001-02-22 Jim Meyering <meyering@lucent.com>
86 * src/sort.c (keycompare): Move declarations of locals, lena and lenb,
87 into the inner scope where they are used.
89 2001-02-19 Jim Meyering <meyering@lucent.com>
91 * src/sort.c (AUTHORS): Add Paul Eggert.
93 * src/wc.c (wc): Rename innermost `buf' to avoid shadowing warning.
94 (wc): Rename local `wc' to avoid shadowing function name.
96 2001-02-18 Paul Eggert <eggert@twinsun.com>
98 Fix a race condition: freed storage accessed during a signal handler.
100 * src/sort.c (struct tempnode.next): Now volatile.
101 (zaptemp): Free the file name after removing it from the temp list,
102 not before, because a signal can arrive between the two actions
103 and cleanup () traverses the list.
105 2001-02-18 Paul Eggert <eggert@twinsun.com>
107 Check for input size, and do not overallocate memory.
108 Also check for memory quotas.
110 Revamp storage management so that line tables and character data are
111 taken from the same buffer. Line tables are now in reverse order,
112 since they grow down while the character data grow up.
115 (<sys/resource.h>): Include if HAVE_SYS_RESOURCE_H.
116 (struct rlimit, getrlimit): Define a replacement if RLIMIT_DATA
118 (RLIMIT_AS): Define to RLIMIT_DATA if not defined.
119 (struct lines): Remove.
120 (struct buffer): New members nlines, line_bytes, eof.
121 Remove member newline_free; no longer needed, since the code no longer
122 runs out of line table space.
123 (SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): Remove.
124 (sort_size): Renamed from sortalloc; now applies to the sum of the
125 character data and the line table, not just the character data.
126 (MIN_SORT_SIZE, INPUT_FILE_SIZE_GUESS): New macros.
127 (linelength): remove.
128 (specify_sort_size): Don't worry about the distinction between the
129 character data and the line table; that is now the caller's
131 (default_sort_size): Return the value, instead of being executed for
132 side effect. Return half of available memory, or 1/16 of total memory,
133 whichever is greater; except do not exceed 1/2 of quota.
134 (sort_buffer_size): New function.
135 (initbuf): New arg LINE_BYTES. Ensure that the line array is properly
136 aligned. Initialize the new set of struct buffer members.
137 (buffer_linelim): New function.
138 (fillbuf): Return int, not size_t, since the callers merely care
139 whether the result is nonzero. New arg FILE so that error messages
140 can report the file name. Keep track of eof. Initialize the line
141 table too, taking its memory from the input buffer's memory; this
142 subsumes the old findlines function and removes the need for worrying
143 about running out of line table entries.
144 (checkfp, mergefps, sortlines, merge, sort): Adjust to the new storage
145 management regime, in particular the fact that line tables are now
146 filled in by fillbuf and are in reverse order.
147 (checkfp): Now takes char *, not const char *, since subroutines
148 require that now. Rewrite to avoid lint and duplicate code.
149 If line length alloc calculation overflows,
150 simply allocate enough memory to hold the line.
151 (mergefps): New arg FILES, used for buffer size calculation and error
152 messages. Rewrite to avoid lint. Do not loop if savealloc*2
154 (mergefps, merge): Zap temporary files eagerly rather than lazily;
155 this is needed because we now pass FILES to mergefps.
156 (sortlines): Args now point at end of arrays, not at beginnings.
157 (sort): Do not allocate temporary line array for sortlines;
158 instead, take the space from the same buffer.
159 (main): Adjust to sort_size and default_sort_size changes.
161 2001-02-18 Jim Meyering <meyering@lucent.com>
163 Rename test input files to avoid conflicts on case-insensitive
165 * tests/pr/2-Sf-t_notab: Rename from 2Sf-t_notab.
166 * tests/pr/2-S_f-t_notab: Rename from 2S_f-t_notab.
167 * tests/pr/W-72l17f-ll: Rename from W72l17f-ll.
168 * tests/pr/Test.pm: Update file names to reflect renamings.
169 Reported by Matthew Smith.
171 2001-01-20 Jim Meyering <meyering@lucent.com>
173 * configure.in: Remove jm_CHECK_ALL_TYPES.
174 Now it's invoked by jm_MACROS.
176 2001-01-17 Jim Meyering <meyering@lucent.com>
178 * src/cksum.c (main): Use PACKAGE, not GNU_PACKAGE.
179 * src/tsort.c (main): Likewise.
180 * src/sort.c (main): Likewise.
181 (usage): Convert each TAB in --help output to a sequence of 8 spaces.
183 2001-01-07 Jim Meyering <meyering@lucent.com>
185 * src/tail.c (usage): Split a string that was longer than 2048 bytes.
187 2001-01-03 Jim Meyering <meyering@lucent.com>
189 * src/sort.c (main): Remove embedded \n from diagnostic.
191 2001-01-02 Jim Meyering <meyering@lucent.com>
193 * src/od.c (ulonglong_t): Define place-holder type to avoid some #if
195 (LONGEST_INTEGRAL_TYPE): Remove definition.
196 (MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of
197 LONGEST_INTEGRAL_TYPE.
198 (print_long_long): Compile this function even on systems without
200 (decode_one_format): Remove #if directive.
202 * src/od.c (decode_one_format): Guard use of print_long_long with
203 `#if HAVE_UNSIGNED_LONG_LONG'. From Darren Salt.
204 Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead.
206 2000-12-23 Jim Meyering <meyering@lucent.com>
208 * src/sys2.h [HAVE_INTTYPES_H]: Include <inttypes.h>.
210 2000-12-19 Jim Meyering <meyering@lucent.com>
214 2000-12-18 Paul Eggert <eggert@twinsun.com>
216 * NEWS, doc/textutils.texi: New "sort" option -S SIZE.
218 * src/sys2.h (UINTMAX_MAX): New macro, taken from C99.
220 * src/sort.c: Include physmem.h.
221 (SORTALLOC, mergealloc, LINEALLOC): Remove.
222 (sortalloc): Default to zero at program startup.
223 (SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): New macros.
224 (usage, main): Add support for new -S SIZE option.
225 (specify_sort_size, default_sort_size): New functions.
226 (initlines): Do not let alloc exceed limit.
227 (findlines): Likewise.
228 (checkfp, mergefps, sort): Use sortalloc to size everything
229 else, instead of relying on precomputed sizes.
231 2000-12-17 Jim Meyering <meyering@lucent.com>
233 * doc/texinfo.tex: Update from master repository.
234 * config.sub: Likewise.
235 * config.guess: Likewise.
237 2000-12-11 Jim Meyering <meyering@lucent.com>
241 2000-12-07 Jim Meyering <meyering@lucent.com>
243 * src/od.c (address_base): Declare to be static.
245 2000-12-06 Paul Eggert <eggert@twinsun.com>
247 * src/od.c (address_base, address_pad_len): New var.
248 (output_address_fmt_string, address_fmt_buffer, address_pad): Remove.
249 (flag_pseudo_start): Now int, not long int.
250 (pseudo_offset): Now off_t, not long int.
251 (n_specs, n_specs_allocated): Now size_t, not unsigned int.
252 (format_address, format_address_none, format_address_std,
253 format_address_label): Now accepts an extra char argument (an extra
254 char to print if nonzero), and prints instead of returning a string.
256 (bytes_per_block): Now size_t, not int.
257 (format_address_none): Do not even print the extra char argument.
258 This simplifies the callers.
259 (format_address_std, format_address_label): Print off_t ourself
260 instead of trying to use autoconfigured format. This is faster and
262 (format_address_paren): New function.
263 (dump): Remove unnecessary cast.
264 (expand_address_fmt): Remove.
265 (main): Use size_t, off_t, etc. instead of builtin types where this is
266 advisable. Adjust to above changes. Remove unnecessary cast.
268 2000-12-03 Jim Meyering <meyering@lucent.com>
270 * src/tail.c (tail_file): Initialize ignore, dev, and ino members,
271 when tailing forever and the open failed. Otherwise, we could get
272 uninitialized memory references of those fields in recheck.
273 * tests/tail-2/Makefile.am (TESTS): Add assert-2.
274 * tests/tail-2/assert-2: New file.
278 Make od print valid addresses for offsets of 2^32 and larger, and
279 allow byte offset (-j) and byte count (-N) to be 2^32 and larger.
281 * src/od.c (MAX_ADDRESS_LENGTH): Don't hard-code as a literal.
282 Rather, define in terms of the type, off_t.
283 (string_min): Declare to be of type size_t.
284 (flag_dump_strings): Declare to be of type int.
285 (print_s_char): Declare the n_bytes parameter and the local, `i',
287 (print_char): Likewise.
288 (print_s_short): Likewise.
289 (print_short): Likewise.
290 (print_int): Likewise.
291 (print_long): Likewise.
292 (print_long_long): Likewise.
293 (print_float): Likewise.
294 (print_double): Likewise.
295 (print_long_double): Likewise.
296 (dump_hexl_mode_trailer): Likewise.
297 (print_named_ascii): Likewise.
298 (print_ascii): Likewise.
299 (write_block): Likewise.
300 (print_ascii): Declare local, `print_function' with a prototype.
301 Change a few `>' comparisons to the equivalent `<' form.
302 (parse_options): Declare `tmp' to be of type uintmax_t.
303 Use xstrtoumax, not xstrtoul.
304 Fail if the specified offset if larger than OFF_T_MAX.
305 (dump_strings): Declare local `i' to be of type size_t.
306 Remove the now-unnecessary cast-to-off_t.
307 (main) [IF_LINT]: Initialize desired_width to avoid a warning.
308 Declare `tmp' to be of type uintmax_t.
309 Use xstrtoumax, not xstrtoul.
310 Fail if minimum string length is larger than SIZE_MAX.
311 Fail if specified width is larger than ULONG_MAX.
313 * src/od.c (format_address): Use off_t, not long unsigned_int as the
315 (format_address_none): Likewise. Mark parameter as unused.
316 (format_address_std): Likewise.
317 (format_address_label): Likewise.
318 (print_ascii): Mark format string parameter as unused.
319 (write_block): Use off_t, not long unsigned_int as offset type.
320 (expand_address_fmt): New function.
321 (main): Use it to expand each address format string template.
322 Reported by Mark Nudelman, via Andreas Jaeger.
324 * src/sys2.h (OFF_T_MIN): Define here instead.
325 (OFF_T_MAX): Likewise.
328 * src/tail.c (parse_options): Use xstrtoumax to parse the byte and line
329 offset. Give a better diagnostic when the requested offset is still
330 representable but larger than OFF_T_MAX.
331 (OFF_T_MIN): Remove definition.
332 (OFF_T_MAX): Likewise.
334 2000-12-02 Jim Meyering <meyering@lucent.com>
336 * src/sort.c (checkfp): Rename local `buf' to avoid shadowing previous
339 * src/sort.c (NONZERO): Define and use it to make the code a tiny
342 * doc/textutils.texi (sort invocation): Clarify how -t works
343 when a sort key specifies a range of fields. From Karl O. Pinc.
345 2000-11-26 Paul Eggert <eggert@twinsun.com>
347 * src/od.c (skip): Use lseek instead of worrying about fseeko or fseek.
348 This should be portable, as we seek before doing any I/O.
349 (fseeko): Remove; no longer used.
351 2000-11-30 Jim Meyering <meyering@lucent.com>
353 * src/sort.c: s/SIZE_T_MAX/SIZE_MAX/.
355 2000-11-30 Paul Eggert <eggert@twinsun.com>
357 * src/sys2.h: Include <stdint.h> if HAVE_STDINT_H.
358 (SIZE_MAX): Renamed from SIZE_T_MAX, as C99 uses SIZE_MAX.
361 2000-11-30 Jim Meyering <meyering@lucent.com>
363 * src/sort.c: SIZE_MAX is not defined, so s/SIZE_MAX/SIZE_T_MAX/, and...
364 * src/sys2.h (SIZE_T_MAX): ... define.
366 2000-11-29 Paul Eggert <eggert@twinsun.com>
368 Port GNU "sort" to hosts where sizes don't fit in "int",
369 e.g. 64-bit Solaris (sparc).
371 * src/sort.c ("human.h", "xstrtol.h"): Include.
372 (struct line): length member is now size_t, not int.
373 (struct lines): Likewise for used, alloc, limit members.
374 (struct buffer): Likewise for used, alloc, left, newline_free members.
375 (struct keyfield): Likewise for sword, schar, eword, echar members.
376 (sortalloc, mergealloc, linelength): Now size_t, not int.
378 (initbuf, fillbuf, initlines, begfield, limfield, findlines,
379 numcompare, getmonth, keycompare, compare, checkfp, mergefps,
380 sortlines, sort): Accept, return, and use size_t for sizes, not int.
382 (fillbuf, initlines, findlines, checkfp, sort): Check for overflow
383 when computing buffer sizes.
385 (begfield, limfield): Do not index past end of array.
387 (checkfp): Return a boolean, not a line number, as the line
388 number may not fit in int. All callers changed. Use
389 uintmax_t for line numbers, not int.
391 (sort): Don't allocate tmp until we need it (and know the right size).
393 (parse_field_count): New function.
395 (main): Use it to check for overflow in field counts.
396 "outfile" is now a pointer to const.
398 2000-11-27 Jim Meyering <meyering@lucent.com>
400 * src/checksum.h: Don't include system.h here.
401 * src/md5.c: Include config.h, stdio.h, sys/types.h. and system.h here
403 * src/sha1sum.c: Likewise.
405 2000-11-18 Paul Eggert <eggert@twinsun.com>
407 * src/pr.c (main): Do not assume EOF == -1.
408 Handle the case correctly when digits options immediately precede a
411 2000-11-18 Jim Meyering <meyering@lucent.com>
413 * doc/textutils.texi: Change GNU to @sc{gnu} in many places.
414 Update to use the Free Documentation Licence.
416 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
417 very latest version (in CVS) of autoconf.
419 2000-11-17 Jim Meyering <meyering@lucent.com>
421 * GNUmakefile (.NOTPARALLEL): New target. Prevent unwanted parallelism.
422 Suggestion from Ulrich Drepper.
424 2000-11-16 John David Anglin <dave@hiauly1.hia.nrc.ca>
426 * tsort.c: Include sys/types.h before system.h.
428 2000-11-16 Jim Meyering <meyering@lucent.com>
430 * src/join.c: Declare global `tab' to be of type *unsigned* char,
431 so join works with 8-bit delimiter characters.
432 Reported by Antonio Rendas.
433 * tests/join/Test.pm (8-bit-t): New test for the above fix.
435 2000-11-13 Paul Eggert <eggert@twinsun.com>
437 * src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
438 be tested with #ifdef, not with #if.
440 2000-11-11 Jim Meyering <meyering@lucent.com>
442 * doc/textutils.texi: More minor rewording and grammar correction.
445 2000-11-06 Paul Eggert <eggert@twinsun.com>
447 * src/od.c (skip): st_size is not defined for directories.
449 2000-11-03 Jim Meyering <meyering@lucent.com>
451 * tests/sha1sum/sample-vec: New file, with tests derived from
452 http://csrc.nist.gov/cryptval/shs/sha1-vectors.zip
453 * tests/sha1sum/Makefile.am (TESTS): Add sample-vec.
455 2000-10-30 Jim Meyering <meyering@lucent.com>
457 * configure, config.h.in, Makefile.in, etc.: Regenerate using the
458 very latest version (in CVS) of autoconf.
460 * src/wc.c: Include "system.h" after wctype.h (not before)
461 to avoid a compilation error on Solaris 5.5.1 systems.
462 Reported by Vin Shelton.
464 2000-10-23 Jim Meyering <meyering@lucent.com>
466 * Makefile.maint: Clean up version-related variables.
470 * Makefile.am (EXTRA_DIST): Add .prev-version.
472 2000-10-22 Jim Meyering <meyering@lucent.com>
474 * tests/Makefile.am (SUBDIRS): Add sha1sum.
475 * tests/sha1sum/basic-1: New file.
476 * configure.in (AC_OUTPUT): Add tests/sha1sum/Makefile.
478 * src/Makefile.am (bin_PROGRAMS): Add sha1sum.
479 (md5sum_SOURCES): Define.
480 (sha1sum_SOURCES): Define.
481 (noinst_HEADERS): Add checksum.h.
483 * src/md5sum.c: Factor out the differences between MD5 and SHA1,
484 and parameterize so this code may be used by both md5sum and the new
485 program, sha1sum. Loosely based on a patch from Scott Miller.
486 * src/checksum.h: New file.
487 * src/md5.c: New file that simply defines `algorithm'.
488 * src/sha1sum.c: Likewise.
490 * man/Makefile.am (man_MANS): Add sha1sum.1.
491 * man/sha1sum.x: New file.
493 Support 8-byte integers, assuming they're printable with e.g., %lld.
494 * src/od.c: Add support for printing data as unsigned
497 2000-10-21 Jim Meyering <meyering@lucent.com>
499 The command, `yes ''|./cat -n' would stop printing after INT_MAX lines.
500 * src/cat.c (cat): Never let `newlines' exceed 3.
502 2000-10-21 Jim Meyering <meyering@lucent.com>
504 Prevent a counter buffer overrun when numbering lines and when
505 processing 100 billion lines (or more) of input.
506 * src/cat.c (LINE_COUNTER_BUF_LEN): Define to allow numbering as
507 many as 10^18 - 1 lines (the old limit was 10^11 - 1, and could
508 be exceeded without too much trouble). Use this symbol rather
509 than hard-coding the constant everywhere.
510 (next_line_num): Rather than overrunning for input with more lines,
511 mark the line number by putting a `>' in the leftmost slot.
512 Patch by Jan Nieuwenhuizen.
514 * src/sort.c (SORT_OUT_OF_ORDER): Define.
515 (main): Use it instead of hard-coding the `1'.
517 2000-10-10 Jim Meyering <meyering@lucent.com>
519 * src/sort.c (main): Use EXIT_SUCCESS rather than 0.
520 Fail when checking (-c) with more than one file argument,
521 rather than simply ignoring the extra arguments.
523 2000-09-07 Jim Meyering <meyering@lucent.com>
525 * src/cut.c: Remove obsolete comment block.
526 (usage): Note that when using -f, lines with no delimiters are
528 * doc/textutils.texi (cut invocation): Likewise.
530 2000-08-23 Jim Meyering <meyering@lucent.com>
532 * src/md5sum.c: Include <config.h> unconditionally, to be consistent
533 with all the other programs in this directory.
534 * src/tsort.c: Likewise.
536 2000-08-19 Jim Meyering <meyering@lucent.com>
538 * src/comm.c (writeline): Correct comments. From Bruno Haible.
540 2000-08-11 Paul Eggert <eggert@twinsun.com>
542 * doc/textutils.texi:
544 Portable shell scripts should specify global options before
547 Move global LC_CTYPE remark to each sort option that depends
550 sort -g depends on LC_NUMERIC.
552 Add @vindex where it's missing.
554 "radix character" -> "decimal-point character", to match Standard C
555 terminology, which is easier for most people to follow.
557 "comm" does not consider trailing newlines to be significant.
559 2000-08-10 Paul Eggert <eggert@twinsun.com>
561 * doc/textutils.texi: Recommend against the System V syntax
562 for tr ranges, and don't use it in examples. Use POSIX
563 classes rather than ranges, for portability.
564 * src/tr.c (usage): Don't describe System V syntax, as it
567 * src/sort.c (usage): Describe -d and -i in a locale-independent way.
569 * doc/Makefile.am (constants.texi): Use the C locale so that
570 [A-Z] works as expected.
572 2000-08-07 Paul Eggert <eggert@twinsun.com>
574 * src/cut.c (cut_fields): Invoke xalloc_die instead of printing
576 (cut_fields): Check for I/O error as well as end-of-file
578 2000-08-06 Bruno Haible <haible@clisp.cons.org>
580 * src/wc.c: Add support for multi-byte locales.
581 (iswprint, mbrtowc, wcwidth): Provide default definitions.
582 (total_bytes): New variable.
583 (print_bytes): New variable.
584 (longopts): Change abbreviation for --chars from 'c' to 'm'.
586 (write_counts): Add `bytes' argument.
587 (wc): New variables `bytes', `count_bytes', `count_chars',
588 `count_complicated'. The old code determines `bytes', not `chars'.
589 New case for MB_CUR_MAX > 1. A non-printable non-space character does
590 not increment the line position or start a word. Update `total_bytes'.
591 (main): Initialize `print_bytes' and `total_bytes' to 0. Accept 'm'
592 option. Pass `total_bytes' to write_counts.
593 * doc/textutils.texi (wc invocation): Update accordingly.
595 2000-08-06 Bruno Haible <haible@clisp.cons.org>
597 * src/head.c (head): Call write_header here.
598 (head_file): ... not here.
600 * src/cat.c (closeout_func): Remove variable.
601 (close_stdout_wrapper): Remove unused function.
602 (main): Remove assignment to closeout_func.
604 * src/fold.c (fold_file): Remove ferror(stdout) check, already done
607 2000-08-06 Paul Eggert <eggert@twinsun.com>
609 * src/sort.c (usage): Warn more succinctly about the effects of
610 the locale on sort order.
612 2000-08-06 Jim Meyering <meyering@lucent.com>
616 * src/tail.c (pipe_lines): Declare local `cp' to be const.
618 2000-08-04 Greg McGary <greg@mcgary.org>
620 * src/tail.c (pipe_lines): Add variable `nbytes' so we can free
621 `tmp' immediately after read loop. Don't process an empty file.
622 [This fixes a buffer-underrun error -- detected thanks to
623 bounded pointers -jmm]
625 2000-08-05 Jim Meyering <meyering@lucent.com>
627 Fix buffer-overrun error.
628 * src/pr.c (init_header): Allocated buffer was sometimes too small.
629 Reported by Greg McGary (who found this bug using his
630 bounded-pointers-enabled gcc).
631 (init_header): Move declarations of several variables into the
632 inner scope where they are used.
633 * tests/pr/Test.pm (narrow-1): New test, for the above.
635 * src/csplit.c (MAX): Remove definition (It's in sys2.h).
637 2000-08-04 Jim Meyering <meyering@lucent.com>
639 * src/sort.c (main): Rename local `t' to `tmp_dir' to avoid shadowing
640 a previous local by that name.
641 (usage): Warn that GNU sort is now locale-aware, and suggest
642 people put LC_ALL=POSIX in their environment.
644 * src/pr.c (store_columns): Remove conjunct that would dereference
645 an out-of-bounds pointer. Reported by Greg McGary (who found this
646 bug using his bounded-pointers-enabled gcc).
648 2000-08-03 Jim Meyering <meyering@lucent.com>
650 * tests/Makefile.am.in ($(srcdir)/$x-tests): Use -I$(srcdir), not `-I.'.
651 (Makefile.am): Likewise. Reported by Greg McGary.
653 2000-08-01 Jim Meyering <meyering@lucent.com>
655 * doc/textutils.texi (tr invocation): Note that ranges are not portable.
656 Update examples not to use ranges.
658 2000-07-31 Jim Meyering <meyering@lucent.com>
660 * src/cut.c (cut_fields): Use `virtual memory exhausted',
661 not `Memory exhausted'.
663 2000-07-30 Jim Meyering <meyering@lucent.com>
665 * src/help-version: Remove file. Move it to ...
666 * tests/help-version: ...here
667 * tests/Makefile.am (TESTS): Set to help-version.
668 (TESTS_ENVIRONMENT): Define.
669 (EXTRA_DIST): Add $(TESTS).
670 * src/Makefile.am (EXTRA_DIST): Remove help-version.
671 (TESTS): Remove definition.
672 (TESTS_ENVIRONMENT): Remove definition.
674 2000-07-28 Paul Eggert <eggert@twinsun.com>
676 sort's -T option can now appear multiple times.
677 Thanks to Charles Randall for suggesting this idea.
679 * doc/textutils.texi, NEWS: Document this.
681 * src/sort.c (temp_dir): Remove.
682 (temp_dirs, temp_dir_count, temp_dir_alloc): New vars.
683 (process_id): New var.
684 (usage): Describe new use of -T.
685 (add_temp_dir): New function.
686 (tempname): Use new temp_dirs array.
687 Do not discard information from the process-id or sequence
688 number, unless we have short file names.
689 (sighandle): Use process_id instead of getpid.
690 (main): Initialize process_id.
691 Add support for the new use of -T.
693 2000-07-23 Jim Meyering <meyering@lucent.com>
695 * tests/head/Test.pm: Rename tests (and hence files) to have a short
696 enough prefix so that they're not truncated on 8+3 file systems.
697 Reported by Eli Zaretskii.
699 2000-07-09 Jim Meyering <meyering@lucent.com>
701 * config.guess: Update from FSF.
702 * config.sub: Likewise.
704 2000-07-02 Jim Meyering <meyering@lucent.com>
708 2000-07-01 Jim Meyering <meyering@lucent.com>
710 * src/cut.c: Change type of global, field_1_bufsize, from int to size_t.
712 2000-06-29 Jim Meyering <meyering@lucent.com>
714 * src/tr.c (find_bracketed_repeat): Add a cast to suppress a warning.
715 Reported by Gerhard Poul.
717 * src/tail.c (enum): Remove comma from end of enumerator list.
720 2000-06-25 Jim Meyering <meyering@lucent.com>
722 * configure.in (ALL_LINGUAS): Add Danish (da).
724 2000-06-24 Jim Meyering <meyering@lucent.com>
726 * doc/textutils.texi: Lots of minor rewording and grammar correction.
729 * tests/sum/basic-1: New file.
730 * tests/sum/Makefile.am: New file.
731 * configure.in (AC_OUTPUT): Add tests/md5sum/Makefile.
732 * tests/Makefile.am (SUBDIRS): Add sum.
734 2000-06-22 Bruno Haible <haible@clisp.cons.org>
736 * src/sum.c (sysv_sum_file): Avoid overflowing 32-bit accumulator
737 on files larger than 256 MB.
739 2000-06-22 Bruno Haible <haible@clisp.cons.org>
741 * src/cat.c (main): Correct a comment.
743 2000-06-21 Jim Meyering <meyering@lucent.com>
745 * src/cut.c (getstr): Remove private (and out of date) version of
747 (cut_fields): Adjust caller to use the just-extended one in ../lib.
748 Reported by Paul Sauer.
750 2000-06-20 Jim Meyering <meyering@lucent.com>
752 * src/uniq.c (main): Fix off-by-argc test, so +N-style options are
753 recognized once again. Reported by Geoff Keunning.
754 Fix typo in diagnostic: s/compare/skip/.
756 2000-05-27 Jim Meyering <meyering@lucent.com>
758 * src/tail.c: Arrange to call close_stdout upon exit.
759 Don't close stdout explicitly.
760 (usage): Add missing backslash at end of line.
761 (write_header): Remove now-unused COMMENT parameter.
764 2000-05-24 Jim Meyering <meyering@lucent.com>
766 * src/head.c (head_file): Use STDIN_FILENO in place of `0'.
769 2000-05-20 Jim Meyering <meyering@lucent.com>
771 * src/cat.c: Arrange to call close_stdout upon exit.
772 Don't close stdout explicitly. Replace uses of global constant,
773 output_desc, with uses of STDOUT_FILENO.
775 Arrange to call close_stdout upon exit. Don't close stdout explicitly.
776 * src/cksum.c: Likewise.
777 * src/comm.c: Likewise.
778 * src/csplit.c: Likewise.
779 * src/cut.c: Likewise.
780 * src/expand.c: Likewise.
781 * src/fmt.c: Likewise.
782 * src/fold.c: Likewise.
783 * src/head.c: Likewise.
784 * src/join.c: Likewise.
785 * src/md5sum.c: Likewise.
786 * src/nl.c: Likewise.
787 * src/od.c: Likewise.
788 * src/paste.c: Likewise.
789 * src/pr.c: Likewise.
790 * src/ptx.c: Likewise.
791 * src/sort.c: Likewise. (but set exit status and file name, too)
792 * src/split.c: Likewise.
793 * src/sum.c: Likewise.
794 * src/tac.c: Likewise.
795 * src/tr.c: Likewise.
796 * src/tsort.c: Likewise.
797 * src/unexpand.c: Likewise.
798 * src/uniq.c: Likewise.
799 * src/wc.c:: Likewise.
801 2000-05-13 Jim Meyering <meyering@lucent.com>
803 * src/help-version: Run each program successfully at least once.
805 2000-05-12 Jim Meyering <meyering@lucent.com>
807 * src/head.c (string_to_integer): Restrict base to 10.
808 Reported by Joseph S. Myers.
809 * tests/head/Test.pm: Add a few tests for this.
811 New option: --first-only
812 * src/unexpand.c (anonymous enum) [CONVERT_FIRST_ONLY_OPTION]: Define.
813 (long_options): Add `first-only'.
814 (main): Handle new option.
816 2000-05-11 Jim Meyering <meyering@lucent.com>
818 * tests/unexpand/basic-1: New tests.
820 2000-04-17 Bruno Haible <haible@clisp.cons.org>
822 * src/system.h [__BEOS__]: Ignore O_BINARY and O_TEXT.
824 2000-04-16 Jim Meyering <meyering@lucent.com>
826 * src/tail.c: Prepare to remove option: --max-consecutive-size-changes.
828 (usage): Remove description.
829 * doc/textutils.texi (tail invocation): Remove description.
831 2000-04-12 Jim Meyering <meyering@lucent.com>
833 * src/tail.c (usage): Tweak --help output. Suggestions from Karl Berry.
835 Move some macros into m4/.
836 * configure.in (_GNU_SOURCE): Don't define here.
837 (AC_SYS_LARGEFILE): Don't use here.
838 (AM_C_PROTOTYPES): Don't use here.
839 * acconfig.h: Remove now-unused file.
841 2000-04-09 Jim Meyering <meyering@lucent.com>
843 * doc/textutils.texi: Include constants.texi.
844 (tail invocation): Use `@value's instead of referring to the
845 output of `tail --help' for defaults.
846 * doc/Makefile.am (constants.texi): New rule.
847 (EXTRA_DIST): Add constants.texi.
848 (MAINTAINERCLEANFILES): Add it here, too.
849 (textutils.dvi, textutils.info): Depend on constants.texi.
851 * src/tail.c (usage): Clarify descriptions of the --max-* options.
854 2000-04-03 Jim Meyering <meyering@lucent.com>
856 * configure.in (AC_CHECK_HEADERS): Remove langinfo.h. Now it's in m4/.
857 (AC_CHECK_FUNCS): Remove nl_langinfo. Now it's in m4/.
859 2000-03-17 Jim Meyering <meyering@lucent.com>
861 * configure.in (ALL_LINGUAS): Add Slovenian (sl).
863 2000-03-12 Jim Meyering <meyering@lucent.com>
865 Merge from fileutils.
866 * src/system.h "pathmax.h": Include.
867 <sys/time.h>: Include if appropriate.
869 <sys/mkdev.h>: Likewise.
870 <sys/sysmacros.h>: Likewise.
872 (major, minor, makedev): Define if needed.
873 (struct utimbuf): Declare if missing.
874 (ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE): Define.
876 * src/cksum.c (usage): Correct --help output.
877 Prompted by a report from Gregory Leblanc.
879 2000-03-05 Paul Eggert <eggert@twinsun.com>
881 * src/sort.c (struct buffer.newline_free): New member.
882 (initbuf, findlines): Set it.
883 (fillbuf): Do not double the size of a full buffer to append a newline
884 unless the buffer is known to be newline free.
886 2000-03-05 Jim Meyering <meyering@lucent.com>
890 2000-03-04 Jim Meyering <meyering@lucent.com>
892 Don't get failed assertion for `tail -f directory'.
893 * src/tail.c: Revert most of 1999-10-20 change. Instead, ...
894 (IS_TAILABLE_FILE_TYPE): Define to produce similar result.
895 (recheck): Use it here.
896 (tail_file): Use it here.
897 Reported by François Pinard.
899 Once we encounter a file that is not of IS_TAILABLE_FILE_TYPE,
900 marke it as such and ignore it forever after.
901 * src/tail.c (struct File_spec): New member.
902 (recheck): Initialize new member.
903 (tail_file): Likewise.
904 (tail_forever): Skip the file if it's marked as ignorable.
906 2000-03-03 Jim Meyering <meyering@lucent.com>
908 * src/sort.c (fillbuf): Move declaration of local, cc, into scope of
909 `while' loop where it's used.
911 2000-03-02 Paul Eggert <eggert@set.twinsun.com>
913 Big performance improvement when sorting many small files,
914 building on a suggestion by Charles Randall.
916 * src/sort.c (fillbuf): Skip memmove if it would be a no-op,
917 as many memmove implementations are slow in that case.
918 Don't examine leftover bytes for eolchar, since they may be left
919 over from a previous file, and we want to read from this file.
921 (sort): At end of file, if there is more input and buffer room,
922 concatenate the next input file.
924 2000-02-29 Jim Meyering <meyering@lucent.com>
926 * src/join.c (make_blank): Add an explicit cast to `unsigned char *'
927 to placate HPUX's C compiler. Reported by Bob Proulx.
929 2000-01-30 Jim Meyering <meyering@lucent.com>
933 * Makefile.maint (my-distcheck): Depend on po-check, so I'll be warned
934 about any required changes at `make distcheck' time rather than at
936 (writable-files): New target.
937 (my-distcheck): Depend on it.
940 * po/POTFILES.in: Add these: lib/makepath.c, lib/rpmatch.c,
943 2000-01-29 Jim Meyering <meyering@lucent.com>
945 * configure.in: Remove lib-check for cposix now that we use
947 (jm_LIB_CHECK): Use this even though the library checks aren't
948 required for this patchage (so all three lib/Makefile.in files
951 2000-01-24 Mark Kettenis <kettenis@gnu.org>
953 * src/tsort.c (exit_status): New variable.
954 (loop): New varibale.
955 (count_items, scan_zeroes): Change return type to int.
956 (detect_loop): Complete rewrite to correctly implement detection
957 of loops. Also change return type to int.
958 (recurse_tree): Stop if ACTION returns non-zero. This involves
959 changing the return type of this function and ACTION to int.
960 (walk_tree): Change return type of ACTION to int.
961 (tsort): Continue sort after a loop has been detected (and
962 broken). Set exit_status to 1 if a loop was detected.
963 (main): Use exit_status to determine exit code.
964 * tests/tsort/basic-1: Change expected output for cycle-1 and
967 2000-01-23 Jim Meyering <meyering@lucent.com>
969 * configure.in (AM_FUNC_STRTOD): Move to m4/.
970 (AC_SUBST(POW_LIBM)): Likewise.
972 2000-01-22 Jim Meyering <meyering@lucent.com>
974 * src/sort.c (keycompare): Use global, hard_LC_COLLATE in place of
975 local that is sometimes undeclared.
977 * configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
978 (AC_CHECK_HEADERS): Move these checks into m4/.
980 * src/tr.c ("xstrtol.h"): Include.
981 (Filter): Rename from PFL.
982 (non_neg_strtol): Remove function.
983 (find_bracketed_repeat): Use xstrtoul instead of non_neg_strtol.
984 (squeeze_filter, set_initialize, main): Use size_t and ssize_t in
985 place of long and int in several decls.
986 (read_and_delete, read_and_xlate): Likewise, and remove assertion.
987 * tests/tr/Test.pm: (o-rep-1, o-rep-2): New tests.
989 * src/cut.c: Correct copying notice to use GPL, per author's request.
990 * src/paste.c: Likewise.
993 1999-09-19 Bruno Haible <haible@clisp.cons.org>
995 * src/tr.c (PFI): Return `long', not `int'.
996 (PFL): Rename from PFI now that it returns long.
997 (squeeze_filter): Declare as `long': i, nr, out_len.
999 2000-01-17 Paul Eggert <eggert@twinsun.com>
1001 Tweak sort performance.
1003 * src/sort.c (hard_LC_CTYPE): Remove.
1004 (keylist): Renamed from keyhead. Now a pointer, not a
1005 mostly-unused struct. All uses changed.
1006 (findlines, keycompare, CMP_WITH_IGNORE, compare, checkfp, mergefps,
1007 sort): Tune and use a more consistent style for reallocation.
1008 (keycompare, main): Don't worry about LC_CTYPE;
1009 it's buggy with multibyte chars anyway.
1010 (compare): Invoke alloca (0) after each call to keycompare,
1011 not just the ones that return nonzero. This avoids a memory
1012 leak on architectures without builtin alloca that occurs
1013 sometimes when a file contains all duplicate lines.
1015 2000-01-17 Paul Eggert <eggert@twinsun.com>
1017 * src/csplit.c (interrupt_handler, main):
1018 Don't use SA_INTERRUPT to decide whether to call sigaction, as
1019 POSIX.1 doesn't require SA_INTERRUPT and some systems
1020 (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
1021 it's been part of POSIX.1 since day 1 (in 1988).
1022 * src/sort.c (sighandler, main): Likewise.
1024 2000-01-16 Jim Meyering <meyering@lucent.com>
1026 * lib/Makefile.am: Merge with fileutils/lib/Makefile.am.
1028 * configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_STRFTIME,
1029 AC_FUNC_VPRINTF, and AC_FUNC_ALLOCA. Now they're in m4/.
1031 2000-01-15 Jim Meyering <meyering@lucent.com>
1033 * configure.in (AC_REPLACE_FUNCS): Remove these: memcpy memset stpcpy
1034 strpbrk strtol strtoul. Now that's in m4/.
1036 unexpand could infloop
1037 * src/unexpand.c (TAB_STOP_SENTINEL): Define.
1038 (unexpand): Use it instead of INT_MAX.
1039 Declare column and pending to be `unsigned'.
1040 Increment pending and column counters only if column is smaller
1041 than TAB_STOP_SENTINEL.
1042 * tests/Makefile.am (SUBDIRS): Add unexpand.
1043 * tests/unexpand/basic-1: New tests for the above-fixed bug.
1044 * configure.in (AC_OUTPUT): Add tests/unexpand/Makefile.
1045 Reported by John Kodis.
1047 2000-01-12 Paul Eggert <eggert@twinsun.com>
1049 * src/sort.c (fillbuf): Avoid quadratic behavior with long lines.
1050 Also, stop worrying about ancient memchr bug (misbehavior when
1051 size is zero), since other code doesn't worry either.
1053 2000-01-11 Jim Meyering <meyering@lucent.com>
1055 Sync lib/ directories of sh-utils, and textutils.
1057 * lib/Makefile.am (libfetish_a_SOURCES): Add getdate.y, posixtm.c,
1058 basename.c, canon-host.c, readutmp.c, stripslash.c, xgetcwd.c,
1060 (noinst_HEADERS): Add getdate.h, group-member.h, posixtm.h,
1061 pathmax.h, readutmp.h
1063 * lib/Makefile.am: s/tu/fetish/
1064 * src/Makefile.am: s/libtu/libfetish/
1066 2000-01-10 Jim Meyering <meyering@lucent.com>
1070 * Makefile.maint (announcement): Include URLs for xdelta files.
1071 (alpha): Use scp, not ncftp.
1073 * lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
1075 2000-01-08 Jim Meyering <meyering@ascend.com>
1080 * src/cut.c (OUTPUT_DELIMITER_OPTION): Define this and use it
1081 instead of `CHAR_MAX + n'.
1082 * src/pr.c (PAGES_OPTION, COLUMNS_OPTION): Likewise.
1084 2000-01-07 Jim Meyering <meyering@ascend.com>
1086 * tests/tsort/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix
1087 to exported PATH value (though not strictly necessary, here).
1088 * tests/md5sum/Makefile.am: Likewise.
1091 * lib/memcasecmp.c: Use `#if' instead of `#ifdef' for `HAVE_CONFIG_H'.
1092 Capitalize all macro parameters.
1093 (memcasecmp): Ansideclify.
1094 Don't cast away `const'ness of parameters.
1095 * lib/strpbrk.c (strpbrk): Ansideclify.
1096 Use `#if' instead of `#ifdef' for `HAVE_CONFIG_H'.
1097 Suggestions from François Pinard.
1099 2000-01-06 Jim Meyering <meyering@ascend.com>
1101 * tests/tail-2/assert: Tell the user just before sleeping for 7 seconds.
1103 * tests/tail-2/Makefile.am (TESTS): Remove fflush test. It didn't
1104 test the losing behavior, and left a stray tail process to boot.
1106 2000-01-01 Jim Meyering <meyering@ascend.com>
1110 * lib/Makefile.am (lstat.c): Adapt rule to handle new parts of xstat.in.
1112 1999-12-12 Jim Meyering <meyering@ascend.com>
1114 Move 120+ lines of stat.h-related macros from system.h (not shared)
1115 to sys2.h, which is shared between fileutils, sh-utils, textutils.
1116 * src/system.h: Move them from here...
1117 * src/sys2.h: ... to here.
1119 1999-12-09 Jim Meyering <meyering@ascend.com>
1121 * configure.in (ALL_LINGUAS): Add Galician (gl).
1123 1999-12-06 Jim Meyering <meyering@ascend.com>
1125 * tests/tail-2/fflush: New test for latest change.
1126 * tests/tail-2/Makefile.am (TESTS): Add fflush.
1128 1999-10-26 Marc Boucher <marc@mbsi.ca>
1130 * src/tail.c (main): Flush stdout before switching to unbuffered mode
1131 and calling tail_forever. Required only on Solaris2.7 -- on other
1132 systems, using setvbuf to switch to unbufferd mode does the flush.
1134 1999-11-22 Jim Meyering <meyering@ascend.com>
1136 * lib/Makefile.am (DISTCLEANFILES): Put $(BUILT_SOURCES) here rather
1137 than in $(MAINTAINERCLEANFILES).
1139 * src/tail.c (recheck): Handle a race condition (including <dev,inode>
1140 reuse) that would lead to a failed assertion.
1141 Reported by Ken Pizzini.
1142 (tail_forever): Record errno before using it in call to `error'
1143 which might change it.
1144 (tail_file): Likewise.
1146 New test for the above.
1147 * tests/tail-2/assert: New file.
1148 * tests/tail-2/Makefile.am: New file.
1149 * tests/tail-2: New directory.
1150 * tests/Makefile.am (SUBDIRS): Add tail-2.
1151 * configure.in (AC_OUTPUT): Add tests/tail-2/Makefile.
1153 1999-11-05 Jim Meyering <meyering@ascend.com>
1155 * src/system.h: Use HAVE_STRUCT_STAT_ST_BLKSIZE not HAVE_ST_BLKSIZE.
1157 * configure.in: Move some type/header/member tests into
1158 m4/jm-macros.m4 (jm_CHECK_ALL_TYPES) so they are shared by all of
1159 fileutils, textutils, and sh-utils.
1161 1999-11-04 Paul Eggert <eggert@twinsun.com>
1163 * src/sort.c (SORTALLOC): New macro.
1164 (sortalloc, mergealloc, LINEALLOC): Use it.
1165 (sortalloc, mergealloc, linelength): Now const.
1166 (sortalloc): Increase from 0.5 to 8 MB.
1167 (mergealloc): Increase from 16 to 256 kB.
1168 (LINEALLOC): Increase from 0.25 to 4 MB.
1170 1999-11-03 Paul Eggert <eggert@twinsun.com>
1172 * NEWS, doc/textutils.texi:
1173 Do not consider newline to be part of a line when comparing lines
1174 in `sort' and `comm'. POSIX.2 requires that we consider newline,
1175 but this is a bug in the spec and the bug will likely be fixed.
1176 * src/comm.c (compare_files): Likewise.
1177 * src/sort.c (begfield, limfield, findlines, keycompare, compare):
1179 * tests/sort/Test.pm: Update tests `use-nl' and `11d' to reflect
1182 * lib/linebuffer.c (readline): Do not leave room for an extra
1183 byte after the newline; it's no longer needed.
1184 * src/sort.c: (sortalloc, mergealloc, fillbuf, checkfp, mergefps):
1187 * lib/memcoll.c (memcoll): The two arguments cannot be
1188 adjacent any more, so remove the alloca/copy workaround for
1191 1999-11-03 Jim Meyering <meyering@ascend.com>
1193 Fix so that `tail -fn 2 file' works again.
1194 * src/tail.c (anonymous enum) [LONG_FOLLOW_OPTION]: Define.
1195 (long_options): Use LONG_FOLLOW_OPTION here, instead of 'f'.
1196 (main): Remove the `::' after the `f' in getopt_long string.
1197 Add `case LONG_FOLLOW_OPTION' after `case 'f':'.
1198 Based on a patch from Tim Waugh.
1200 * src/tail.c (anonymous enum) [RETRY_OPTION]: Define.
1201 [MAX_UNCHANGED_STATS_OPTION]: Likewise.
1202 [MAX_CONSECUTIVE_SIZE_CHANGES_OPTION]: Likewise.
1203 [PID_OPTION]: Likewise.
1204 (long_options): Use *_OPTION instead of CHAR_MAX + N.
1207 1999-11-02 Jim Meyering <meyering@ascend.com>
1209 * man/help2man: Import version 1.018.
1210 * man/Makefile.maint ($(man_MANS)): Remove use of --name=... option.
1211 * man/*.x: Include one-line summary in [NAME] section.
1212 * man/Makefile.summ (cat-summary): Remove now-unused file.
1213 * man/Makefile.am (EXTRA_DIST): Remove Makefile.summ.
1214 * man/Makefile.maint: Include Makefile.summ with leading `-'.
1215 This file is shared by fileutils and sh-utils, both of which still
1216 have the file (albeit nearly empty now).
1217 Suggestion for clean-up from Akim Demaille.
1219 1999-11-01 Jim Meyering <meyering@ascend.com>
1221 * lib/Makefile.am (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
1223 1999-10-20 Jim Meyering <meyering@ascend.com>
1225 * src/tail.c (recheck): Don't refuse to tail a non-regular, non-pipe.
1226 (tail_file): Likewise.
1228 1999-10-07 Jim Meyering <meyering@ascend.com>
1230 * configure.in (ALL_LINGUAS): Add Japanese (ja).
1232 1999-10-04 Jim Meyering <meyering@ascend.com>
1234 * depcomp: New file, for automake's new dependency support.
1235 * missing: New version, from automake's user-dep-gen-branch.
1237 1999-09-28 Jim Meyering <meyering@ascend.com>
1239 * src/system.h: Update from the system.h from fileutils.
1241 * lib/error.c (error_at_line): Use strerror portably here, too,
1242 just as was done in error.
1244 1999-09-02 Jim Meyering <meyering@ascend.com>
1246 * src/cut.c: Remove xstrdup declaration.
1247 * src/sort.c: Likewise.
1248 * src/tsort.c: Likewise.
1250 1999-08-22 Jim Meyering <meyering@ascend.com>
1252 * src/tsort.c (detect_loop): There's no loop if k->top is NULL.
1253 Niklas Edmundsson showed how to make tsort segfault.
1255 * tests/tsort/Makefile.am: Rewrite to use Fetish.pm-based framework.
1256 * tests/tsort/basic-1: New file.
1257 Add a few more tests.
1258 * tests/tsort/Test.pm: Remove.
1260 * man/help2man: Escape backslashes so tr's manual comes out right.
1261 Reported by Andreas Schwab.
1263 * src/tsort.c (usage): Correct address for bug reports.
1264 (tsort): Remove trailing `\n' in error format.
1266 * src/md5sum.c (md5_check): Remove trailing `\n' in error format.
1268 * src/sys2.h (IF_LINT): Define new macro.
1269 * src/od.c (dump): Use IF_LINT macro instead of #ifdef lint...
1271 * src/paste.c (paste_parallel): Likewise.
1272 * src/pr.c (read_line): Likewise.
1273 * src/sort.c (checkfp): Likewise.
1274 (mergefps): Likewise.
1276 * src/cksum.c (cksum): Constify a char*.
1277 * src/comm.c (writeline): Likewise.
1279 * src/uniq.c (check_file): Move declarations of local variables
1280 into the scopes where they're used.
1281 (min): Remove macro definition.
1282 (different): Use MIN, not min.
1283 (SWAP_LINES): New macro.
1284 (check_file): Use it here.
1286 * src/uniq.c (check_file): Generate each line of output earlier,
1287 when possible. It is possible when using none of these options:
1288 --count, -repeated, --all-repeated, --unique.
1289 Based on a patch from Ian Turner.
1291 1999-08-15 Jim Meyering <meyering@ascend.com>
1293 * src/tail.c (ENOSYS): Define to a bogus value if not already defined.
1295 1999-08-13 Eli Zaretskii <eliz@is.elta.co.il>
1297 * src/tail.c (parse_options): Warn if --pid=PID is used and kill()
1298 returns ENOSYS (e.g. when compiled with DJGPP).
1300 1999-08-13 Jim Meyering <meyering@ascend.com>
1302 * src/tsort.c (usage): Use consistent bug-reporting address.
1304 * tests/tsort/Test.pm: New file.
1305 * tests/tsort/Makefile.am: New file.
1306 * tests/tsort: New directory.
1307 * tests/Makefile.am (SUBDIRS): Add tsort.
1308 * configure.in (AC_OUTPUT): Add tests/tsort/Makefile.
1310 1999-08-11 Paul Eggert <eggert@twinsun.com>
1312 * doc/textutils.texi: Document how to ignore newline during sort.
1314 1999-08-07 Jim Meyering <meyering@ascend.com>
1316 * po/POTFILES.in: Add lots of lib/*.c files. Remove src/system.h.
1318 1999-08-06 Jim Meyering <meyering@ascend.com>
1322 * src/sort.c: Include file name in `write error' diagnostics.
1323 (write_bytes): Add output_file parameter and use it. Update callers.
1324 (mergefps): Likewise.
1327 Reported by John Summerfield.
1329 1999-08-05 Jim Meyering <meyering@ascend.com>
1331 * src/tail.c (Follow_mode): Remove comma at end of enumerator list.
1332 Reported by Kaveh Ghazi.
1334 * config.sub: Update from autoconf.
1335 * config.guess: Update from autoconf.
1337 1999-08-04 Jim Meyering <meyering@ascend.com>
1341 * configure.in: Remove inadequate getline-testing code. md5sum would
1342 segfault on HPUX because of the getline function in their C library.
1343 Use the AM_FUNC_GETLINE test in m4/ instead.
1345 1999-08-03 Jim Meyering <meyering@ascend.com>
1347 * src/tail.c (tail_forever): When following by name and calling recheck
1348 because of exceeding max_n_consecutive_size_changes_between_opens,
1349 `continue' so we don't fall through and (assuming the file finally grew)
1350 get the erroneous `file truncated' message. This was hard to reproduce.
1352 1999-08-01 Jim Meyering <meyering@ascend.com>
1356 * configure.in (AM_C_PROTOTYPES): Move test to precede a few
1357 header tests -- merely on principle.
1359 1999-08-01 Paul Eggert <eggert@twinsun.com>
1361 * configure.in (AC_SYS_LARGEFILE): Renamed from AC_LFS.
1363 1999-07-16 Paul Eggert <eggert@twinsun.com>
1365 * lib/quotearg.c (quotearg_buffer):
1366 Don't quote spaces if C quoting style.
1368 1999-07-31 Jim Meyering <meyering@ascend.com>
1370 * src/tail.c (tail_forever): Don't call kill if pid is 0.
1371 Detect when `writer_is_dead' also when the writer is some other user.
1374 * src/tail.c (parse_options): Warn if --pid=PID is used without -f.
1376 1999-07-30 Jim Meyering <meyering@ascend.com>
1380 * src/tail.c: New option: --pid=PID.
1381 Include signal.h for kill prototype.
1383 (long_options): Add `pid'.
1384 (usage): Describe it.
1385 (tail_forever): Implement it.
1386 (parse_options): Handle the new option and required arg.
1387 Suggestion and pseudo-code from Karl Heuer.
1389 1999-07-27 Jim Meyering <meyering@ascend.com>
1391 * lib/linebuffer.c: Include <sys/types.h> now that linebuffer.h uses
1392 size_t. This is required on at least SunOS4. From Kaveh Ghazi.
1394 1999-07-26 Jim Meyering <meyering@ascend.com>
1396 * src/sys2.h (PID_T_MAX): Define.
1398 * src/tail.c (struct File_spec) [n_stat_calls]: Remove unused member.
1400 1999-07-25 Jim Meyering <meyering@ascend.com>
1402 * src/pr.c (usage): Remove `NEWS'-style paragraph (sorry to have
1403 let that in, translators).
1407 1999-06-01 Volker Borchert <bt@teknon.de>
1409 * tests/Makefile.am: Make envvar-check depend on check-recursive rather
1410 than on `check' so that its tests are performed before any real tests.
1412 1999-07-20 Jim Meyering <meyering@ascend.com>
1414 * configure.in (AC_REPLACE_FUNCS) Remove memmove, now that it's
1415 AC_REPLACE...'d in m4/jm-macros.m4.
1417 * src/wc.c (posixly_correct): Declare global.
1418 (write_counts): Use it to select printf formats.
1419 (main): Set posixly_correct from the POSIXLY_CORRECT envvar.
1422 1999-07-15 Jim Meyering <meyering@ascend.com>
1424 * tests/md5sum/Makefile.am: Revert the 1999-02-15 change.
1425 * tests/md5sum/basic-1, newine-1: Add --text for each individual test.
1426 Reported by Eli Zaretskii.
1428 1999-07-12 Jim Meyering <meyering@ascend.com>
1430 * configure.in (ALL_LINGUAS): Add Slovak (sk).
1432 1999-07-11 Jim Meyering <meyering@ascend.com>
1434 * src/tail.c (recheck): Use assert instead of unnecessary close_fd.
1435 Remove a couple of unnecessary FIXME comments.
1437 1999-07-10 Jim Meyering <meyering@ascend.com>
1439 * doc/textutils.texi: Document new tail options.
1441 * src/tail.c (struct File_spec) [tailable]: Rename from `missing' and
1442 document. Change all uses and locals like was_missing to was_tailable.
1443 Invert expressions as appropriate.
1444 (reopen_inaccessible_files): Rename from allow_missing.
1445 (sleep_interval): Describe.
1446 (--allow-missing): Deprecate.
1447 (--retry): New option, equivalent to --allow-missing.
1448 (usage): Document name vs. descriptor differences.
1449 Refer to manual for descriptions of --max-unchanged-stats=N
1450 and --max-consecutive-size-changes=N.
1451 (valid_file_spec): New function.
1452 (recheck): Assert valid_file_spec.
1453 Remove dead else-if block (suggestion from Eli Zaretskii).
1454 Adjust stmts that set f->tailable -- unlike for `missing', tailable
1455 doesn't depend on errno == ENOENT.
1456 (parse_options): Give a warning if --retry is used when not following
1459 * tests/join/Test.pm: New test case (but commented out) for
1460 Paul's 1999-06-01 fix.
1462 1999-07-09 Jim Meyering <meyering@ascend.com>
1464 * configure.in (ALL_LINGUAS): Add Greek (el).
1466 1999-07-04 Jim Meyering <meyering@ascend.com>
1468 * tests/join/Test.pm: New test case for Paul's 1999-06-03 fix.
1470 1999-07-03 Eli Zaretskii <eliz@is.elta.co.il>
1472 * src/tail.c (struct File_spec): New member, errnum.
1473 (recheck): Record the new value of errno in f->errnum. Don't
1474 output an error message unless the new value of errno differs from
1475 the old one. Output a message if previously-inaccessible file
1477 (tail_forever): Always recheck files whose fd is negative. If the
1478 file cannot be fstat'ed, record the errno value in f[i].errnum.
1479 (tail_file): If the file cannot be open, record the errno value in
1480 f->errnum. If it can be opened, initialize f->errnum to zero. If
1481 it's a non-regular non-fifo file, initialize f->errnum to -1.
1483 1999-06-21 Jim Meyering <meyering@ascend.com>
1485 * doc/textutils.texi: Use lower case characters in sc{} context.
1486 Reported by Eli Zaretskii.
1488 1999-06-03 Paul Eggert <eggert@shade.twinsun.com>
1490 * src/join.c (xfields): Only <blank>s separate fields, not <space>s.
1492 1999-06-01 Paul Eggert <eggert@twinsun.com>
1494 * lib/linebuffer.c (readline): Leave room for an extra byte
1495 after the newline; comm needs this for memcoll.
1497 1999-06-01 Paul Eggert <eggert@twinsun.com>
1499 Add LC_COLLATE support to `join'.
1501 * doc/textutils.texi: Describe join and LC_COLLATE.
1503 * src/join.c: Add support for LC_COLLATE locale.
1504 Include hard-locale.h, linebuffer.h, memcoll.h.
1505 (struct line): New member `buf', replacing `beg' and `lim'.
1507 (hard_LC_COLLATE): New var.
1508 (main): Initialize it.
1509 (get_line): Use readline to read the line,
1510 instead of doing it by hand.
1511 That way, we get a buffer that we can pass to memcoll.
1512 (keycmp): Use memcoll to compare lines if hard_LC_COLLATE is nonzero.
1514 1999-05-27 Volker Borchert <bt@teknon.de>
1516 * tests/Makefile.am: Qualify .env-warn with $(srcdir)/ prefix.
1518 1999-05-25 Paul Eggert <eggert@twinsun.com>
1520 Add LC_COLLATE support to `comm', so that `comm' is compatible
1521 with `sort' in nontrivial locales.
1523 * doc/textutils.texi: Document locale-specific mode for comm.
1525 * lib/Makefile.am (libtu_a_SOURCES): Add hard-locale.c, memcoll.c.
1526 (noinst_HEADERS): Add hard-locale.h, memcoll.h.
1528 * src/comm.c: Include hard-locale.h, memcoll.h.
1529 (hard_LC_COLLATE): New variable.
1530 (compare_files): Use memcoll to compare if hard_LC_COLLATE.
1531 (main): Initialize hard_LC_COLLATE from locale.
1533 * src/sort.c: Include hard-locale.h, memcoll.h.
1534 (hard_LC_COLLATE, hard_LC_CTYPE, hard_LC_TIME): New variables,
1535 replacing `need_locale'.
1536 (memcoll): Move to lib/memcoll.c.
1537 (keycompare): No need to alloc (0), since our caller now does it.
1538 (compare): alloca (0) before returning.
1539 (my_setlocale): Remove; hard_locale now dows this.
1540 (main): Invoke setlocale, bindtextdomain, and textdomain before
1541 invoking anything that might print an error.
1542 Use hard_locale to determine which locales are hard.
1544 * lib/hard-locale.c, lib/hard-locale.h, lib/memcoll.c, lib/memcoll.h:
1547 1999-05-25 Paul Eggert <eggert@shade.twinsun.com>
1549 * lib/linebuffer.c (readline):
1550 Append trailing newline to line.
1552 [struct linebuffer] (size): Declare to be of type size_t, not long.
1553 [struct linebuffer] (length): Likewise.
1554 * src/comm.c, (writeline): Lines now contain trailing newline.
1555 * src/uniq.c (find_field, different): Use size_t, not int, for lengths.
1556 (writeline): Lines now contain trailing newline.
1557 (check_file): Use size_t, not int, for lengths.
1558 * src/nl.c (proc_text, check_section, main): More of the same.
1560 * lib/linebuffer.h (struct linebuffer): Use size_t for sizes.
1561 src/nl.c (header_del_len, body_del_len, footer_del_len, main):
1563 src/uniq.c (find_field, different, check_file): Likewise.
1565 * lib/linebuffer.c (readline): Silently append trailing
1566 newline if needed. Do not bother setting buffer length to 0
1567 at EOF, since it's not part of the spec and nobody relies on
1568 it. Do not compute the difference between unrelated pointers.
1570 1999-05-25 Paul Eggert <eggert@twinsun.com>
1572 * src/tac.c (memrchr): Ifdef out this unused function.
1574 1999-05-25 Jim Meyering <meyering@ascend.com>
1576 * doc/textutils.texi (Squeezing): Remove misleading square brackets
1577 from SET1 in the one-word-per-line example.
1579 1999-05-22 Jim Meyering <meyering@ascend.com>
1581 * lib/Makefile.am (libtu_a_SOURCES): Remove memchr.c.
1582 From Ulrich Drepper.
1586 1999-05-22 Paul Eggert <eggert@twinsun.com>
1588 * doc/textutils.texi: Document locale-specific changes to `sort',
1589 as well as the new, POSIX-compliant definition of line comparison,
1590 and -g's more careful treatment of NaNs, infinities and zeros.
1592 * src/sort.c (general_numcompare): Put exceptional cases
1593 first, not last, to be consistent with -M.
1595 1999-05-21 Paul Eggert <eggert@twinsun.com>
1597 * src/sort.c (strtod): Declare if STDC_HEADERS is not defined.
1598 (general_numcompare): Use strtod, not xstrtod.
1599 Do not consider partial conversions to be errors.
1600 Put -infinity at the start, and +infinity at the end;
1601 follow +infinity with NaNs (sorted by bit pattern),
1602 and finally by conversion errors.
1604 1999-05-21 Jim Meyering <meyering@ascend.com>
1606 * tests/sort/Test.pm (11d): Reverse lines in expected output
1607 to reflect latest change.
1608 (use-nl): New test from Paul Eggert.
1610 1999-05-20 Paul Eggert <eggert@twinsun.com>
1612 * src/sort.c: Treat the trailing newline as part of the line,
1613 as required by POSIX.2.
1615 (struct line, findlines, compare, checkfp, mergefps, sort):
1616 A line now includes its trailing newline.
1617 (findlines): Do not replace newline with NUL.
1618 (memcoll, keycompare): Work even if the data to be compared are
1619 adjacent strings; this is possible now that lines contain the
1621 (fillbuf): Always have an unused byte at the end of the buffer,
1622 since memcoll and keycompare want to modify a byte after the last line.
1623 (sortalloc, mergealloc): Increase by 1, for trailing byte.
1625 1999-05-20 Jim Meyering <meyering@ascend.com>
1627 * tests/sort/Test.pm: Add test case from Paul Eggert.
1629 1999-05-20 Paul Eggert <eggert@twinsun.com>
1631 * src/sort.c (keycompare): Ignore any length difference if the
1632 localized comparison says the strings are equal.
1634 * src/sort.c (memcoll, keycompare, compare): Handle NUL
1635 characters properly when comparing with LC_COLLATE semantics.
1636 (NLS_MEMCMP): Remove.
1637 (memcoll): Renamed from strncoll.
1638 Take separate lengths for each string.
1639 This function is now invoked only when need_locale.
1640 (keycompare): Don't copy strings when ignore and translate
1643 1999-05-18 Paul Eggert <eggert@twinsun.com>
1645 * src/sort.c (MONTHTAB_CONST): Renamed from NLS_CONST; the use
1646 is also changed. Define to const also if !HAVE_NL_LANGINFO.
1648 (usage): `,' -> `;' (English typo).
1650 1999-05-17 Eli Zaretskii <eliz@is.elta.co.il>
1652 * src/cat.c (main): When stdout is in binary mode, make sure all
1653 input files are also read in binary mode.
1655 1999-05-16 Jim Meyering <meyering@ascend.com>
1659 1999-05-11 Paul Eggert <eggert@twinsun.com>
1661 * src/sort.c: Don't autodetect the locale of numbers and
1662 months, as this conflicts with POSIX.2 and is tricky to boot.
1664 (FLOATING_COMMA, NLS_STRNCMP, NLS_MAX_GROUPS,
1665 NLS_ONE_CHARACTER_STRING): Remove macros no longer used.
1667 (nls_grouping, nls_fraction_found, nls_month_found, nos_monthtab,
1668 nls_months_collide, nls_keyhead, us_monthtab): Remove variables no
1671 (struct nls_keyfield): Remove types no longer used.
1673 (strncoll_s2_readonly, nls_set_fraction, look_for_fraction,
1674 nls_month_is_either_locale, nls_numeric_format): Remove functions no
1677 (monthtab): Now has the role that us_monthtab had, but it's const only
1678 if ENABLE_NLS is not defined.
1680 (C_DECIMAL_POINT): Renamed from FLOATING_POINT. All uses changed.
1681 (MONTHS_PER_YEAR): Renamed from NLS_NUM_MONTHS. All uses changed.
1682 (struct_month_cmp): Renamed from nls_sort_month_comp. All uses changed.
1683 Use strcmp, not strcoll, since the user doesn't care about collating
1686 (inittables): Read locale data into monthtab, rather than modifying a
1687 separate month table and futzing with indirection. Do not worry about
1688 colliding months, since we no longer autodetect month locale.
1690 (fraccompare): Don't set no-longer-used variable nls_fraction_found.
1692 (getmonth): Use strncmp to compare months, since user doesn't care
1693 about collating here. Fix bug where code incorrectly assumed that
1694 strlen (monthtab[lo].name) == strlen (monthtab[ix].name).
1696 (keycompare, main): Don't autodetect month locale.
1698 (compare): Don't use NLS_MEMCP in code that can't be executed if
1699 need_locale is false, as NLS_MEMCP is equivalent to memcmp in that
1702 (sort, insertkey, main): Don't autodetect numeric locale.
1704 1999-05-15 Jim Meyering <meyering@ascend.com>
1706 * tests/join/Test.pm (trailing-sp): New test for this fix.
1707 * src/join.c (xfields): Don't interpret a trailing blank as a
1708 delimiter when e.g. -t: was specified. From Tim Smithers.
1710 1999-05-12 Jim Meyering <meyering@ascend.com>
1712 * tests/Makefile.am (envvar-check): Renamed from check-local.
1713 (check): Depend on envvar-check so the envvar check is performed
1714 before all other tests. Reported by Volker Borchert.
1715 * tests/.env-warn: Use `%%' place-holder that Makefile.am rule expects,
1716 so CDPATH is mentioned in the message. Reported by Volker Borchert.
1718 1999-05-11 Jim Meyering <meyering@ascend.com>
1720 * src/sort.c (usage): Split the --help message into two pieces so that
1721 neither is longer than 2048. For Irix4's cc. Reported by Kaveh Ghazi.
1723 1999-05-09 Jim Meyering <meyering@ascend.com>
1725 * lib/regex.c: Update from libc.
1729 * Makefile.maint (alpha): Put the announcement in
1730 /tmp/announce-$(distdir)
1732 * tests/sort/Test.pm (neg-nls): New test.
1734 1999-05-08 Jim Meyering <meyering@ascend.com>
1736 * src/system.h (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM,
1737 and all the *_MIN and *_MAX symbols): Remove definitions.
1738 * src/sys2.h: Put the definitions here instead (this file is shared
1739 between all three *utils packages, while system.h is not).
1741 1999-05-06 Paul Eggert <eggert@twinsun.com>
1743 * src/sort.c (fraccompare, numcompare): Merge the NLS and
1744 non-NLS versions into a single function.
1746 (decimal_point): Now char, since we no longer convert to unsigned
1748 (th_sep): Now int, since we use a value out of char range to denote
1749 the absence of a thousands separator.
1750 (IS_THOUSANDS_SEP): New macro.
1751 (USE_NEW_FRAC_COMPARE): Remove.
1752 (nls_set_fraction): Arg is now char, not unsigned char.
1753 Set th_sep to CHAR_MAX + 1 if there is no thousands separator.
1754 (numcompare): Don't convert to unsigned char unless necessary.
1755 (main): Turn off decimal points and thousand separators if they
1756 are multibyte characters, as we don't support that yet.
1758 1999-05-06 Paul Eggert <eggert@twinsun.com>
1760 * src/system.h (CHAR_MIN, CHAR_MAX): New macros.
1761 (SCHAR_MIN, SCHAR_MAX): Don't assume that char is signed.
1763 1999-05-06 Paul Eggert <eggert@twinsun.com>
1765 * src/sort.c (numcompare): Handle comparison of two negative
1766 numbers correctly in the ENABLE_NLS case.
1768 1999-05-04 Jim Meyering <meyering@ascend.com>
1770 * src/pr.c (usage): Break the usage message into 3 pieces instead of
1771 only 2. The strings had grown to be longer than 2048, which evokes
1772 errors when compiling with Irix4's cc. Reported by Kaveh Ghazi.
1774 * src/tsort.c (search_item): Use `1' instead of `+1'. The latter
1775 elicits a syntax error from SunOS4's cc. From Kaveh Ghazi.
1777 1999-05-03 Jim Meyering <meyering@ascend.com>
1779 * src/ptx.c <ctype.h>: Don't include.
1780 [!STDC_HEADERS]: Remove definitions of ctype macros.
1781 Convert e.g., isspace to ISSPACE to use definitions from sys2.h.
1782 Reported by Kaveh Ghazi.
1784 * src/sys2.h (TOLOWER): Define.
1786 * src/join.c (TOLOWER): Remove definition.
1787 * src/md5sum.c: (TOLOWER): Remove definition.
1789 1999-04-30 Jim Meyering <meyering@ascend.com>
1791 * src/sort.c (usage): Document the differences between the
1792 obsolescent, +POS1[-POS2] form, and the POSIX -k option.
1794 1999-04-24 Jim Meyering <meyering@ascend.com>
1796 * configure.in: Use AC_CANONICAL_HOST.
1798 * lib/Makefile.am (libtu_a_SOURCES): Add xstrtoumax.c
1799 (noinst_HEADERS): Remove xstrtoul.h.
1801 * src/csplit.c: Include new "xstrtol.h", not "xstrtoul.h".
1802 (struct control) [repeat]: Declare as uintmax_t, not int.
1803 (struct control) [lines_required]: Likewise.
1804 (handle_line_error): Use human_readable to print lines_required.
1805 (parse_repeat_count): Parse a uintmax_t.
1806 (parse_patterns): Parse a uintmax_t.
1808 * src/tail.c: Include new "xstrtol.h", not "xstrtoul.h".
1809 * src/od.c: Likewise.
1811 * src/head.c: Include new "xstrtol.h", not "xstrtoul.h".
1812 Change all U_LONG_LONG to uintmax_t.
1813 (head_lines): Move a couple dcls into an inner scope.
1814 (string_to_integer): Rename from string_to_ull.
1816 1999-04-19 Jim Meyering <meyering@ascend.com>
1818 * Makefile.maint (b_host): Remove /pub suffix.
1820 1999-04-18 Jim Meyering <meyering@ascend.com>
1824 * Makefile.maint (my-distcheck): Use AMTAR, not TAR.
1826 * src/sort.c (usage): s/DIRECT/DIRECTORY/g
1827 Rename global: s/temp_file_prefix/temp_dir/.
1828 (NAME_MAX_IN_DIR): Rename from PATH_MAX_IN_DIR. Use _POSIX_NAME_MAX,
1829 not _POSIX_PATH_MAX. Guard with #if HAVE_PATHCONF rather than
1831 (tempname): Wrap after 99999 only for length-impaired file systems.
1833 1999-04-17 Jim Meyering <meyering@ascend.com>
1835 * src/tail.c (file_lines): Fix serious bug introduced with last changes.
1836 From Andreas Schwab.
1838 1999-04-15 Jim Meyering <meyering@ascend.com>
1840 * tests/Makefile.am (EXTRA_DIST): Rename .posix-warn to .env-warn.
1841 (check-local): Warn about CDPATH in the same way
1842 we warn about POSIXLY_CORRECT, since the cp/same-file test fails at
1843 least when using bash with CDPATH set. Reported by Mark Hewitt.
1845 * src/pr.c Add comments.
1846 (init_header): Tweak white space in Date/Time header.
1847 * tests/pr/Test.pm: Updated all tests to reflect the big
1848 1999-02-13 change. From Roland Huebner.
1850 1999-04-12 Jim Meyering <meyering@ascend.com>
1852 * src/cat.c (main): Declare out_dev to be of type dev_t, not `int'.
1853 Declare out_ino to be of type ino_t, not `int'.
1856 * src/od.c (MIN, MAX): Remove definitions.
1857 * src/sys2.h (MIN, MAX): Define here instead.
1858 Reported by John Bley.
1860 1999-04-11 Jim Meyering <meyering@ascend.com>
1864 * tests/pr/Test.pm (test_vector): Disable all tests while I wait for
1867 Fix the problem whereby `yes > k & sleep 1; tail -2c k' would infloop.
1868 * src/tail.c (COPY_TO_EOF): Define.
1869 (dump_remainder): Add parameter, n_bytes, and rewrite to use it.
1871 (file_lines): Rename parameter.
1872 (tail_bytes): Remove obsolete comment.
1874 Fix the problem whereby `yes > k & sleep 1; tail -1 k' would infloop.
1875 * src/tail.c (dump_remainder): Move this function to precede the
1876 new use in file_lines.
1877 (tail_lines): Don't call dump_remainder here.
1878 (file_lines): Call dump_remainder here instead.
1879 Reported by Lehti Rami.
1881 * lib/readtokens.c (readtoken, readtokens): Protoize.
1883 1999-04-10 Jim Meyering <meyering@ascend.com>
1885 * src/tail.c (xwrite): Use STDOUT_FILENO instead of literal `1'.
1887 1999-04-04 Jim Meyering <meyering@ascend.com>
1889 * src/cat.c: Standardize --help and --version processing.
1890 * src/comm.c: Likewise.
1891 * src/csplit.c: Likewise.
1892 * src/cut.c: Likewise.
1893 * src/expand.c: Likewise.
1894 * src/fmt.c: Likewise.
1895 * src/fold.c: Likewise.
1896 * src/head.c: Likewise.
1897 * src/join.c: Likewise.
1898 * src/md5sum.c: Likewise.
1899 * src/nl.c: Likewise.
1900 * src/od.c: Likewise.
1901 * src/paste.c: Likewise.
1902 * src/pr.c: Likewise.
1903 * src/ptx.c: Likewise.
1904 * src/split.c: Likewise.
1905 * src/sum.c: Likewise.
1906 * src/tac.c: Likewise.
1907 * src/tail.c: Likewise.
1908 * src/tr.c: Likewise.
1909 * src/unexpand.c: Likewise.
1910 * src/uniq.c: Likewise.
1911 * src/wc.c: Likewise.
1913 1999-03-29 Jim Meyering <meyering@ascend.com>
1915 * configure.in (GNU_PACKAGE): Remove related code -- now it's in
1916 the catch-all for shared autoconf code, m4/jm-macros.m4.
1917 (jm_CHECK_ALL_TYPES): Remove explicit AC_TYPE_* macros and use
1920 1999-03-26 Jim Meyering <meyering@ascend.com>
1922 * lib/Makefile.am (libfu_a_SOURCES): Add version-etc.c.
1923 (noinst_HEADERS): Add version-etc.h.
1925 1999-03-25 Jim Meyering <meyering@ascend.com>
1927 * src/tail.c (recheck): Factor out a block of duplicated code.
1928 Set f->size to 0 upon encountering a new file so we read it from
1929 the beginning rather than from then end of the first line or
1930 block. Otherwise, after a log rotation, tail would omit the first
1931 line or block of the new file. Reported by Ed Avis.
1933 1999-03-20 Jim Meyering <meyering@ascend.com>
1935 * tests/Makefile.am (SUBDIRS): Temporarily remove pr.
1937 1999-03-13 Jim Meyering <meyering@ascend.com>
1939 * src/tac.c: (tac_mem): `#if-0'-out this unused function.
1940 (tac_stdin_to_mem): Likewise.
1942 * doc/textutils.texi (cut invocation): Describe --output-delimiter.
1944 1999-03-12 Jim Meyering <meyering@ascend.com>
1946 * src/sys2.h (SETVBUF): Define new macro.
1947 * src/tail.c (dump_remainder): Don't fflush stdout here.
1948 (main) [if forever]: Make stdout unbuffered, instead.
1949 Akim Demaille pointed out that when running `echo x>a; tail -f a>>a' ,
1950 the file `a' didn't grow longer than two lines. Now it grows
1953 1999-03-07 Jim Meyering <meyering@ascend.com>
1955 * tests/md5sum/newline-1: Test for the actual feature.
1956 With help from Eli Zaretskii.
1958 * src/pr.c (usage): Add missing \n\.
1960 The newline test would always fail on MSDOS/Windows systems --
1961 so move it to a separate file where we can test for that.
1962 * tests/md5sum/basic-1: Remove newline test.
1963 * tests/md5sum/newline-1: New file.
1964 * tests/md5sum/Makefile.am (TESTS): Add newline-1.
1965 Pointed out by Eli Zaretskii.
1967 1999-02-13 Roland Huebner <rh@pelikan.cologne.de>
1969 (main): Redefine options -s, -w to be POSIX compliant; introduce
1970 new options -J, -S, -W to disentangle -s and -w when used together
1971 with the three column options;
1972 (add_line_number): Make POSIX compliant; use default number
1973 separator TAB with single column output.
1974 (add_line_number): Make POSIX compliant; with multicolumn output
1975 now prefer `text columns of equal width' rather than a consequent
1976 use of `default n-separator TAB'.
1977 (add_line_number): Change line number cut-off from lower-oder to
1978 higher-oder digit to avoid loss of information; no consequent
1979 handling exists in different utilities and other UNIXes.
1980 (char_to_clump): Expand input text tabs to 8 spaces, if
1981 input_tab_char doesn't equal TAB (adapted to other UNIXes).
1982 (usage): Update POSIX compliant options -s, -w; add new options -J,
1984 (main): Update the source internal documentation.
1985 Some smaller BUGFIXES (print_sep_string, init_header, skip_to_page,
1986 reset_status, print_header).
1988 * tests/md5sum/basic-1 (backslash): Use .\foo instead of \.foo so we
1989 don't tramp on root directory in MSDOS/Windows.
1990 Suggestion from Eli Zaretskii.
1992 1999-02-15 Eli Zaretskii <eliz@is.elta.co.il>
1994 * tests/md5sum/Makefile.am (TESTS_ENVIRONMENT): Run md5sum with the
1995 --text option (for MSDOS).
1997 1999-03-06 Jim Meyering <meyering@ascend.com>
1999 * src/cut.c (getstr): Change type of `delim' parameter from char to int.
2000 (cut_fields): Cast to `unsigned char' before comparing.
2001 (main): Cast to `unsigned char' before assigning.
2003 * tests/cut/Test.pm: Add a test to exercise the bug.
2005 * src/ptx.c (swallow_file_in_memory): Use a `%s' format in error call,
2006 in case the argument string contains a `%'.
2008 * src/fmt.c (main): Likewise.
2009 * src/sort.c (main): Likewise.
2011 1999-02-13 Eli Zaretskii <eliz@is.elta.co.il>
2013 * src/sys2.h [__DJGPP__]: Include <io.h> and <sys/exceptn.h>.
2015 * src/ptx.c (swallow_file_in_memory): Slurp up the whole file at
2016 once on MSDOS as well, but we have to relax the test for whether
2017 reading it succeeded.
2019 1999-03-03 Jim Meyering <meyering@ascend.com>
2021 * src/cat.c: Include long-options.h
2022 [long_options]: Remove the "help" and "version" entries.
2023 Remove declarations of show_help and show_version.
2024 (main): Use parse_long_options, including author name(s).
2025 Remove the show_version and show_help blocks.
2026 * src/cksum.c: Likewise.
2027 * src/comm.c: Likewise.
2028 * src/csplit.c: Likewise.
2029 * src/cut.c: Likewise.
2030 * src/expand.c: Likewise.
2031 * src/fmt.c: Likewise.
2032 * src/fold.c: Likewise.
2033 * src/head.c: Likewise.
2034 * src/nl.c: Likewise.
2035 * src/od.c: Likewise.
2036 * src/paste.c: Likewise.
2037 * src/pr.c: Likewise.
2038 * src/split.c: Likewise.
2039 * src/sum.c: Likewise.
2040 * src/tac.c: Likewise.
2041 * src/tail.c: Likewise.
2042 * src/tr.c: Likewise.
2043 * src/unexpand.c: Likewise.
2044 * src/uniq.c: Likewise.
2045 * src/wc.c: Likewise.
2047 * src/ptx.c: Include long-options.h
2048 [long_options]: Remove the "help" and "version" entries.
2049 Remove declarations of show_help and show_version.
2050 (main): Remove `const' attribute from dcl of argv parameter.
2051 Call bindtextdomain and textdomain.
2052 Use parse_long_options, including author name(s).
2053 Remove the show_version and show_help blocks.
2055 * src/join.c (main): Include author name argument in call to
2057 * src/md5sum.c (main): Likewise.
2058 * src/sort.c (main): Likewise.
2059 * src/tsort.c (main): Likewise.
2061 1999-02-07 Jim Meyering <meyering@ascend.com>
2065 * Makefile.maint (my-distcheck): Don't depend on dist, now that this
2066 is hooked up to the distcheck rule.
2067 * Makefile.am (distcheck-hook): New target and rule -- link to shared
2068 rule, my-distcheck, in Makefile.maint.
2070 1999-01-31 Jim Meyering <meyering@ascend.com>
2072 * doc/textutils.texi: Wrap the @top node in @ifnottex instead of
2073 @ifinfo so `makeinfo --html ...' works. From Karl Berry.
2075 1999-01-30 Jim Meyering <meyering@ascend.com>
2077 * acconfig.h: Remove lots of `#undef's, now that we use the
2078 3-argument forms of AC_DEFINE* macros.
2080 * configure.in: Require autoconf 2.13.
2081 Use 3-argument form of AC_DEFINE*.
2083 1999-01-24 Jim Meyering <meyering@ascend.com>
2085 * src/tac.c (DONT_UNLINK_WHILE_OPEN) [__MSDOS__ || _WIN32]: Define.
2087 * lib/quotearg.c (quotearg_n_options): Revert type of parameter `n'
2088 (and hence that of the local `n1', too) to `int' at Paul's request.
2090 1999-01-18 Akim Demaille <demaille@inf.enst.fr>
2092 * doc/textutils.texi: Harmonization of @samp use for options.
2094 1999-01-17 Jim Meyering <meyering@ascend.com>
2096 * Makefile.am (SUBDIRS): Add djgpp.
2097 * configure.in (AC_OUTPUT): Add djgpp/Makefile.
2098 * djgpp/: New directory.
2100 * man/Makefile.maint ($(man_MANS)): Don't remove the target (the
2101 man page) until after we've created its replacement.
2103 1999-01-16 Eli Zaretskii <eliz@is.elta.co.il>
2105 * GNUmakefile: Add SHELL = /bin/sh.
2106 * man/GNUmakefile: Likewise.
2108 1999-01-16 Jim Meyering <meyering@ascend.com>
2110 * acconfig.h: Remove @BOTTOM@ section.
2111 Instead, add the define and decl via m4/jm-macros.m4.
2113 * lib/argmatch.h (XARGMATCH): Define to return a value once again.
2114 (XARGCASEMATCH): Likewise.
2116 * lib/argmatch.c (EXIT_FAILURE): Define.
2117 (ARGMATCH_DIE): Provide default.
2118 (__xargmatch_internal): New function.
2119 s/rogram_name/program_name.
2122 1999-01-14 Jim Meyering <meyering@ascend.com>
2124 * tests/md5sum/basic-1: Use `f', not `x' as temp. file name to avoid
2125 warnings from perl5.004.
2126 Reported by Volker Borchert.
2128 * lib/long-options.c (parse_long_options): Rename `usage' parameter
2129 to avoid shadowing globally scoped function.
2131 1999-01-14 Akim Demaille <demaille@inf.enst.fr>
2133 * acconfig.h: Add a @BOTTOM@ section.
2134 (ARGMATCH_DIE) [@BOTTOM@]: Define to usage(1).
2136 * src/*.c: Don't prototype usage as static.
2138 1999-01-10 Jim Meyering <meyering@ascend.com>
2142 All of the following new code is protected by
2143 `#if DONT_UNLINK_WHILE_OPEN'
2144 * src/tac.c (file_to_remove): New global.
2145 (fp_to_close): New global.
2146 (unlink_tempfile): New function.
2147 (record_tempfile): New function.
2148 (save_stdin): Call record_tempfile.
2150 (main): Use SET_BINARY and SET_BINARY2.
2153 1999-01-09 Jim Meyering <meyering@ascend.com>
2155 * tests/uniq/Test.pm: Add tests from Jochen Hein.
2156 * src/uniq.c: New option: --all-repeated (-D).
2157 (output_all_repeated) [output_mode]: New enum value.
2158 (usage): Describe it.
2159 (writeline): Test for new mode.
2160 (check_file): Likewise.
2161 Based on patches from Jochen Hein and Florin Iucha.
2162 (main): Diagnose `too many arguments'.
2164 * tests/head/Test.pm (null-1): Add test from Jochen Hein.
2166 * src/tail.c (parse_obsolescent_option): Interpret `number' as decimal.
2167 (parse_options): Likewise.
2168 Reported by Kamal Paul Nigam.
2170 * src/tail.c: New option: --max-unchanged-stats=N.
2171 New option: --max-n-consecutive-size-changes=N.
2173 1999-01-03 Jim Meyering <meyering@ascend.com>
2175 * src/md5sum.c (usage): Remove third program_name argument -- there
2176 were only two `%s' in the format string.
2178 1999-01-02 Jim Meyering <meyering@ascend.com>
2180 * src/tsort.c (tsort): Use a single call to error instead of two
2182 (main): Remove `%s: ' prefix on format string.
2184 * src/tail.c (parse_options): Use XARGMATCH in place of argmatch.
2186 * src/ptx.c (format_vals): New array.
2187 (main): Use XARGMATCH in place of argmatch.
2189 * lib/argmatch.h (XARGMATCH): Don't return a value; instead,
2190 modify a parameter. Add a `Die_stmt' parameter.
2192 * lib/argmatch.c (__xargmatch_internal): Remove now-unused function.
2193 (argmatch_to_argument): Add `const' attribute to first parameter.
2195 1999-01-01 Jim Meyering <meyering@ascend.com>
2197 * src/tsort.c: Move inclusion of assert.h to follow that of stdio.h.
2198 Some losing systems require this.
2199 Use STREQ macro instead of strcmp in a few places.
2201 * po/POTFILES.in: Add tsort.c.
2203 * man/Makefile.maint ($(man_MANS)): `exit 1' if any of help2man,
2204 chmod, or mv fails. Otherwise, the failure could go unnoticed.
2206 * man/Makefile.summ: Add entries for ptx and tsort.
2208 * src/tsort.c: Include readtokens.h.
2209 (zeros): Rename global from `rr'.
2210 (getstr): Remove function.
2211 (tsort) Use readtoken instead of getstr.
2213 * lib/readtokens.c: New file.
2214 * lib/readtokens.h: New file.
2215 * lib/Makefile.am (libtu_a_SOURCES): Add readtokens.c.
2216 (noinst_HEADERS): Add readtokens.h.
2218 * man/Makefile.am (man_MANS): Add ptx.1.
2219 * man/ptx.x: New file.
2221 * src/tail.c (parse_options): Use XARGMATCH in place of argmatch.
2223 * man/Makefile.am (man_MANS): Add tsort.1.
2224 * man/tsort.x: New (essentially empty) file.
2226 * src/tsort.c: Rename globals N and R so they don't shadow locals.
2227 (tsort): Rename from `sort'.
2229 1998-11-07 Mark Kettenis <kettenis@phys.uva.nl>
2230 * src/Makefile.am (bin_PROGRAMS): Add tsort.
2231 * src/tsort.c: New program.
2233 * lib/Makefile.am (libtu_a_SOURCES): Add quotearg.c.
2234 (noinst_HEADERS): Add quotearg.h.
2236 ============================
2237 All of the following are from:
2238 1998-04-17 Eli Zaretskii <eliz@is.elta.co.il>
2240 * src/system.h (SET_BINARY, SET_BINARY2, fileno, setmode): New
2243 * src/cat.c (usage) [O_BINARY]: Describe -B,--binary option.
2244 (main) [O_BINARY]: binary_files, binary_output, file_open_mode:
2245 new variables. Add --binary to long_options[]. Switch stdin and
2246 stdout to binary mode unless file contents are not important
2247 anyway. Open files in binary mode when required.
2249 * src/cksum.c (cksum) [O_BINARY]: Read redirected stdin in binary
2252 * src/expand.c (expand): Use binary I/O where appropriate.
2254 * src/head.c (head_bytes, head_lines) [O_BINARY]: Use binary I/O.
2256 * src/md5sum.c (OPENOPTS) [O_BINARY]: Use binary I/O when non-zero
2258 (md5_file) [O_BINARY]: Switch redirected stdin to binary mode.
2259 (main) [O_BINARY]: Use binary reads by default on those systems
2260 which care about the difference.
2262 * src/od.c (skip, read_char, read_block) [O_BINARY]: Switch input
2263 stream to binary mode.
2265 * src/sort.c (PATH_MAX_IN_DIR) [HAVE_UNISTD_H]: New macro, for max
2266 file name characters in a given directory.
2267 (tempname): Make sure the temp file name is unique even if long
2268 file names aren't supported.
2270 * src/split.c (cwrite) [O_BINARY]: Write output in binary mode.
2271 (main) [O_BINARY]: Read input in binary mode.
2273 * src/sum.c (bsd_sum_file, sysv_sum_file) [O_BINARY]: Read input
2276 * src/tac.c (record_tempfile, unlink_tempfile)
2277 [DONT_UNLINK_WHILE_OPEN]: New functions, for systems where a file
2278 cannot be removed before it is closed.
2279 (save_stdin) [DONT_UNLINK_WHILE_OPEN]: Record the temporary file,
2280 to be removed before exit.
2281 (tac_file, save_stdin, main): Use binary I/O when appropriate.
2283 * src/tail.c (tail_lines, tail_bytes) [O_BINARY]: Use binary I/O
2286 * src/tr.c (main) [O_BINARY]: Use binary I/O when appropriate.
2288 * src/unexpand.c (unexpand): Use binary I/O where appropriate.
2290 * src/wc.c (wc): Use binary mode for input.
2292 * doc/textutil.texi: Add comments about peculiarities of Textutils
2293 operation on MS-DOS/MS-Windows.
2295 1998-12-22 Jim Meyering <meyering@ascend.com>
2297 * configure.in (ALL_LINGUAS): Add chinese (zh).
2299 1998-12-17 Jim Meyering <meyering@ascend.com>
2301 New options for tail:
2302 --follow=name, --follow=descriptor, --allow-missing
2303 * src/tail.c (Follow_mode): New enum.
2304 (n_live_files): New function.
2305 (tail_forever): Avoid starvation with --follow=name and a
2306 continually-growing unlinked or renamed file.
2308 1998-12-13 Jim Meyering <meyering@ascend.com>
2310 * tests/uniq/Test.pm: New file.
2311 * tests/uniq/Makefile.am: New file.
2312 * tests/uniq: New directory.
2313 * tests/Makefile.am (SUBDIRS): Add uniq.
2314 * configure.in (AC_OUTPUT): Add tests/uniq/Makefile.
2317 * lib/Makefile.am (lstat.c): Add rule to generate this from xstat.in.
2319 (EXTRA_DIST): Add xstat.in.
2320 * lib/stat.c: Remove file.
2321 * lib/lstat.c: Remove file.
2322 * lib/xstat.in (xstat@): New file.
2324 * configure.in (ALL_LINGUAS): Add Russian (ru).
2326 1998-10-31 Jim Meyering <meyering@ascend.com>
2328 * acconfig.h (stat): New #undef.
2330 1998-10-22 Jim Meyering <meyering@ascend.com>
2332 * src/fold.c (usage): Add mention of --version and --help.
2333 Reported by Matej Vela <mvela@public.srce.hr>.
2335 1998-10-04 Jim Meyering <meyering@ascend.com>
2337 * lib/fnmatch.h: New file. (unused)
2338 * lib/fnmatch.c: New file. (unused)
2339 * lib/Makefile.am (noinst_HEADERS): Add fnmatch.h.
2341 1998-10-03 Jim Meyering <meyering@ascend.com>
2343 * man/Makefile.am: Switch to using help2man.
2344 (EXTRA_DIST): Add Makefile.summ.
2346 * man/help2man: Invoke program with --manhelp option only if
2347 --name=STRING not specified. Otherwise, this would fail with `yes'.
2348 * man/Makefile.summ: New file.
2349 * man/Makefile.maint: Include it.
2350 * man/help2man: New file.
2351 * man/GNUmakefile: New file.
2352 * man/Makefile.maint: New file.
2353 * man/*.x: New files.
2354 * man/*.1: Remove files.
2356 * src/md5sum.c (split_3): Rename local variable, to `escaped_filename'.
2357 (main): Output the leading backslash not just when there's a newline
2358 in the file name, but also when there's a backslash.
2359 Reported by Jim Dennis.
2361 * tests/md5sum/basic-1: Add tests with filenames containing newline
2362 and backslash characters. (for the bug fixed above)
2364 * tests/Makefile.am (EXTRA_DIST): Add Fetish.pm.
2365 * tests/Fetish.pm: New file.
2367 * tests/md5sum/basic-1: New file: rewrite of old tests to use Fetish.pm.
2368 * tests/md5sum/Test.pm: Remove file.
2369 * tests/md5sum/Makefile.am: Rewrite.
2371 1998-09-19 Jim Meyering <meyering@ascend.com>
2373 * src/ptx.c (program_name): Declare *not* to be const.
2375 1998-08-29 Jim Meyering <meyering@ascend.com>
2377 * src/cut.c: Don't assume ASCII.
2378 * src/pr.c: Likewise.
2379 * src/tail.c: Likewise.
2381 1998-08-15 Jim Meyering <meyering@ascend.com>
2383 * src/pr.c (usage): Reformat.
2385 * src/ptx.c: Add braces to suppress warning about ambiguous `else'.
2386 * lib/bumpalloc.h: Likewise.
2388 1998-08-13 François Pinard <pinard@iro.umontreal.ca>
2390 * src/ptx.c: New file.
2391 * src/Makefile.am (bin_PROGRAMS): Add ptx.
2392 * lib/bumpalloc.h, lib/diacrit.h, lib/diacrit.c: New files.
2393 * lib/Makefile.am (libtu_a_SOURCES): Add diacrit.c.
2394 (noinst_HEADERS): Add bumpalloc.h and diacrit.h.
2396 1998-08-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2398 * src/pr.c (long_options): Add long names for all options.
2399 (usage): Update help string.
2400 (main): Handle the special options --pages and --columns.
2402 1998-08-02 Jim Meyering <meyering@ascend.com>
2404 * lib/linebuffer.c (readline): Return zero upon error as well as upon
2405 end of file. From James Youngman.
2408 1998-08-01 Jim Meyering <meyering@ascend.com>
2410 * src/sort.c (my_setlocale): Guard definition within #ifdef ENABLE_NLS.
2411 From Manfred Hollstein.
2413 1998-07-30 Jim Meyering <meyering@ascend.com>
2415 * tests/cut/Test.pm: Avoid broken pipe message for tests that fail
2418 * src/sort.c (usage): Add angle brackets to make `Report bugs...'
2419 message consistent with all the rest.
2421 1998-07-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
2423 * tests/cut/Test.pm: Avoid broken pipe for 'y' and 'z' tests.
2425 * src/sort.c (NEGATION_SIGN): Renamed from NEGATIVE_SIGN to avoid
2426 clash with <langinfo.h>. All uses changed.
2428 1998-07-26 Jim Meyering <meyering@ascend.com>
2430 * intl/localealias.c (read_alias_file): Avoid mixing `char*' and
2431 `unsigned char*' variables. Again for irix4.
2432 Mostly from Kaveh Ghazi.
2434 * src/join.c: Convert some char* dcls to `unsigned char*' and remove
2435 a cast -- to placate irix4's cc.
2436 * src/fmt.c (check_punctuation): Add cast to placate irix4's cc.
2437 Reported by Kaveh Ghazi.
2439 * src/md5sum.c (split_3): Add cast to placate irix4's cc.
2442 1998-07-25 Jim Meyering <meyering@ascend.com>
2446 * tests/cut/Test.pm: Add tests for new --output-delimiter option,
2447 as well as for NUL input delimiter (--delimiter='').
2448 * src/cut.c (cut_fields): Honor new --output-delimiter option.
2449 (main): Fix handling of --delimiter='' (-d ''). Until now, it has
2450 never worked as advertised. I guess no one tried it.
2452 * tests/sort/Test.pm: Add two tests relating to this.
2453 * src/sort.c (main): Stat all non-`-' input file files (and fail if a
2454 stat fails) when an output file is specified by `-o' but doesn't exist.
2455 Reported by Will Edgington.
2457 * tests/sort/Test.pm: New tests of -o.
2459 1998-07-16 Jim Meyering <meyering@ascend.com>
2461 * lib/Makefile.am (noinst_HEADERS): Add lchown.h.
2462 * lib/lchown.h: New file, just to define ENOSYS on systems that lack it.
2463 * lib/lchown.c: Include lchown.h.
2465 1998-07-04 Jim Meyering <meyering@ascend.com>
2467 * configure.in (AM_WITH_REGEX): Remove. Now the replacement
2468 macro, jm_WITH_REGEX, is bundled with the rest in jm_MACROS.
2469 * acconfig.h (WITH_REGEX): Remove undef.
2470 * src/csplit.c: Remove #ifdef around <regex.h> inclusion.
2471 * src/nl.c: Likewise.
2472 * src/tac.c: Likewise.
2473 * src/csplit.c (extract_regexp): Remove #if !WITH_REGEX...#endif block.
2474 * lib/Makefile.am (noinst_HEADERS): Remove rx.h.
2475 * lib/rx.c: Remove file.
2476 * lib/rx.h: Remove file.
2478 1998-06-29 Jim Meyering <meyering@ascend.com>
2480 * src/wc.c: Update calls to human_readable -- now there's one fewer arg.
2482 * lib/Makefile.am (libtu_a_SOURCES): Add argmatch.c.
2483 (noinst_HEADERS): Add argmatch.h.
2485 1998-06-28 Jim Meyering <meyering@ascend.com>
2487 * src/sys2.h: Add macro definitions for GNU libc *_unlocked wrappers.
2489 1998-06-27 Jim Meyering <meyering@ascend.com>
2491 * tests/pr/Test.pm: Add two tests for double spacing.
2492 * src/pr.c (print_page): If cols_ready_to_print is zero,
2493 break out of loop just before the double-space test.
2494 Reported by Michael Stutz.
2496 1998-06-18 Jim Meyering <meyering@ascend.com>
2498 * tests/Makefile.am.in (check): Depend on $(maint_gen) so
2499 `make maintainer-clean; ./configure; make check' works.
2501 1998-05-25 Jim Meyering <meyering@ascend.com>
2503 * configure.in (_GNU_SOURCE): AC_DEFINE it here.
2504 * acconfig.h (_GNU_SOURCE): Remove definition from @TOP@ section.
2505 [!_GNU_SOURCE]: Add #undef instead.
2507 1998-05-16 Jim Meyering <meyering@ascend.com>
2509 * configure.in (jm_MACROS): New wrapper macro.
2510 Remove uses of most jm_* macros.
2512 * src/tac.c (tac_seekable): Fix error in handling regex separators.
2513 * tests/tac/Test.pm (opt-b, opt-s, opt_sb, opt_r): New tests.
2514 (opt_br): New test -- exercises above-fixed bug.
2516 * lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
2517 lines from the m4/*.m4 macros, so the hack of including some
2518 custom-replaced C source file names here is no longer needed.
2520 * acconfig.h (chown): Add undef.
2521 (D_INO_IN_DIRENT): Likewise.
2522 (D_TYPE_IN_DIRENT): Likewise.
2523 (ssize_t): Likewise.
2525 1998-05-09 Jim Meyering <meyering@ascend.com>
2527 * src/tac.c (tac_seekable): Rename from tac_stream.
2528 Change `FILE *in' parameter to `int input_fd'. Adjust callers.
2530 1998-05-03 Jim Meyering <meyering@ascend.com>
2532 * po/: Update from gettext-0.10.35.
2534 * configure.in: Remove use of AC_LINK_FILES.
2535 (AC_OUTPUT): Remove po/Makefile-generating sed command.
2537 1998-04-26 Jim Meyering <meyering@ascend.com>
2539 * tests/tail/Test.pm: Disable test f-1, now that it fails.
2541 * src/sort.c (keycompare) (CMP_WITH_IGNORE): Don't return 0 from inside
2542 the keyspec-iterating loop. With this change, test 22a passes.
2543 Reported by Zvi Har'El.
2544 (strncoll): Remove bogus assertion.
2545 * tests/sort/Test.pm: Add tests for the above fix.
2547 * configure.in: Use jm_ASSERT.
2548 * acconfig.h: Add NDEBUG.
2550 * src/cut.c: Don't define NDEBUG.
2551 * src/csplit.c: Likewise.
2552 * src/join.c: Likewise.
2553 * src/sort.c: Likewise.
2554 * src/tr.c: Likewise.
2556 * src/cut.c: Don't define _GNU_SOURCE (now it's in config.h).
2557 * src/expand.c: Likewise.
2558 * src/fold.c: Likewise.
2559 * src/join.c: Likewise.
2560 * src/sort.c: Likewise.
2561 * src/tr.c: Likewise.
2562 * src/unexpand.c: Likewise.
2563 * src/uniq.c: Likewise.
2565 * src/tail.c (close_fd): New function -- converted from macro.
2566 [struct File_spec] (n_stat_calls): New member.
2567 [struct File_spec] (n_unchanged_stats): New member.
2568 (max_n_unchanged_stats): New global.
2569 Initialize new members.
2570 (xwrite): New function -- converted from macro.
2571 [struct File_spec] (pretty_name): Remove member.
2572 (pretty_name): New function.
2574 * src/md5sum.c (md5_check): Declare local, `md5num' as _unsigned_ char*.
2575 (hex_digits): Declare parameter `s' as _unsigned_ char*.
2576 (split_3): Declare parameter `u' as _unsigned_ char**.
2578 1998-04-17 Jim Meyering <meyering@ascend.com>
2580 * src/fmt.c (check_punctuation): Used unsigned char* pointers to avoid
2582 * src/join.c (xfields): Likewise.
2584 1998-04-12 Jim Meyering <meyering@ascend.com>
2586 * src/cat.c: Use STREQ macro rather than strcmp.
2587 * src/cksum.c: Likewise.
2588 * src/comm.c: Likewise.
2589 * src/csplit.c: Likewise.
2590 * src/cut.c: Likewise.
2591 * src/fmt.c: Likewise.
2592 * src/fold.c: Likewise.
2593 * src/head.c: Likewise.
2594 * src/join.c: Likewise.
2595 * src/md5sum.c: Likewise.
2596 * src/nl.c: Likewise.
2597 * src/paste.c: Likewise.
2598 * src/pr.c: Likewise.
2599 * src/split.c: Likewise.
2600 * src/sum.c: Likewise.
2601 * src/tac.c: Likewise.
2602 * src/uniq.c: Likewise.
2603 * src/wc.c: Likewise.
2605 1998-04-11 Jim Meyering <meyering@ascend.com>
2607 * lib/safe-read.h: New file.
2608 * lib/safe-read.c: Include it.
2609 * src/cat.c: Include it instead of merely declaring safe_read.
2610 * src/csplit.c: Likewise.
2611 * src/head.c: Likewise.
2612 * src/split.c: Likewise.
2613 * src/sum.c: Likewise.
2614 * src/tac.c: Likewise.
2615 * src/tail.c: Likewise.
2616 * src/tr.c: Likewise.
2617 * src/wc.c: Likewise.
2619 * lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
2621 * src/wc.c [HAVE_INTTYPES_H]: Include inttypes.h.
2622 Declare counters to be of type uintmax_t.
2623 (write_counts): Use human_readable to format potentially-long-long
2624 numbers. Suggestion from Rogier Wolff.
2625 (wc): Declare per-file counters to be of type uintmax_t.
2626 Declare bytes_read to be ssize_t.
2627 * lib/Makefile.am (libtu_a_SOURCES): Add human.c.
2628 (noinst_HEADERS): Add human.h.
2630 * lib/human.c: New file.
2631 * lib/human.h: New file.
2633 1998-04-04 Jim Meyering <meyering@eng.ascend.com>
2635 * configure.in (jm_AC_HEADER_INTTYPES_H): Use it.
2636 (jm_AC_TYPE_UINTMAX_T): Use it.
2637 (jm_PREREQ): Use it.
2639 * Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
2640 know about the m4/ subdirectory.
2641 * Makefile.maint (aclocal-files): Remove now-unnecessary (with
2642 automake-1.2h and the above change) aclocal-related rules and includes.
2644 1998-04-03 Jim Meyering <meyering@eng.ascend.com>
2646 * lib/closeout.c: New file.
2647 * lib/closeout.h: New file.
2648 * lib/Makefile.am (libtu_a_SOURCES): Add closeout.c.
2649 (noinst_HEADERS): Add closeout.h.
2651 1998-03-31 Jim Meyering <meyering@eng.ascend.com>
2653 * lib/xstrtol.c: Merge with the version from fileutils.
2655 1998-03-27 Jim Meyering <meyering@eng.ascend.com>
2657 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
2659 1998-03-23 Jim Meyering <meyering@eng.ascend.com>
2661 * acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
2662 automatically handles it.
2664 1998-03-19 Jim Meyering <meyering@eng.ascend.com>
2666 * src/system.h (SCHAR_MIN): Define.
2668 od.c needs these when compiling with NCR's R2.0c C compiler.
2669 (TYPE_MAXIMUM): Cast result to `(t)' so this macro works with
2673 1998-03-15 Jim Meyering <meyering@eng.ascend.com>
2675 * src/tail.c (tail_file): Merge largely-duplicated blocks of code.
2677 1998-03-03 Paul Eggert <eggert@twinsun.com>
2679 * src/sort.c (xtmpfopen): Open temporary file exclusively, to
2680 foil a common denial-of-service attack.
2681 * src/tac.c (save_stdin): Likewise.
2683 1998-02-16 Jim Meyering <meyering@eng.ascend.com>
2685 * configure.in (jm_FUNC_LSTAT): Use it.
2686 (jm_FUNC_STAT): Use it.
2687 * lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c.
2689 1998-02-06 Jim Meyering <meyering@eng.ascend.com>
2691 * configure.in: Don't use AM_MAINTAINER_MODE or
2692 AC_PATH_PROG(PERL, perl).
2693 (jm_PERL): Use this.
2695 1998-02-04 Jim Meyering <meyering@eng.ascend.com>
2697 * tests/Makefile.am.in (EXTRA_DIST): Remove mk-script.pl.
2698 (mk_script): Set to ../mk-script.
2699 (x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script.
2700 Remove @MAINT@ cruft.
2701 (Makefile.am): Likewise.
2702 Remove @MAINT@ cruft. Now `missing' will explain the failure
2703 when people don't have Perl yet modify a file whose rebuilding
2704 would lead to the use of Perl.
2706 * tests/Makefile.am (EXTRA_DIST): Add mk-script.
2707 * tests/*/mk-script.pl: Remove files.
2709 * GNUmakefile: New file.
2710 * Makefile.am (EXTRA_DIST): Add GNUmakefile.
2711 Don't include Makefile.maint from here. It's included from GNUmakefile.
2713 1998-01-30 Paul Eggert <eggert@twinsun.com>
2715 * configure.in (AC_LFS): Put before anything that can affect or use
2716 CPPFLAGS, LDFLAGS, or LIBS.
2718 1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
2720 * Makefile.maint: New file.
2721 * Makefile.am: Move rules common to textutils, fileutils, sh-utils
2722 into Makefile.maint.
2723 Include Makefile.maint.
2724 (EXTRA_DIST): Add Makefile.maint.
2726 * src/cat.c (cat): Convert comma-expressions to pairs of
2727 semicolon-terminated stmts.
2728 Add braces around compound if/else stmts.
2730 1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
2732 * src/tail.c (parse_obsolescent_option): Do not interpret `-f -n 1 ...'
2733 as obsolescent options.
2734 Accept new option: --sleep-interval=SECONDS (-s).
2735 (parse_options): Recognize it.
2736 (usage): Describe it.
2737 (tail_forever): Use it.
2738 (dump_remainder): Use it.
2739 * tests/tail/Test.pm (f-1): Add test for option-processing of `-f -n 1'.
2741 * tests/cut/: Rename directory to remove `-test' suffix.
2742 * tests/join/: Likewise.
2743 * tests/md5sum/: Likewise.
2744 * tests/pr/: Likewise.
2745 * tests/sort/: Likewise.
2746 * tests/tr/: Likewise.
2747 * configure.in (AC_OUTPUT): Reflect renamings in tests/.
2748 * tests/Makefile.am (SUBDIRS): Reflect renamings in tests/.
2750 * src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
2751 bug in Cray C 5.0.3.0 when T == time_t.
2753 1998-01-18 Jim Meyering <meyering@na-net.ornl.gov>
2755 * src/sort.c (strncoll, strncoll_s2_readonly, look_for_fraction,
2756 numcompare): Remove the `unsigned' from some `unsigned char*'
2757 parameter types. Add casts via UCHAR where necessary to avoid
2758 problems with unwanted sign extension. Based on a patch from
2759 Kaveh Ghazi to appease Irix4's cc compiler.
2761 1998-01-17 Jim Meyering <meyering@na-net.ornl.gov>
2763 * src/split.c (next_file_name): Rewrite. This removes an artificial
2764 limit (albeit already high, at INT_MAX :-) on the number of files
2765 split could create. Reported by Ralf W. Stephan.
2767 1998-01-16 Jim Meyering <meyering@na-net.ornl.gov>
2769 * src/sort.c: (mergefps): Add braces to avoid ambiguous `else' stmt.
2770 (nls_set_fraction): Likewise.
2772 * src/sort.c: Guard inclusion of langinfo.h also with HAVE_LANGINFO_H,
2773 for Irix-4.0.5. From Kaveh Ghazi.
2774 * configure.in: Check for langinfo.h.
2776 * lib/getline.c: Make PARAMS-defining conditionals consistent.
2777 * lib/linebuffer.h: Likewise.
2778 * lib/long-options.h: Likewise.
2779 * lib/memcasecmp.h: Likewise.
2780 * lib/xstrtod.h: Likewise.
2781 * lib/xstrtol.h: Likewise.
2782 Suggestion from Kaveh Ghazi.
2784 * tests/head/Test.pm (fail-0): Disable test. It depends on
2785 sizeof(long) being 32 bits. Reported by Kaveh Ghazi.
2787 1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
2791 * src/system.h [HAVE_LIMITS_H]: Include limits.h
2792 (TYPE_SIGNED): Define.
2793 (TYPE_MINIMUM): Define.
2794 (TYPE_MAXIMUM): Define.
2796 (SCHAR_MAX): Define.
2797 (UCHAR_MAX): Define.
2802 (ULONG_MAX): Define.
2803 * src/*.c: Remove definitions of those symbols.
2805 * src/csplit.c: Move inclusion of regex.h/rx.h to follow system.h
2806 since it now includes limit.h which defines RE_DUP_MAX.
2807 * src/nl.c: Likewise.
2808 * src/tac.c: Likewise.
2810 * lib/xstrtol.c (bkm_scale): Renamed from BKM_SCALE.
2811 Rewrite macro as function. Return a value. Update caller.
2812 Cast __ZLONG_MAX `__unsigned long int' before casting to double to
2813 avoid SunOS /bin/cc compiler bug.
2815 1998-01-08 Jim Meyering <meyering@na-net.ornl.gov>
2817 * src/tac-pipe.c: New file. But not yet used.
2818 * src/Makefile.am (EXTRA_DIST): Add tac-pipe.c.
2820 * src/tac.c (tac_stream): Don't perform arithmetic on now-void* pointer
2821 result of xrealloc (until recently it was char*).
2823 * configure.in (AC_CHECK_FUNCS): Add nl_langinfo.
2824 * src/sort.c (inittables): Add && HAVE_NL_LANGINFO to the #if-test
2825 guarding the nls month-checking code.
2826 (nls_numeric_format): Remove unnecessary (and error-evoking w/SunOS' cc)
2827 `unsigned' from dcls of text and lim.
2828 (main): Cast lconvp->grouping to `unsigned char*' to appease SunOS's cc.
2830 1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
2832 * lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr.
2834 * configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
2835 those files will be built via the ANSI2KNR-filtering rules if necessary.
2837 1997-12-25 Jim Meyering <meyering@na-net.ornl.gov>
2839 * configure.in: Remove AC_DEFINE of _GNU_SOURCE.
2840 * acconfig.h (_GNU_SOURCE): Define if not already defined.
2841 Put this code in @TOP@ section.
2842 (_GNU_SOURCE): Remove #undef.
2844 1997-12-22 Jim Meyering <meyering@na-net.ornl.gov>
2846 * configure.in: AC_DEFINE _GNU_SOURCE.
2847 * acconfig.h: Add _GNU_SOURCE.
2849 1997-12-21 Jim Meyering <meyering@na-net.ornl.gov>
2851 * configure.in (AC_CHECK_HEADERS): Add stdlib.h.
2853 * src/system.h: Merge in things from fileutils' version of this file.
2854 * src/csplit.c: s/__P/PARAMS/.
2855 * src/fmt.c: s/__P/PARAMS/.
2856 * src/od.c: s/__P/PARAMS/.
2857 * src/pr.c: s/__P/PARAMS/.
2859 1997-12-14 Jim Meyering <meyering@na-net.ornl.gov>
2861 * src/sys2.h: s/HAVE_DECLARATION_/HAVE_DECL_/g.
2863 1997-12-13 Jim Meyering <meyering@na-net.ornl.gov>
2865 * src/fmt.c (main): Add some braces.
2866 Check return code from fclose of each input file.
2867 Close stdout and check for errors.
2869 * src/csplit.c (close_output_file): Check ferror before calling fclose.
2870 (main): Close stdout and check for errors.
2872 1997-11-15 Jim Meyering <meyering@na-net.ornl.gov>
2874 * acconfig.h: Add mktime.
2875 * configure.in (jm_FUNC_MKTIME): Use it.
2876 * lib/mktime.c: New file.
2877 * lib/Makefile.am (EXTRA_DIST): Add mktime.c
2879 * intl/Makefile.in (distclean): Don't remove libintl.h here.
2880 * Makefile.am (DISTCLEANFILES): Remove it here instead.
2882 1997-11-13 Jim Meyering <meyering@na-net.ornl.gov>
2884 * lib/strftime.c: Update from FSF.
2885 * m4/strftime.m4: Check for POSIX.2's %f format spec.
2887 1997-11-12 Jim Meyering <meyering@na-net.ornl.gov>
2889 * src/system.h [!HAVE_MEMPCPY] (mempcpy): Define.
2890 * configure.in (AC_CHECK_FUNCS): Add mempcpy.
2892 1997-11-09 Jim Meyering <meyering@na-net.ornl.gov>
2894 * configure.in (jm_FUNC_STRFTIME): Use it.
2895 * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Check for localtime_r.
2896 * m4/strftime.m4 (jm_STRFTIME_PREREQS): Check for localtime_r.
2897 (jm_FUNC_GNU_STRFTIME): Use new macro.
2898 (jm_FUNC_STRFTIME): New macro. Likewise.
2899 Reported by Noel Cragg.
2901 1997-11-08 Jim Meyering <meyering@na-net.ornl.gov>
2903 * m4/lfs.m4 (AC_LFS): New file/macro.
2904 * m4/Makefile.am (EXTRA_DIST): Add lfs.m4.
2905 * configure.in (AC_LFS): Use it.
2906 (AC_CHECK_FUNCS): Add fseeko.
2907 * src/od.c (fseeko): Define a stub if ! HAVE_FSEEKO.
2908 (skip): Use fseeko if available. Don't use lseek; it causes
2909 the stdio stream to become out of sync with respect to the
2910 underyling file descriptor.
2913 1997-10-16 Paul Eggert <eggert@twinsun.com>
2915 * configure.in (AC_CHECK_FUNCS): Add fseeko.
2917 * src/od.c (skip): Use fseeko. Don't use lseek; it causes
2918 the stdio stream to become out of sync with respect to the
2919 underyling file descriptor.
2921 1997-11-06 Jim Meyering <meyering@na-net.ornl.gov>
2923 * src/sort.c (getmonth): Remove HAVE_ALLOCA #ifdefs.
2924 We always have alloca.
2925 (keycompare): Don't use variable size arrays (it's a gcc-extension).
2926 Rewrite code that increments new lengths when not `ignoring'.
2928 1997-11-02 Jim Meyering <meyering@na-net.ornl.gov>
2930 * acconfig.h: Add malloc and realloc.
2932 * src/wc.c (main): New option, --max-line-length (-L).
2933 (wc, write_counts): Implement it.
2936 1997-10-26 Jim Meyering <meyering@na-net.ornl.gov>
2938 * lib/memcasecmp.c: Convert to upper case before comparing.
2939 This makes join -i work with sort -f.
2940 Reported by Arthur Pool.
2942 1997-10-25 Jim Meyering <meyering@na-net.ornl.gov>
2944 * lib/xmalloc.c (xalloc_fail): Renamed from fixup_null_alloc.
2945 (xcalloc): #ifdef-out unused function.
2946 (xrealloc): Remove code to work around deficient versions of realloc.
2947 Now we have an autoconf-enabled replacement version.
2948 (xmalloc): Remove code to work around deficient versions of malloc.
2949 Now we have an autoconf-enabled replacement version.
2951 * lib/memcmp.c (rpl_memcmp): Rename from memcmp.
2953 * src/sort.c (NLS_STRNCMP) [!ENABLE_NLS]: s/strcmp/strncmp/.
2955 * lib/xmalloc.c (xalloc_fail_func): Initialize to 0, not NULL.
2957 * configure.in (jm_FUNC_MALLOC): Use it.
2958 (jm_FUNC_REALLOC): Use it.
2960 * lib/Makefile.am (EXTRA_DIST): Add malloc.c.
2961 * lib/malloc.c: New file.
2962 * m4/malloc.m4: New file.
2963 * m4/Makefile.am (EXTRA_DIST): Add malloc.m4.
2965 * lib/Makefile.am (noinst_HEADERS): Add xalloc.h.
2966 (EXTRA_DIST): Add realloc.c.
2967 (EXTRA_DIST): Add malloc.c.
2969 * src/system.h: Include xalloc.h.
2970 Remove dcls of xmalloc, xcalloc and xrealloc.
2972 * lib/xalloc.h: New file.
2974 * lib/xmalloc.c: Include xalloc.h.
2975 Change VOID to void.
2976 (xalloc_exit_failure): Renamed extern.
2977 (xalloc_msg_memory_exhausted): New extern.
2978 (xalloc_fail_func): New extern.
2979 (fixup_null_alloc): Use new variables.
2981 1997-10-24 Jim Meyering <meyering@na-net.ornl.gov>
2983 * src/unexpand.c: Remove old-style xmalloc and xrealloc decls.
2984 (add_tabstop): Cast first arg of xrealloc to char*.
2986 * src/sort.c: Include xalloc.h.
2987 (xmalloc): Remove function.
2988 (xrealloc): Remove function.
2989 (main): Set xalloc_fail_func to cleanup.
2990 Set xalloc_exit_failure SORT_FAILURE.
2992 * src/paste.c: Remove old-style xmalloc and xrealloc decls.
2993 (paste_parallel): Cast first arg of xrealloc to char*.
2995 * src/od.c: Remove old-style xmalloc and xrealloc decls.
2996 (decode_format_string): Cast first arg of xrealloc to char*.
2998 * src/expand.c: Remove old-style xmalloc and xrealloc decls.
2999 (add_tabstop): Cast first arg of xrealloc to char*.
3001 * lib/xalloc.h: New file.
3003 * src/cut.c (ADD_RANGE_PAIR): Cast first arg of xrealloc to char*.
3004 (getstr): Cast xmalloc return value to char*.
3006 * src/csplit.c: Include xalloc.h.
3007 (xmalloc): Remove function.
3008 (xrealloc): Remove function.
3009 (main): Set xalloc_fail_func to cleanup.
3011 * src/*.c: Remove old-style xmalloc and xrealloc decls.
3012 * src/system.h: Add prototyped xcalloc, xmalloc and xrealloc decls.
3013 Suggestion from Achim Blumensath.
3015 1997-10-23 Jim Meyering <meyering@na-net.ornl.gov>
3017 * Makefile.am (aclocal-files): Also depend on m4/Makefile.am.
3019 * src/system.h [!HAVE_DECLARATION_FREE]: Declare free.
3020 [!HAVE_DECLARATION_MALLOC]: Declare malloc.
3021 [!HAVE_DECLARATION_REALLOC]: Declare realloc.
3022 [!HAVE_DECLARATION_STPCPY]: Declare stpcpy.
3023 [!HAVE_DECLARATION_STRSTR]: Declare strstr.
3024 * src/cat.c: Remove stpcpy dcl.
3025 * src/csplit.c: Remove malloc and realloc dcls.
3026 * src/sort.c: Remove free, malloc, and realloc dcls.
3027 * src/tac.c: Remove malloc, and realloc dcls.
3028 * src/tr.c: Remove stpcpy dcl.
3029 On some systems, strstr and stpcpy are macros, so declaring them
3030 unconditionally gets syntax errors.
3031 Reported by Mark M. Kettenis.
3033 * configure.in: Use jm_CHECK_DECLS.
3034 * m4/Makefile.am (EXTRA_DIST): Add decl.m4 and check-decl.m4.
3036 1997-10-22 Jim Meyering <meyering@na-net.ornl.gov>
3038 * m4/decl.m4: New file.
3039 * m4/check-decl.m4: New file. New macro, jm_CHECK_DECLS.
3041 1997-10-16 Paul Eggert <eggert@twinsun.com>
3043 * src/od.c (LONG_MAX): Define if not defined.
3045 1997-10-16 Jim Meyering <meyering@na-net.ornl.gov>
3047 * src/sort.c (look_for_fraction): Patch from Ørn Hansen.
3048 (getmonth): Compare the two month names only to the length of the
3049 string in the month table. Patch from Ørn Hansen.
3050 (NLS_STRNCMP): New macro.
3051 (strncoll_s2_readonly): New function.
3052 (inittables): Don't use temporary `comp' to hide type of
3053 comparator function.
3054 (nls_sort_month_comp): Declare parameters to be void* to match
3055 comparator function type required for qsort.
3056 (getmonth): Use NLS_STRNCMP rather than #ifdef.
3057 Use do-while, rather than while-loop.
3059 1997-10-14 Jim Meyering <meyering@na-net.ornl.gov>
3061 * src/sort.c: (_NL_ITEM) [!defined]: Define.
3062 From from Ørn E. Hansen.
3064 * src/sort.c: Use STREQ in place of most uses of strcmp.
3065 (NLS_STRCMP): Define.
3066 (getmonth): Remove ifdef and use NLS_STRCMP instead.
3067 Use HAVE_ALLOCA, not _HAVE_ALLOCA.
3068 (zaptemp): Make parameter `const'.
3070 * tests/sort-test/Test.pm: Add tests to exercise new fraccompare.
3072 * src/sort.c (CHARS_IN_ABM): Remove definition
3073 (inittables): Remove assumption that all abbreviated month names have
3075 (getmonth): Likewise.
3076 (main): Add #if's for more efficient code when using the GNU C library.
3077 From Ulrich Drepper.
3079 * src/sort.c (strncoll): Rename parameter to LEN.
3080 (keycompare): Move assignment out of if-expression.
3082 * lib/xstrdup.c: New file.
3083 * lib/Makefile.am (libtu_a_SOURCES): Add xstrdup.c
3085 * src/sort.c: Declare xstrdup.
3086 (my_setlocale): New function.
3087 (main): Guard against failure of strdup (use xstrdup) and setlocale.
3089 * src/system.h (STREQ): Define.
3090 * src/od.c (STREQ): Remove definition.
3092 * src/sort.c (look_for_fraction): Eliminate arbitrary limit on
3093 number of `groups'. Declare as void, not int.
3094 Patch from Ørn E. Hansen.
3095 (main): When determining whether we're in the C or POSIX locale,
3096 don't rely on the form of the string returned by setlocale.
3097 Suggestion from Ulrich Drepper.
3099 1997-10-12 Jim Meyering <meyering@na-net.ornl.gov>
3101 * src/sort.c: Apply big patch from Ørn E. Hansen.
3103 (NLS_MEMCMP): Define.
3104 (keycompare): Use it instead of open-coded #ifdefs.
3105 (compare): Likewise.
3106 (NLS_MAP): Remove unused definitions.
3107 Replace with uses of UCHAR.
3108 (nls_locale_map): Remove dcl of unused file-scope array.
3110 1997-10-10 Jim Meyering <meyering@na-net.ornl.gov>
3112 * tests/sort-test/Test.pm: Add a test.
3115 1997-10-07 Jim Meyering <meyering@na-net.ornl.gov>
3117 * src/*.c: Update bug-reporting address.
3118 * src/cat.c: Indent cpp directives to reflect nesting.
3119 * src/cksum.c: Likewise.
3120 * src/csplit.c: Likewise.
3121 * src/fmt.c: Likewise.
3122 * src/nl.c: Likewise.
3123 * src/paste.c: Likewise.
3125 1997-09-27 Jim Meyering <meyering@na-net.ornl.gov>
3127 * m4/memcmp.m4: Integrate test to detect bug in memcmp from the
3128 Next x86 OpenStep C library. Test program from William Lewis.
3130 1997-09-21 Jim Meyering <meyering@na-net.ornl.gov>
3132 * src/od.c [struct tspec] (hexl_mode_trailer): Rename from `trailer.'
3133 (dump_hexl_mode_trailer): Rename from dump_string_trailer.
3134 Use fputs and putchar instead of trivial or %-less printfs.
3135 (decode_one_format): Parenthesize each field_width assignment in an
3136 argument list to make the side effect a little more apparent.
3137 (write_block): Use fputs and putchar instead of trivial or %-less
3139 (dump_strings): Cast string_min to off_t to avoid long-standing warning.
3141 * src/od.c: Implement new `z' (hexl-mode) modifier.
3142 [struct tspec] (trailer): New field.
3143 (field_width): Likewise.
3144 (dump_string_trailer): New function.
3145 (decode_one_format): Save each field_width in the tspec.
3146 Patch from John Kodis.
3148 1997-09-14 Jim Meyering <meyering@na-net.ornl.gov>
3150 * src/od.c (main) [--traditional]: Don't give diagnostic about there
3151 being more than three arguments if there are *no* arguments specified.
3152 Reported by Jochen Hein.
3154 1997-09-13 Jim Meyering <meyering@na-net.ornl.gov>
3156 * tests/sort-test/Test.pm: Add tests 19a and 19b.
3158 1997-07-21 Jim Meyering <meyering@na-net.ornl.gov>
3160 * src/tail.c (parse_obsolescent_option): #ifdef-out portability warning.
3162 1997-07-19 Jim Meyering <meyering@na-net.ornl.gov>
3164 * src/sort.c (checkfp): Print the `disorder' message. Include both
3165 the number and the contents of the first out-of-order line, in addition
3166 to the file name. Change meaning of return value.
3167 (check): Don't print disorder message here.
3168 Adjust test of checkfp's return value.
3169 Feature suggestion from Karl Heuer.
3171 1997-07-13 Jim Meyering <meyering@na-net.ornl.gov>
3173 * doc/Makefile.am (EXTRA_DIST): Remove explicit mention of texinfo.texi.
3174 Now, automake includes it automatically.
3176 * src/head.c: Include xstrtoul.h.
3177 Remove global variable, unit_size.
3178 (atou): Remove now-unused function.
3179 (parse_unit): Likewise.
3180 (string_to_ull): New function.
3181 (head): Take new parameter, count_lines. Use it instead of unit_size.
3183 (head_file): Likewise.
3184 (main): Use string_to_ull, not atou/parse_unit.
3185 The problem was that overflow wasn't detected, so `head -c 4096m'
3186 was treated just like `head -c 0'.
3187 Reported by Jerome Abela.
3189 * tests/wc: New directory.
3190 * tests/head: New directory.
3191 * tests/Makefile.am (SUBDIRS): Add head and wc.
3192 * configure.in (AC_OUTPUT): Add tests/head/Makefile and
3195 1997-07-05 Jim Meyering <meyering@na-net.ornl.gov>
3197 * src/tail.c (parse_obsolescent_option): If POSIXLY_CORRECT is set, give
3198 a diagnostic and fail when there are two or more non-option arguments.
3200 1997-07-04 Jim Meyering <meyering@na-net.ornl.gov>
3202 * tests/tac/mk-script.pl: Redirect output of cmp to /dev/null.
3204 * configure.in (ALL_LINGUAS): Add Norwegian (no).
3206 * Makefile.am (aclocal-files): Look in source directory, not build dir.
3207 From Andreas Schwab.
3209 Sun Jun 15 06:36:41 1997 Jim Meyering <meyering@na-net.ornl.gov>
3211 * src/pr.c (init_header) [T_BUF_FMT]: Output the 4-digit year (not the
3212 2-digit abbreviation) in each page header. Reported by Noah Friedman.
3214 Sat Jun 14 12:29:12 1997 Jim Meyering <meyering@na-net.ornl.gov>
3216 * src/cut.c (cut_fields): Detect when the input is empty and handle
3217 that special case. Before `cut -f1 < /dev/null' would improperly
3218 output a single newline. Reported by Phil Richards.
3220 Sun Apr 27 15:10:58 1997 Jim Meyering <meyering@na-net.ornl.gov>
3222 * man/Makefile.am (DISTFILES): Add $(man_MANS).
3224 * configure.in (ALL_LINGUAS): Add Czech (cs) and Swedish (sv).
3226 Thu Apr 3 21:14:02 1997 Jim Meyering <meyering@na-net.ornl.gov>
3228 * m4/Makefile.am (EXTRA_DIST): Update file list.
3230 * tests/cut-test/Test.pm: Add test from Phil Richards.
3232 Sat Mar 22 20:29:10 1997 Jim Meyering <meyering@na-net.ornl.gov>
3234 * missing: New file -- from the automake-1.1m distribution.
3236 Fri Mar 21 23:56:41 1997 Jim Meyering <meyering@na-net.ornl.gov>
3238 * Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.1l.
3239 (aclocal.m4): Use aclocal's new -I option.
3241 Thu Mar 13 21:46:04 1997 Jim Meyering <meyering@na-net.ornl.gov>
3243 * src/tr.c (main): Make sure c1 is not -1 before using it as an
3244 array index. Patch from Greg McGary. Although this is truly a
3245 bug, I believe it would not cause tr to misbehave on most systems.
3246 I could not construct a test case with which this bug causes tr
3247 to generate invalid output.
3249 * tests/pr-test/Test.pm: Add test that -o 0 works.
3251 * src/pr.c (main): Allow use of 0 (zero) as the margin offset
3252 argument to the -o option. Patch from Gary Anderson.
3254 Fri Feb 28 22:32:51 1997 Jim Meyering <meyering@na-net.ornl.gov>
3256 * src/uniq.c (usage): Fix typo in --help output. From Andreas Schwab.
3258 Tue Feb 25 20:34:51 1997 Jim Meyering <meyering@na-net.ornl.gov>
3260 * lib/Makefile.am (noinst_HEADERS): Add obstack.h.
3261 (libtu_a_SOURCES): Add obstack.c.
3263 Sun Feb 16 08:30:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
3265 * tests/Makefile.am (SUBDIRS): Add tac.
3266 * tests/tac: New directory.
3267 * configure.in (AC_OUTPUT): Add tests/tac/Makefile.
3269 * tests/pr-test/{tt-0FF, tt-bl, tta3-0FF, ttb3-0FF, tt-FF, tt-t,
3270 tta3-FF, ttb3-FF}: New files. Renamed (s/T/tt/) to avoid name clashes
3271 on case-independent filesystems.
3272 * tests/pr-test/Test.pm (Tests '7.*'): Reflect file-renaming.
3274 * src/tail.c (parse_obsolescent_option): Reverse order of args in
3275 diagnostic. Remove `' quotes in diagnostic.
3276 (parse_options): Remove `' quotes in diagnostic.
3278 Sat Feb 8 22:43:45 1997 Jim Meyering <meyering@na-net.ornl.gov>
3280 * src/tail.c (parse_obsolescent_option): Give warning diagnostic for
3281 (but now accept) obsolescent usage with more than one file argument.
3283 Sun Feb 2 23:06:59 1997 Jim Meyering <meyering@na-net.ornl.gov>
3285 * src/join.c: Move alloca-related preprocessor code into system.h.
3286 * src/od.c: Remove alloca-related preprocessor code.
3287 * src/system.h: Add alloca-related preprocessor code.
3289 Sat Feb 1 07:21:43 1997 Jim Meyering <meyering@na-net.ornl.gov>
3291 * tests/pr-test/*: Rename files to avoid exceeding 14-character limit.
3292 * tests/pr-test/Test.pm: Reflect renamings.
3294 * tests/pr-test/mk-script.pl (spec_to_list): Warn about all filenames
3295 that exceed max-length before dying.
3297 * src/pr.c (init_parameters): For compatibility: use default
3298 separator `TAB' with full length lines. From Roland Huebner.
3300 Fri Jan 31 19:53:54 1997 Jim Meyering <meyering@na-net.ornl.gov>
3302 * src/tac.c: Rename globals buffer and buffer_size to have G_ prefix
3303 to avoid shadowing local variables.
3305 * lib/long-options.c (parse_long_options): Compare getopt_long return
3306 value against -1, not EOF. Use NULL, not `(int *) 0' as last parameter
3307 in getopt_long call.
3309 * src/pr.c (add_line_number): Rename from `number' to avoid shadowing
3312 * src/*.c: Compare getopt_long return value against -1, not EOF.
3313 Use NULL, not `(int *) 0' as last parameter in getopt_long call.
3314 (usage): Bracket bug-reporting address with <> and append a period.
3316 Wed Jan 29 20:54:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
3318 * tests/tr-test/Test.pm: Do each test twice: get input via REDIR
3321 * tests/tail/Test.pm (test_vector): Do each (non-stdin-requiring)
3324 * tests/pr-test/Test.pm: Remove common_option_prefix flag.
3325 (test_vector): Prepend the common option here instead.
3327 * tests/md5sum-test/Test.pm: Remove input_via_stdin flag.
3328 Do each test twice: get input via REDIR and PIPE.
3330 * tests/cut-test/Test.pm: Do each test three times.
3332 * tests/cut-test/mk-script.pl: Allow each test to be run any or all
3333 of three different ways. Program input may be specified via a file
3334 or files listed on the command line, via input redirection (if there's
3335 only one file), or via a pipe.
3337 Tue Jan 28 20:54:06 1997 Jim Meyering <meyering@na-net.ornl.gov>
3339 * tests/cut-test/mk-script.pl: Remove `t' prefix on all generated
3341 Change suffixes from (.in, .exp, .out, .err) to (.I, .X, .O, .E).
3342 Ensure that no test file (generated or maintainer-supplied) has a
3343 name longer than 14 characters.
3345 Sun Jan 26 12:49:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
3349 * src/tail.c (parse_options): Add quotes to make messages identical.
3351 Sat Jan 25 00:12:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
3353 * src/tail.c (parse_obsolescent_option): Comment.
3354 (parse_options): Remove unnecessary goto and label.
3356 * tests/sort-test/mk-script.pl: Interpret `input arg is a hash
3357 reference' as meaning that the tested program will read no input.
3358 Most of the tests for the date program use this feature.
3359 Also for date, the generated script now reflects specification
3360 (in Test.pm) of default and per-test environment settings.
3362 * src/csplit.c: Reflect changes to xstrtol and xstrtoul interfaces.
3363 * src/fold.c: Likewise.
3364 * src/head.c: Likewise.
3365 * src/join.c: Likewise.
3366 * src/nl.c: Likewise.
3367 * src/od.c: Likewise.
3368 * src/pr.c: Likewise.
3369 * src/uniq.c: Likewise.
3371 * lib/xstrtoul.h (XSTRTOL_H): Undefine it.
3373 * lib/xstrtol.h [!_STRTOL_ERROR]: Define the type `enum strtol_error'
3374 only if it hasn't already been defined.
3375 (_STRTOL_ERROR): Undefine.
3377 * lib/xstrtol.c (__xstrtol): Change interpretation of
3378 VALID_SUFFIXES == NULL vs VALID_SUFFIXES == "". Use the former
3379 when any suffix is valid, the later when no suffix is allowed.
3381 Fri Jan 24 23:36:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
3383 * lib/long-options.c (parse_long_options): Reset optind to zero
3384 before just returning so that getopt internals get initialized from
3385 the probably-new parameters when/if getopt is called later.
3386 From Ulrich Drepper.
3388 Thu Jan 23 19:17:03 1997 Jim Meyering <meyering@na-net.ornl.gov>
3390 * src/tail.c (parse_obsolescent_option): Recognize and fail for
3391 more malformed obsolescent options. Makes for better diagnostics.
3393 Wed Jan 22 21:34:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
3395 * tests/Makefile.am (SUBDIRS): Add tail.
3396 * tests/tail: New directory.
3397 * configure.in (AC_OUTPUT): Add tests/tail/Makefile.
3399 * src/tail.c (parse_options): New function.
3400 (parse_obsolescent_option): New function.
3401 (main): Use the new functions instead of open-coding them.
3402 This better fixes the bug in handling obsolescent `+Nc' options.
3405 Tue Jan 21 22:49:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
3407 * src/tail.c (main): Properly handle what the POSIX spec calls
3408 the `obsolescent' usage (e.g., tail +2c). It didn't work.
3409 Reported by Karl Heuer.
3411 Sun Jan 12 22:13:27 1997 Jim Meyering <meyering@na-net.ornl.gov>
3413 * tests/tr-test/Test.pm: Rename tests so that the associated files
3414 have names that are distinct even on filesystems on which file
3415 names are case insensitive.
3416 Reported by Fred Fish.
3417 * tests/cut-test/Test.pm: Likewise.
3419 * tests/tr-test/Makefile.am: Regenerated to reflect renamed tests.
3420 * tests/cut-test/Makefile.am: Likewise.
3422 Wed Jan 8 16:38:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
3426 * lib/getopt.c (_getopt_internal): Use `_', rather than the
3427 (sometimes-)expansion `gettext'.
3429 Tue Jan 7 22:50:13 1997 Jim Meyering <meyering@na-net.ornl.gov>
3431 * lib/getopt.c: New (more POSIX compliant) version from GNU libc.
3432 [_]: Define to gettext also if ENABLE_NLS is defined.
3435 Thu Jan 2 21:17:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
3437 * src/pr.c (init_fps): Initialize lines_stored field in three places.
3438 This avoids uninitialized memory reads in close_file.
3440 Wed Jan 1 17:32:18 1997 Jim Meyering <meyering@na-net.ornl.gov>
3442 * configure.in (AC_ARG_PROGRAM): Remove explicit use.
3443 It's implicit in AM_INIT_AUTOMAKE. From Wayne Stewart.
3445 Sun Dec 29 23:42:57 1996 Jim Meyering <meyering@na-net.ornl.gov>
3447 * src/pr.c (init_header): Plug a small memory leak by using stack
3448 rather than heap for a 15-byte temporary buffer.
3450 Sat Dec 28 00:03:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
3452 * src/pr.c (TAB_WIDTH): Parenthesize uses of parameters and renamed
3454 (POS_AFTER_TAB): Renamed from pos_after_tab. Define in terms of
3455 TAB_WIDTH rather than duplicating the expression.
3457 Fri Dec 27 17:29:02 1996 Jim Meyering <meyering@na-net.ornl.gov>
3459 * tests/join-test/mk-script.pl: Fix a couple of thinkos and typos.
3460 Now it works with pr's tests, too.
3462 * tests/pr-test/Makefile.am (explicit): Regenerate list of files,
3463 this time with duplicates removed.
3465 * src/pr.c (usage): Break long string literal into two separate
3466 printf statements to accomodate default maximum of 2048 characters
3467 for Irix-4.0.5. Reported by Kaveh Ghazi.
3469 * Makefile.am (aclocal.m4): No longer depend on acinclude.m4.
3471 * tests/Makefile.am (SUBDIRS): Add pr-test.
3473 * configure.in: AC_REQUIRE version 2.12 of autoconf.
3474 AC_OUTPUT: Add tests/pr-test/Makefile.
3476 Sun Dec 22 08:11:27 1996 Jim Meyering <meyering@na-net.ornl.gov>
3478 * acinclude.m4: Move macros to individual files in new directory, m4/.
3479 See ChangeLog entries in sh-utils for the details.
3481 * configure.in: Increment version to 1.20a.
3483 * tests/md5sum-test/Makefile.am: Use same framework as other tests.
3484 * tests/md5sum-test/Test.pm: New file.
3486 Sat Dec 21 20:32:58 1996 Jim Meyering <meyering@na-net.ornl.gov>
3488 * tests/Makefile.am (EXTRA_DIST): Add README and Makefile.am.in.
3490 * tests/Makefile.am.in: New file.
3492 * tests/sort-test/Makefile.am: Clone the Makefile.am from join-test.
3493 Replace only the definition of $x and the auto-generated lists of
3495 * tests/cut-test/Makefile.am: Likewise.
3496 * tests/tr-test/Makefile.am: Likewise.
3498 * tests/join-test/Makefile.am: Add @MAINT@-protected rule for
3499 verifying that Makefile.am is consistent with Test.pm.
3501 Fri Dec 20 00:08:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
3503 * tests/join-test/Makefile.am (MAINTAINERCLEANFILES): Use $(in1)
3504 and $(in2), not $(in).
3506 * tests/join-test/mk-script.pl: New option: --list.
3507 Generate lists of files used/generated.
3509 Thu Dec 19 23:28:41 1996 Jim Meyering <meyering@na-net.ornl.gov>
3511 * tests/join-test/mk-script.pl: Rewrite to be more general -- so
3512 it can be used for join, cut, sort, tr, and soon, pr test suites.
3513 * tests/tr-test/mk-script.pl: Symlink through CVS repo to join's
3515 * tests/sort-test/mk-script.pl: Likewise.
3516 * tests/cut-test/mk-script.pl: Likewise.
3518 * tests/tr-test/Test.pm: Adapted for new mk-script.pl.
3519 * tests/join-test/Test.pm: Likewise.
3521 Tue Dec 17 16:48:51 1996 Jim Meyering <meyering@na-net.ornl.gov>
3523 * tests/join-test/Makefile.am (.pl): Make generated file read-only so
3524 I don't accidentally modify it instead of the one with the .pl suffix.
3526 * acinclude.m4 (jm_SYS_PROC_UPTIME): Require AC_PROG_CC, rather than
3527 now-obsolete AC_C_CROSS.
3528 (jm_FUNC_MKTIME): When redefining, use rpl_ prefix, not gnu_ one
3529 since there's nothing GNU-specific about the replacement. Contrast
3530 with gnu_ prefix added to strftime.
3531 (jm_FUNC_MEMCMP): New macro.
3532 * configure.in: Use jm_FUNC_MEMCMP instead of AM_FUNC_MEMCMP.
3533 * acconfig.h: Add memcmp.
3534 * README: Remove warning about memcmp. The new macro handles it.
3536 Mon Dec 16 23:03:27 1996 Jim Meyering <meyering@na-net.ornl.gov>
3538 * tests/Makefile.am (pkgdata_DATA): Remove unnecessary assignment.
3540 (AUTOMAKE_OPTIONS): Likewise.
3542 Sat Dec 14 14:51:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
3544 * acinclude.m4 (jm_SYS_PROC_UPTIME): Fix typo in cache variable
3545 name for cross compiling.
3546 Remove definitions of gettext-related macros. The gettext
3547 installation procedure installs corresponding .m4 files so that
3548 aclocal will use them.
3550 1996-12-12 Paul Eggert <eggert@twinsun.com>
3552 * system.h (ISDIGIT): Replace with smaller, faster edition
3553 that yields nonzero only on ASCII digits.
3554 (ISDIGIT_LOCALE): New macro, with same meaning that ISDIGIT
3557 * tr.c (is_char_class_member): Use ISDIGIT_LOCALE instead of
3558 ISDIGIT to test for characters in CC_DIGIT class.
3560 * sort.c (digits): Remove; subsumed by new ISDIGIT.
3561 (inittables): Remove initialization of `digits'.
3562 (fraccompare, numcompare, main): Use ISDIGIT (x) instead of digits[x].
3563 (fraccompare, numcompare): Avoid casts to unsigned char that are no
3566 * csplit.c (get_format_width, get_format_prec): Avoid
3567 unnecessary comparison of digit to '\0'.
3569 Thu Dec 12 23:42:51 1996 Jim Meyering <meyering@na-net.ornl.gov>
3571 * src/sort.c (usage): Clarify description of -u option.
3574 Wed Dec 11 19:32:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3578 Tue Dec 10 00:15:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
3580 The file name, `build-script.pl' is longer than 14 characters.
3582 * tests/cut-test/mk-script.pl: Rename from build-script.pl.
3583 * tests/cut-test/Makefile.am: Reflect renaming.
3584 * tests/tr-test/mk-script.pl: Rename from build-script.pl.
3585 * tests/tr-test/Makefile.am: Reflect renaming.
3586 * tests/sort-test/mk-script.pl: Rename from build-script.pl.
3587 * tests/sort-test/Makefile.am: Reflect renaming.
3588 * tests/join-test/mk-script.pl: Rename from build-script.pl.
3589 * tests/join-test/Makefile.am: Reflect renaming.
3590 Reported by Karl Heuer.
3592 * configure.in (VERSION): Bump to 1.19r.
3593 (AC_ISC_POSIX): Remove kludgy macro.
3594 Use this test instead:
3595 (LIBS): Add -lcposix if it contains strerror.
3596 Patch from Karl Heuer.
3598 Sun Dec 8 07:22:38 1996 Jim Meyering <meyering@na-net.ornl.gov>
3600 =========== Update for automake-1.1k.
3601 * Makefile.am (AUTOMAKE_OPTIONS): Require 1.1k.
3602 * configure.in (AM_CONFIG_HEADER): Use it.
3603 (AC_OUTPUT): Remove stamp-h timestamping statement.
3604 Now, AM_CONFIG_HEADER does it automatically.
3605 * lib/Makefile.am (noinst_LIBRARIES): Rename to libtu.a as per
3606 new automake requirement.
3607 Rename tu_* variables to libtu_a_*.
3609 Wed Dec 4 21:03:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3611 * src/pr.c: Apply big patch from Roland Huebner.
3613 * src/tr.c (main) [!POSIXLY_CORRECT]: Allow the identity mappings:
3614 [:upper:] to [:upper:] and [:lower:] to [:lower:].
3615 (main) [POSIXLY_CORRECT]: Give a more specific diagnostic for
3616 the invalid identity mappings [:upper:] to [:upper:] and [:lower:]
3618 (class_ok): Update table to reflect that tr now allows these
3619 identity mappings. Suggestion from Risto Kankkunen.
3621 Thu Nov 28 00:31:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3623 * configure.in (AM_GNU_GETTEXT): Renamed from ud_GNU_GETTEXT
3624 for gettext-0.10.25.
3626 Tue Nov 26 23:05:14 1996 Jim Meyering <meyering@na-net.ornl.gov>
3628 * src/sort.c (fraccompare): Add explicit `int' in `register' dcls,
3629 to avoid new warning from gcc.
3631 Sun Nov 24 21:02:15 1996 Jim Meyering <meyering@na-net.ornl.gov>
3633 * tests/sort-test/Makefile.am (t): Add names of those 5 tests.
3635 * tests/sort-test/Test.pm: Add 5 tests to exercize just-fixed code.
3637 * src/sort.c (set_ordering): Revert 1994-05-04 change to this function
3638 so that blanks are not unconditionally ignored when computing start
3639 and end positions for numeric keys with explicit character offsets.
3640 Reported by Markus Demleitner.
3642 Sat Nov 23 16:07:08 1996 Jim Meyering <meyering@na-net.ornl.gov>
3644 * cat.c (usage): Alphabetize option descriptions the way sort -f would.
3645 * fmt.c (usage): Likewise.
3646 * join.c (usage): Likewise.
3647 * md5sum.c (usage): Likewise.
3648 * od.c (usage): Likewise.
3649 * pr.c (usage): Likewise.
3650 * sort.c (usage): Likewise.
3651 * split.c (usage): Likewise.
3652 * wc.c (usage): Likewise.
3655 Fri Nov 22 20:20:37 1996 Jim Meyering <meyering@na-net.ornl.gov>
3657 * src/csplit.c (process_regexp): Update CURRENT_LINE only if
3658 the new value would be larger. This avoids the infinite loop
3659 otherwise provoked by situations like this:
3660 printf "\na\n" | csplit - '/a/-1' '{*}'
3663 Tue Nov 19 23:16:57 1996 Jim Meyering <meyering@na-net.ornl.gov>
3665 * configure.in (AM_SANITY_CHECK_CC): Remove it. Autoconf-2.11
3668 Sat Nov 2 08:50:01 1996 Jim Meyering <meyering@na-net.ornl.gov>
3670 * doc/Makefile.am (MAKEINFO): Set to makeinfo --no-split.
3671 Otherwise, the generated info files have names longer than
3672 the 14-byte max of some old systems.
3673 Reported by Karl Heuer.
3675 Fri Nov 1 21:33:16 1996 Jim Meyering <meyering@na-net.ornl.gov>
3677 * lib/strtol.c: Update from GNU libc.
3679 * tests/sort-test/Test.pm: Add a test to exercize this fix.
3681 * src/sort.c [!ENABLE_ASSERTIONS]: Guard NDEBUG definition.
3682 (checkfp): Fix off-by-one error that resulted in writing one byte
3683 beyond the end of a malloc'd buffer. It caused `sort -c' to segfault
3684 on Linux systems having a relatively recent libc. Before, running
3685 the command, perl -e "print 'x' x 30, \"\n\";"|sort -c
3686 would provoke the memory overrun (though not necessarily the failure).
3688 Reported by Risto Kankkunen.
3690 Thu Oct 31 17:48:24 1996 Jim Meyering <meyering@na-net.ornl.gov>
3692 * src/sort.c (key_init): New function.
3693 (main): Use key_init in the two places where it was open-coded.
3694 This fixes a UMR of the general_numeric field.
3696 * src/join.c (decode_field_spec): Always give FIELD_INDEX a value.
3697 This avoids a spurious UMR report from purify.
3698 (prjoin): Add an assertion.
3699 (add_field): Update assertion.
3701 * src/tr.c (es_free): New function.
3702 (parse_str): Use it to plug a small memory leak.
3704 Wed Oct 23 22:02:24 1996 Jim Meyering <meyering@na-net.ornl.gov>
3706 * lib/md5.c: Update from GNU libc.
3707 * lib/md5.h: Update from GNU libc.
3709 Mon Oct 21 16:48:12 1996 Jim Meyering <meyering@na-net.ornl.gov>
3711 * src/tr.c (validate): Remove TAB from diagnostic, for consistency.
3713 Sun Oct 20 13:44:07 1996 Jim Meyering <meyering@na-net.ornl.gov>
3715 * lib/Makefile.am (INCLUDES): Add -I../intl. Reported by Eric Backus.
3717 * Makefile.am (AUTOMAKE_OPTIONS): Set to `gnits'
3718 (EXTRA_DIST): Remove.
3720 * configure.in: Remove README_ALPHA related code. Automake takes
3721 care of it automatically now when in gnits mode.
3723 * lib/md5.c (md5_process_bytes): Cast void* pointer to char* before
3724 doing arithmetic with it.
3726 Sat Oct 19 23:13:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
3728 * lib/md5.c: Update from GNU libc.
3729 * lib/md5.h: Update from GNU libc.
3731 Fri Oct 18 00:08:04 1996 Jim Meyering <meyering@na-net.ornl.gov>
3733 * configure.in (AC_OUTPUT): Add tests/join-test/Makefile.
3735 * tests/Makefile.am (SUBDIRS): Add join-test.
3737 Tue Oct 15 23:25:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
3739 * src/tr.c (get_next): Rewrite to treat lower/upper mapping as a
3741 (main): Write separate loops to initialize mapping for lower->upper
3742 and upper->lower conversion.
3743 Reported by Arne Henrik Juul.
3745 Sun Oct 13 12:52:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
3747 * lib/xstrtol.c (__xstrtol): Return an error for invalid suffix.
3748 Before, e.g., `split -b 1M' would be silently accepted and treated
3749 like `split -b 1'. Reported by Franc,ois.
3751 * src/split.c (usage): Remove parameter, REASON.
3752 (main): Update callers to use combination of error (0, 0, ... and
3753 usage (EXIT_FAILURE).
3754 (main): When a string operand cannot be converted to a number of
3755 bytes or lines, include that string in the diagnostic.
3757 Sat Oct 12 00:05:11 1996 Jim Meyering <meyering@na-net.ornl.gov>
3759 * configure.in (AC_REPLACE_FUNCS): Add strpbrk and strtol.
3761 * lib/Makefile.am (EXTRA_DIST): Remove.
3763 Thu Oct 10 23:41:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
3765 * lib/md5.c (md5_stream): Apply fix from Ralph Loader
3766 <loader@maths.ox.ac.uk> via Ulrich Drepper.
3768 Wed Oct 9 07:26:40 1996 Jim Meyering <meyering@na-net.ornl.gov>
3770 * lib/Makefile.am (tu_DEPENDENCIES): Depend on $(tu_LIBADD).
3772 Tue Oct 8 21:32:17 1996 Jim Meyering <meyering@na-net.ornl.gov>
3774 * lib/error.c: Include error.h to align with libit --
3775 under protest, François :-).
3777 Sun Oct 6 08:02:28 1996 Jim Meyering <meyering@na-net.ornl.gov>
3779 * acinclude.m4 (AC_HEADER_SYS_TIME_H, AM_FUNC_MKTIME,
3780 AM_FUNC_ERROR_AT_LINE, AM_FUNC_OBSTACK): Remove definitions.
3781 They're included in automake-1.1f.
3783 * configure.in (AM_FUNC_ERROR_AT_LINE): Use it instead of
3786 Sat Oct 5 12:40:22 1996 Jim Meyering <meyering@na-net.ornl.gov>
3788 * lib/memcpy.c [HAVE_CONFIG_H]: Include config.h.
3791 Fri Oct 4 07:20:37 1996 Jim Meyering <meyering@na-net.ornl.gov>
3793 * configure.in (GNU_PACKAGE): New variable.
3794 (PACKAGE_VERSION): Remove it.
3796 * acconfig.h (GNU_PACKAGE): New variable.
3797 (PACKAGE_VERSION): Remove now-unused variable.
3799 * lib/long-options.c (parse_long_options): Separate package name
3800 and version number to accomodate new --version output requirement.
3801 * lib/long-options.h: Update prototype.
3803 Thu Oct 3 23:27:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
3805 * src/md5sum.c (main): Remove dead code that used to print --version
3808 Tue Oct 1 06:54:22 1996 Jim Meyering <meyering@na-net.ornl.gov>
3810 * configure.in: Use result of AM_FUNC_STRTOD to set POW_LIBM.
3811 * src/Makefile.am (sort_LDADD): Use any library (-lm) that
3812 gets substituted for @POW_LIBM@.
3814 * tests/md5sum-test/md5-rfc (md5sum): Use ../../src/md5sum.
3816 Mon Sep 30 23:35:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
3818 * tests/md5sum-test/md5-rfc (md5sum): Set to $srcdir/md5sum.
3820 * acinclude.m4: Update definitions from gettext-0.24.
3822 Sun Sep 29 20:04:53 1996 Jim Meyering <meyering@na-net.ornl.gov>
3824 * tests/sort-test/build-script.pl: Die if close fails.
3825 * tests/tr-test/build-script.pl: Likewise.
3827 * configure.in (AC_OUTPUT): Add tests/cut-test/Makefile.
3828 * tests/Makefile.am (SUBDIRS): Add cut-test.
3829 * tests/cut-test: New directory.
3831 Fri Sep 27 22:22:09 1996 Jim Meyering <meyering@na-net.ornl.gov>
3833 * configure.in (ALL_LINGUAS): Add spanish (es).
3835 Thu Sep 26 21:02:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
3837 * src/md5sum.c (usage): Remove references in --help output to
3838 the now-deprecated --string option. Support for it will be
3839 removed soon. Using this option can provoke a memory access
3840 violation on some systems because of (unavoidable in an efficient
3841 implementation) alignment assumptions made by functions in md5.c.
3842 md5sum.c could leave the option in and accomodate the alignment
3843 restriction, but this option was intended solely for testing, and
3844 the tests are now all file-oriented, so it's not necessary.
3846 * tests/md5sum-test/md5-rfc: Rewrite to avoid use of --string option.
3848 Wed Sep 25 21:43:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
3850 * tests/sort-test/Makefile.am (t): Factor out .in suffix.
3851 Include new test: t16a.
3852 * tests/tr-test/Makefile.am (t): Likewise.
3854 * src/Makefile.am (EXTRA_DIST): Remove md5-test.rfc.
3856 Mon Sep 23 10:00:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
3858 * tests/md5sum-test/Makefile.am (EXTRA_DIST): Distribute $(TESTS).
3860 Sun Sep 22 09:24:22 1996 Jim Meyering <meyering@na-net.ornl.gov>
3862 * src/sort.c (keycompare): Declare translate to be unsigned char *.
3863 Otherwise, sign extension caused misordering when using e.g. -f.
3864 Reported by Erick Branderhorst.
3865 * tests/sort-test/Test.pm: Add Erick's test for that fix.
3867 * tests/Makefile.am (SUBDIRS): Add md5sum-test.
3869 Sat Sep 21 13:34:59 1996 Jim Meyering <meyering@na-net.ornl.gov>
3871 * src/Makefile.am (check): Remove tests for md5sum.
3872 * tests/md5sum-test: New directory. Put them here instead.
3873 * configure.in (AC_OUTPUT): Add tests/md5sum-test/Makefile.
3875 Thu Sep 19 08:54:05 1996 Jim Meyering <meyering@na-net.ornl.gov>
3877 * tests/: Rename from checks.
3878 * Makefile.am (SUBDIRS): Change `checks' to `tests'.
3879 * configure.in (AC_OUTPUT): Likewise.
3881 * configure.in ($PACKAGE, $VERSION): Don't AC_DEFINE_UNQUOTED these.
3882 AM_INIT_AUTOMAKE now does it (as of automake-1.1e).
3884 Sun Sep 15 23:08:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
3886 * Makefile.am (EXTRA_DIST): Remove acinclude.m4.
3888 Thu Sep 12 17:05:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
3890 * lib/Makefile.am (EXTRA_DIST): Add getline.c.
3891 (tu_SOURCES): Remove getline.c
3894 Sun Sep 8 13:55:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
3896 * checks/sort-test/build-script.pl: Prefix $in with \$srcdir/
3897 so make check works with VPATH build. From Uli Drepper.
3899 Sat Sep 7 12:25:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
3901 * src/system.h: Add comments justifying IS* versions of ctype.h macros.
3903 * src/fmt.c (check_punctuation): Use ISPUNCT instead of ispunct.
3904 (get_line): Use ISSPACE instead of isspace. From Bruno Haible.
3906 Mon Sep 2 10:34:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
3908 * src/*.c (usage): Tell where to report bugs.
3910 Sun Aug 25 22:50:47 1996 Jim Meyering <meyering@na-net.ornl.gov>
3912 * checks/sort-test/Makefile.am (EXTRA_DIST): Add $x-tests.
3913 ($x-tests): Guard dependencies with @MAINT@.
3914 * checks/tr-test/Makefile.am: Likewise.
3916 Sat Aug 24 14:25:41 1996 Jim Meyering <meyering@na-net.ornl.gov>
3918 * src/cat.c (cat): Cast first arg to stpcpy to char* to avoid warnings.
3920 Wed Aug 21 22:28:26 1996 Jim Meyering <meyering@na-net.ornl.gov>
3922 * configure.in (ALL_LINGUAS): Add polish (pl).
3924 Sun Aug 18 09:34:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
3926 * configure.in (AC_OUTPUT): Add checks/sort-test/Makefile.
3927 * checks/Makefile.am (SUBDIRS): Add sort-test.
3929 Sat Aug 17 18:57:17 1996 Jim Meyering <meyering@na-net.ornl.gov>
3931 * Makefile.am (EXTRA_DIST): Add acinclude.m4.
3933 Tue Aug 13 21:47:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
3935 * src/Makefile.am (EXTRA_DIST): Remove ansi2knr.1 and ansi2knr.c.
3936 Automake includes them automatically.
3938 * configure.in (AM_INIT_AUTOMAKE): Use it.
3939 (AM_PROG_INSTALL): Remove. AM_INIT_AUTOMAKE does this.
3940 (AC_PROG_MAKE_SET): Likewise.
3942 Sun Aug 11 20:49:21 1996 Jim Meyering <meyering@na-net.ornl.gov>
3944 * configure.in: Rename a few macros for automake-1.1c.
3945 (AC_REPLACE_GNU_GETOPT): Remove.
3946 (AC_PATH_PROG): Find perl -- needed only for checks if you
3947 change or remove things with e.g. make maintainerclean.
3950 * lib/Makefile.am (tu_LIBADD): Remove @REGEXOBJ@. New AM_WITH_REGEX
3951 adds .o files to @LIBOBJ@.
3952 (tu_SOURCES): Add getopt.c and getopt1.c.
3953 (EXTRA_DIST): Remove getopt.c and getopt1.c.
3955 * acinclude.m4: New file -- derived from aclocal.m4.
3956 * aclocal.m4: This file is now generated by the aclocal program
3957 (which comes with the automake package.)
3959 Sun Aug 4 10:50:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
3961 * checks/: New directory.
3962 * checks/Makefile.am: New file.
3963 * configure.in (AC_OUTPUT): Add new directories: checks,
3965 * Makefile.am (SUBDIRS): Likewise.
3967 Sat Jul 27 17:22:14 1996 Jim Meyering <meyering@na-net.ornl.gov>
3969 * src/system.h (bindtextdomain) [!ENABLE_NLS]: Undefine to avoid
3970 redefinition warnings on solaris.
3971 (textdomain) [!ENABLE_NLS]: Likewise.
3973 Thu Jul 25 23:06:35 1996 Jim Meyering <meyering@na-net.ornl.gov>
3975 * src/unexpand.c (unexpand): Move EOF check to follow code that
3976 processes and generates output for pending spaces. Before
3977 `printf ' ' |unexpand -t 1,2' generated no output.
3979 * src/md5sum.c (md5_check): Remove parameter, BINARY.
3980 Rename local TYPE_FLAG to BINARY, so md5_file uses the binary mode
3981 from the input stream rather than the one from the command line.
3982 (main): Fail with a diagnostic if --binary or --text is specified
3983 when verifying checksums.
3984 Reported by Eli Zaretskii <eliz@is.elta.co.il>.
3986 Sun Jul 21 11:58:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
3988 * configure.in: Add check for error_at_line so systems with
3989 GNU libc don't compile and link with distributed error.c.
3990 * lib/Makefile.am (tu_SOURCES): Remove error.c.
3991 (EXTRA_DIST): Add error.c.
3993 * configure.in (AC_REPLACE_FUNCS): Replace getline.c.
3994 Add related check for the getdelim function.
3995 From Ulrich Drepper -- as done in gettext.
3997 Sat Jul 20 15:59:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
3999 * configure.in (PACKAGE_VERSION): Use space instead of hyphen to
4000 separate PACKAGE and VERSION.
4002 * aclocal.m4 (AM_SANITY_CHECK_CC): New macro. Derived from
4003 macros from Bruno Haible and from Cygnus.
4004 * configure.in (AM_SANITY_CHECK_CC): Use it.
4006 Wed Jul 17 00:30:28 1996 Jim Meyering <meyering@na-net.ornl.gov>
4008 * install-sh: Get version with MIT copyright.
4010 Tue Jul 16 00:09:37 1996 Jim Meyering <meyering@na-net.ornl.gov>
4012 * aclocal.m4 (fp_C_PROTOTYPES): Improved version from
4014 Update all other macros to reference $fp_cv_prog_cc_stdc, rather
4015 than $ac_cv_prog_cc_stdc.
4017 * src/od.c (OFF_T_MAX): Remove definition.
4018 (main): Compare against LONG_MAX rather than OFF_T_MAX.
4020 Mon Jul 15 23:42:57 1996 Jim Meyering <meyering@na-net.ornl.gov>
4022 * Many files: Update FSF address.
4024 Sun Jul 14 16:53:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
4026 * src/unexpand.c (unexpand): Fix bug that contributed to endless loop
4027 when invoking `echo ' ' |unexpand -t 1,2': use print_tab_index, not
4028 tab_index in inner flush_pend: while loop. From Keith Owens
4029 <kaos@audio.apana.org.au>.
4031 * src/unexpand.c [HAVE_LIMITS_H]: Include limits.h for INT_MAX.
4032 [!INT_MAX]: Define it.
4033 (main): Append INT_MAX to command-line-specified tab list to
4034 ensure termination in unexpand's inner loop.
4035 Derived from a patch from Keith Owens.
4037 Thu Jul 11 22:04:36 1996 Jim Meyering <meyering@na-net.ornl.gov>
4041 * configure.in (VERSION): Bump to 1.19.
4043 Wed Jul 10 22:57:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
4045 * aclocal.m4 (fp_PROG_CC_STDC): Include sys/stat.h in test program
4046 so that DYNIX/ptx V4.1.3 doesn't use `-Xc -D__EXTENSIONS__' -- with
4047 those options on that system, sys/stat.h gets compile errors.
4048 With help from Marcus Daniels.
4050 * getopt.c: Update from gettext-0.10.23.
4051 * getopt1.c: Likewise.
4052 * getopt.h: Likewise.
4054 Tue Jul 9 18:07:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
4056 * src/fmt.c (MAXCOST): Use `(unsigned long)1' rather than `(COST)1'
4057 so the left operand of the << isn't signed.
4058 From Kjetil Torgrim Homme.
4060 * po/Makefile.in.in (install-data): Don't install NLS files when
4061 they're not requested. From Ulrich Drepper. Reported by
4062 Kjetil Torgrim Homme <kjetilho@ifi.uio.no>.
4064 Fri Jul 5 21:55:58 1996 Jim Meyering <meyering@na-net.ornl.gov>
4066 * po/Makefile.in.in ($(PACKAGE).pot): Merge from gettext-0.10.23.
4067 * ABOUT-NLS: Likewise.
4069 * aclocal.m4: Likewise.
4071 Thu Jul 4 07:24:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
4073 * src/uniq.c (usage): Remove space before newline in usage message.
4075 * src/md5sum.c (MIN_DIGEST_LINE_LENGTH): New macro.
4076 [NEWLINE_REPLACEMENT_STRING*]: Remove macros.
4077 (main): Output a leading backslash for a line describing a file
4078 whose name contains a newline. Then translate each NEWLINE byte
4079 in the file name to the string, "\\n", and each backslash to "\\\\".
4080 File names that don't contain NEWLINE aren't translated.
4081 (split_3): Rewrite to handle file names with embedded newlines.
4082 Miles Bader and Jim Blandy suggested this new encoding scheme.
4084 * src/md5sum.c (md5_file): Replace obsolete comment with a description
4086 (md5_check): Don't use "s"-adding trick to form the plural of
4087 `checksum.' That doesn't work well with translation.
4088 Suggestions from Ulrich Drepper.
4089 (split_3): Add missing semicolon so it compiles. From Jim Blandy.
4091 Wed Jul 3 23:21:09 1996 Jim Meyering <meyering@na-net.ornl.gov>
4093 * src/md5sum.c (split_3): Correct test for 35-byte line to accomodate
4094 fact that leading blanks may be stripped.
4096 Tue Jul 2 21:51:40 1996 Jim Meyering <meyering@na-net.ornl.gov>
4098 * configure.in (ALL_LINGUAS): Add dutch (nl).
4100 Mon Jul 1 23:50:19 1996 Jim Meyering <meyering@na-net.ornl.gov>
4102 * src/md5sum.c [NEWLINE_REPLACEMENT_STRING]: Define.
4103 (split_3): Translate NL bytes not to NUL, but to
4104 NEWLINE_REPLACEMENT_STRING.
4105 Suggested by Ulrich Drepper.
4106 (main): Translate back to NL-containing filename.
4108 Sun Jun 30 22:42:17 1996 Jim Meyering <meyering@na-net.ornl.gov>
4110 * src/md5sum.c (split_3): Take an additional parameter, S_LEN.
4112 Map translated NEWLINE-containing filename back into the original
4113 NEWLINE-containing name.
4114 (md5_check): Translate NEWLINE bytes to NUL bytes in filename.
4116 Sat Jun 29 18:59:07 1996 Jim Meyering <meyering@na-net.ornl.gov>
4118 * configure.in (PACKAGE_VERSION): Add `GNU ' prefix so it
4119 appears in the output of --version. Reported by RMS.
4121 Wed Jun 26 21:35:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
4123 * src/Makefile.am (LDADD): Remove sort-specific hack to link
4125 * aclocal.m4 (AM_FUNC_STRTOD): New macro.
4126 * configure.in (AM_FUNC_STRTOD): Use it.
4127 (AC_REPLACE_FUNCS): Remove strtod.
4128 Suggested by Tom Tromey.
4130 * po/Makefile.in.in (install-data): Add `else true;' to avoid
4131 letting failing if-condition cause make failure.
4132 From Fred Fish (fnf@ninemoons.com).
4134 Tue Jun 25 21:55:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
4138 Tue Jun 18 20:43:20 1996 Jim Meyering <meyering@na-net.ornl.gov>
4140 * aclocal.m4: Update from gettext-0.10.20.
4141 * ABOUT-NLS: Likewise.
4144 Thu Jun 13 22:31:39 1996 Jim Meyering <meyering@na-net.ornl.gov>
4146 * configure.in (VERSION): Bump to 1.18a.
4148 * po/Makefile.in.in ($(PACKAGE).pot): Reapply change of May 30.
4149 Depend on POTFILES only when using maintainer mode.
4151 * intl/*: Update from gettext-0.10.18.
4153 Tue Jun 11 23:32:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
4157 * po/Makefile.in.in: Update from gettext-0.10.17.
4159 * ABOUT-NLS: Likewise.
4161 Mon Jun 10 18:22:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
4163 * Makefile.am (cvs-dist): Use -c option in cvs tag command.
4165 Fri Jun 7 22:06:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
4167 * configure.in (VERSION): Set to 1.18.
4169 * src/Makefile.am (sort_LDADD): Set this to -lm to get pow when using
4170 the strtod supplied with this package. Otherwise, linking failed on
4171 Solaris-2.4 systems. Reported by Wayne Stewart <wstewa@atl.com>.
4173 Thu Jun 6 21:57:08 1996 Jim Meyering <meyering@na-net.ornl.gov>
4175 * po/Makefile.in.in: Update from gettext-0.10.16.
4177 * ABOUT-NLS: Likewise.
4178 * aclocal.m4 (AC_REPLACE_GNU_GETOPT): Move definition to precede
4179 gettext-related ones.
4180 Update from gettext-0.10.16.
4182 Fri May 31 22:04:51 1996 Jim Meyering <meyering@na-net.ornl.gov>
4186 * Makefile.am (EXTRA_DIST): Set to texinfo.tex so that file is
4189 Thu May 30 00:07:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
4193 * tail.c (main): Interpret the old-style +VALUE and -VALUE options
4194 like -c VALUE and -c +VALUE (resp) when VALUE has one of the [bkm]
4195 suffix multipliers. This makes the code consistent with --help
4196 output. Reported by Karl Heuer.
4198 * sort.c (limfield): #ifdef-out a block of code that makes
4199 GNU sort incompatible with Unix sort when a key-end spec refers
4200 to the N'th character in a field that has fewer than N characters.
4201 The POSIX spec doesn't appear to specify behavior for this case.
4204 * po/Makefile.in.in (stamp-cat-id): Avoid using temp filename
4205 longer than 14 characters.
4206 (mostlyclean): Likewise.
4209 * po/Makefile.in.in ($(PACKAGE).pot): Depend on POTFILES only
4210 when using maintainer mode. Reported by Karl Heuer.
4212 * po/Makefile.in.in (.po.mo): Reenable dependency and rule.
4213 It is required when using native NLS, e.g. on Solaris.
4214 From Marcus Daniels.
4216 * od.c (decode_one_format): Use %lu (not %d) printf format
4217 corresponding to unsigned long, SIZE.
4221 * intl/Makefile.in (installcheck): New target.
4222 * po/Makefile.in.in (installcheck): New target.
4224 * od.c (decode_one_format): Take another parameter.
4225 Give a specific diagnostic for invalid format spec here rather
4226 than an overly general one from caller's caller.
4227 (decode_format_string): Update caller.
4228 (main): Don't give diagnostic here when decode_format_string fails.
4229 Remove assertions that could fail on some Crays because they don't
4230 have a two-byte type.
4231 Johan Danielsson (joda@pdc.kth.se) reported the failed assertions.
4233 Mon May 27 17:43:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
4235 * cat.c (main): Use STDIN_FILENO and STDOUT_FILENO instead of
4236 less portable fileno (stdin) and fileno (stdout).
4237 * sort.c (main): Use STDIN_FILENO instead of less portable
4240 Mon May 20 21:50:23 1996 Jim Meyering (meyering@na-net.ornl.gov)
4242 * Makefile.am (distcheck): Remove target and rule -- automake-0.33
4243 adds it automatically.
4245 Sun May 19 13:15:49 1996 Jim Meyering (meyering@na-net.ornl.gov)
4247 * configure.in (LINGUAS): Add ko.
4248 * Makefile.am (distcheck): Remove @MAINT@ prefix from first command.
4250 Thu May 16 22:18:41 1996 Jim Meyering (meyering@na-net.ornl.gov)
4252 * Makefile.am (distcheck): New target. From Gord Matzigkeit.
4254 Fri May 10 20:46:13 1996 Jim Meyering (meyering@na-net.ornl.gov)
4256 * po/Makefile.in.in (all-yes): Always depend on CATALOGS. Otherwise
4257 they won't be built and install could fail. From Ulrich Drepper.
4258 (.po.mo): Disable dependency and rule when not in maintainer mode.
4260 * aclocal.m4 (ud_WITH_NLS): Make DATADIRNAME and CATOBJEXT depend
4261 on whether we're using GNU gettext. From Ulrich Drepper.
4263 Wed May 8 21:10:43 1996 Jim Meyering (meyering@na-net.ornl.gov)
4265 * intl/Makefile.in (distdir): Renamed from dist. For compatibility
4267 * po/Makefile.in.in (distdir): Likewise.
4269 * po/Makefile.in.in (all-yes): Depend on GMOFILES.
4270 Depend on CATALOGS and GMOFILES files only in maintainer mode.
4272 Tue May 7 22:10:20 1996 Jim Meyering (meyering@na-net.ornl.gov)
4274 * configure.in: Require autoconf-2.10.
4276 * aclocal.m4 (jm_MAINTAINER_MODE): New macro.
4277 * configure.in (jm_MAINTAINER_MODE): Use it.
4279 Sat May 4 20:40:01 1996 Jim Meyering (meyering@na-net.ornl.gov)
4281 * configure.in (LINGUAS): Add de.
4282 * po/de.po: New file.
4284 * memcasecmp.c [IN_CTYPE_DOMAIN]: Rename from ISASCII.
4285 * regex.c [IN_CTYPE_DOMAIN]: Likewise.
4286 * system.h [IN_CTYPE_DOMAIN]: Likewise.
4288 Sun Apr 28 17:10:03 1996 Jim Meyering (meyering@na-net.ornl.gov)
4290 * fmt.c (copy_rest): Don't copy past end of prefix. Output
4291 trailing spaces if the prefix had any. Before, fmt would
4292 improperly output NUL bytes. The command
4293 perl -e 'print "| S";' |fmt -p' | '|tr '\0' @
4294 output `|@S'. Reported by François Pinard.
4296 * sort.c (main): Give a better diagnostic for `sort -0'.
4297 Reported by Karl Berry.
4299 * configure.in: Make fp_C_PROTOTYPES precede AC_C_INLINE.
4300 Otherwise, some systems lose because the value AC_C_INLINE choses
4301 with plain `cc' is different from that chosen when using the ANSI-mode
4302 C compiler. From Kaveh Ghazi.
4304 Tue Apr 23 22:05:35 1996 Jim Meyering (meyering@na-net.ornl.gov)
4306 * aclocal.m4 (AC_REPLACE_GNU_GETOPT): New macro.
4307 * configure.in: Use it.
4308 * lib/Makefile.am (tu_SOURCES): Remove getopt.c and getopt1.c.
4309 (EXTRA_DIST): Add getopt.c and getopt1.c
4311 * src/*.c, src/*.h: Update Copyright years to include 1996.
4313 Sun Apr 21 08:04:51 1996 Jim Meyering (meyering@na-net.ornl.gov)
4315 * getline.c: New version from gettext-0.10.12.
4316 * getline.h: Likewise.
4317 * configure.in (AC_CHECK_FUNCS): Add getdelim.
4318 Suggested by Ulrich Drepper.
4320 * md5sum.c (md5_check): Remove spurious newline at end of error
4323 * od.c (decode_one_format): Use printf's L modifier for long doubles,
4324 not `l'. From Eric Backus.
4326 * Makefile.am (LDADD): Put @INTLLIBS@ before package library.
4328 * od.c: Include <values.h>.
4329 [!BITSPERBYTE]: Define.
4330 [OFF_T_MAX]: Use BITSPERBYTE, not 8, and cast the result to off_t.
4331 * configure.in (AC_CHECK_HEADERS): Add values.h.
4333 Fri Apr 19 23:48:53 1996 Jim Meyering (meyering@na-net.ornl.gov)
4335 * Makefile.am (cvs-dist): New rule. Based on the one from
4336 Tom Tromey's automake.
4338 Thu Apr 18 22:13:14 1996 Jim Meyering (meyering@na-net.ornl.gov)
4340 * tail.c (main): Make code clearer: use new variable `n_files' in
4341 place of `argc - optind'. Use `file' instead of `argv + optind'.
4343 Sat Apr 13 13:08:29 1996 Jim Meyering (meyering@na-net.ornl.gov)
4345 * lib/Makefile.am (noinst_HEADERS): Include memcasecmp.h,
4348 * memcasecmp.c: Unprotoize.
4352 * join.c (decode_field_spec): Rename local variable `valid'
4353 to invalid (and reverse sense) to avoid conflict with the
4354 macro definition in /usr/include/locale.h on SunOS 4.1.3.
4356 Tue Apr 9 22:43:57 1996 Jim Meyering (meyering@na-net.ornl.gov)
4358 * uniq.c: Add new option --ignore-case (-i).
4359 Include memcasecmp.h.
4360 (different): Compare with memcasecmp if ignoring case.
4363 * join.c (memcasecmp): Remove static definition of function.
4364 Include memcasecmp.h instead.
4366 * memcasecmp.c: New file.
4367 * memcasecmp.h: New file.
4368 * lib/Makefile.am (tu_SOURCES): Add memcasecmp.c.
4369 (noinst_HEADERS): Add memcasecmp.h.
4371 Thu Apr 4 17:05:33 1996 Jim Meyering (meyering@na-net.ornl.gov)
4373 * tr.c: The following commands all failed unnecessarily.
4374 tr -cs '[:upper:]' '[X*]'
4375 tr -dcs '[:lower:]' n-rs-z
4376 tr -ds '[:xdigit:]' [:alnum:]'
4377 tr -dcs '[:alnum:]' [:digit:]'
4379 Reported by Ross Ridge (ross@worf.mks.com).
4380 (validate): Add missing conjunct (translating) in test for
4381 `translating and complementing character classes' error. Before,
4382 valid uses of tr could fail. E.g. `tr -dcs '[:cntrl:]' '[:alnum:]''.
4383 (homogeneous_spec_list): New function.
4384 (validate): Use it to relax the old (overly restrictive) restriction
4385 that prohibited use of complemented character classes when translating.
4386 Now, that is allowed as long as the translation maps many to one.
4387 (get_spec_stats): Rename and redefine global has_char_class from
4390 Wed Apr 3 07:08:57 1996 Jim Meyering (meyering@na-net.ornl.gov)
4392 * aclocal.m4: Update NLS macros from gettext-0.10.11.
4394 * src/Makefile.am (INCLUDES): Add -I$(srcdir) to get system.h
4395 when srcdir != builddir. From Kaveh Ghazi.
4397 Wed Mar 27 23:33:36 1996 Jim Meyering (meyering@na-net.ornl.gov)
4399 * cksum.c (cksum): Use format "%lu %ld" (instead of "%10lu %8ld")
4400 to be POSIX compliant. From Stephen Gildea <gildea@x.org>.
4402 Sun Mar 24 08:47:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4404 * join.c (main): Use EXIT_FAILURE, not 2, as exit code in error call.
4405 * od.c (skip, main): Likewise.
4406 * tr.c (main): Likewise.
4408 * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c fold.c head.c
4409 join.c md5sum.c nl.c od.c paste.c pr.c split.c sum.c tac.c tail.c
4410 tr.c unexpand.c uniq.c wc.c: Exit with status EXIT_SUCCESS or
4411 EXIT_FAILURE, rather than 0 or 1.
4413 Sat Mar 23 23:14:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4415 * system.h [EXIT_FAILURE]: Undefine and define to 1 also if it
4416 is defined to zero. Suggested by Paul Eggert.
4418 * sort.c [SORT_FAILURE]: New macro.
4419 Be careful to exit with 1 only when -c is used and the
4420 input is not properly sorted. In all other cases, use
4421 SORT_FAILURE as required by POSIX.
4422 (main): Change some `error (1, ...' to use SORT_FAILURE.
4423 Upon successful termination, exit with EXIT_SUCCESS instead of `0'.
4424 Replace all uses of `2' (as exit code) with SORT_FAILURE.
4426 Thu Mar 21 22:47:50 1996 Jim Meyering (meyering@na-net.ornl.gov)
4428 * csplit.c: Include assert.h, but disable assertions.
4429 (process_line_count): Replace if-abort with a slightly relaxed
4430 assertion. Before, `echo |csplit - 1 1' would abort.
4431 Reported by Samuli.Karkkainen@hut.fi.
4432 (parse_patterns): Disallow uses like `csplit FILE 0' with zero
4433 line number, `csplit FILE 2 1' with decreasing line numbers, and
4434 warn about uses like `csplit FILE 3 3' that have equal line numbers.
4436 * sort.c (main): Declare to be of type int, not void.
4437 From Peter Seebach <seebs@taniemarie.solon.com>.
4438 * cat.c cksum.c comm.c csplit.c cut.c expand.c fold.c head.c join.c
4439 nl.c paste.c pr.c split.c sum.c tac.c tail.c tr.c unexpand.c uniq.c
4440 wc.c (main): Likewise.
4442 Sat Mar 16 16:30:07 1996 Jim Meyering (meyering@na-net.ornl.gov)
4444 * configure.in (PACKAGE_VERSION): New macro.
4445 * acconfig.h (PACKAGE_VERSION): Add it.
4446 * src/Makefile.am: Remove rules for generating version.c.
4447 Remove references to version.o, version.h, and stamp-v.
4448 * version.c: Remove file.
4449 * version.h: Remove file.
4450 * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c fold.c
4451 head.c join.c md5sum.c nl.c od.c paste.c pr.c sort.c split.c
4452 sum.c tac.c tail.c tr.c unexpand.c uniq.c wc.c: Don't include
4454 (main): Use PACKAGE_VERSION instead of version_string.
4456 Mon Mar 11 16:07:08 CST 1996 Jim Meyering (meyering@na-net.ornl.gov)
4458 * sort.c (write_bytes): Renamed from xfwrite.
4459 Remove SIZE parameter. It was always 1. Update all callers.
4460 Rename NELEM parameter to N_BYTES and change its type to size_t.
4462 Sat Mar 9 13:30:12 1996 Jim Meyering (meyering@na-net.ornl.gov)
4464 * cat.c cksum.c comm.c csplit.c cut.c expand.c fmt.c
4465 fold.c head.c join.c md5sum.c nl.c od.c paste.c pr.c sort.c
4466 split.c sum.c tac.c tail.c tr.c unexpand.c uniq.c wc.c (main):
4467 Initialize for internationalized message support: call setlocale,
4468 bindtextdomain, and textdomain.
4469 * system.h: Add definitions and includes for NLS.
4470 * Makefile.am (SUBDIRS): Add intl and po.
4471 * src/Makefile.am (datadir): Define.
4472 (localedir): Define.
4473 (DEFS): Add LOCALEDIR definition.
4474 (LDADD): Add @INTLLIBS@.
4475 * aclocal.m4: Add NLS-related macro definitions from
4476 gettext distribution.
4477 * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_LC_MESSAGES,
4478 HAVE_STPCPY): New macros.
4479 Add PACKAGE and VERSION.
4480 * configure.in (PACKAGE): Define with AC_DEFINE_UNQUOTED.
4481 (VERSION): Likewise.
4482 (ALL_LINGUAS): Define.
4483 (AC_CHECK_HEADERS): Add float.h.
4484 (ud_GNU_GETTEXT): Use it.
4486 (AC_OUTPUT): Reflect addition of two new directories, intl and po.
4488 From François Pinard.
4490 * tr.c (star_digits_closebracket): Declare formal param, IDX,
4491 and local I to be of type size_t (rather than int) to avoid
4492 warnings from gcc -Wall.
4494 Wed Feb 28 20:32:48 1996 Jim Meyering (meyering@na-net.ornl.gov)
4496 * src/Makefile.am: Adapt for automake-0.30.
4497 (noinst_HEADERS): Rename from HEADERS.
4498 (INCLUDES): Remove -I.. and -I$(srcdir). automake-0.30 adds these
4499 to DEFS automatically.
4500 * lib/Makefile.am: (noinst_HEADERS): Rename from HEADERS.
4502 Wed Feb 21 18:56:27 1996 Jim Meyering (meyering@na-net.ornl.gov)
4504 * join.c (xfields) [without -t]: Ignore leading blanks.
4505 From David Dyck (dcd@tc.fluke.COM).
4507 Sun Feb 18 12:07:27 1996 Jim Meyering (meyering@na-net.ornl.gov)
4509 * join.c [TOLOWER]: Define.
4510 (usage): Briefly describe new --ignore-case (-i) option.
4511 (memcasecmp): New function.
4512 (main): Set IGNORE_CASE for -i.
4513 (keycmp): Compare with memcasecmp if IGNORE_CASE is set.
4514 Suggestion and an initial patch from Alberto Accomazzi
4515 <alberto@cfa0.harvard.edu>.
4517 Sat Feb 17 18:54:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4519 * sort.c: Add -z option. Change all occurrences of '\n' to `eolchar'.
4520 (usage): Describe it.
4521 (main): Set eolchar to 0 for -z.
4522 From Mark W. Eichin <eichin@cygnus.com>.
4524 Fri Feb 16 21:44:14 1996 Jim Meyering (meyering@na-net.ornl.gov)
4526 * join.c (main): Mark two strings for translation.
4527 * md5sum.c (md5_check): Mark a string for translation.
4528 From François Pinard.
4530 Mon Feb 12 21:12:28 1996 Jim Meyering (meyering@na-net.ornl.gov)
4532 Update for automake-0.29.
4533 * Makefile.am (CONFIG_HEADER): Don't define. Automake now does it.
4534 * src/Makefile.am: Likewise.
4535 * lib/Makefile.am: Likewise.
4536 * doc/Makefile.am (info_TEXINFOS): Renamed from TEXINFOS.
4537 * man/Makefile.am (man_MANS): Renamed from MANS.
4539 * fmt.c [TRUE]: Undefine before defining to avoid warning on NeXT.
4541 From Derek Clegg (dclegg@next.com).
4543 Sat Feb 3 16:20:40 1996 Jim Meyering (meyering@na-net.ornl.gov)
4547 Wed Jan 31 23:26:13 1996 Jim Meyering (meyering@na-net.ornl.gov)
4549 * tail.c (dump_remainder): Flush stdout when tailing-forever on
4550 multiple files. From Carlos Canau <Carlos.Canau@relay.puug.pt>.
4552 Fri Jan 5 18:30:28 1996 Jim Meyering (meyering@na-net.ornl.gov)
4554 * aclocal.m4: For SVR4 systems, use -Xc -D_POSIX_C_SOURCE in CFLAGS,
4555 not just -Xc. From François Pinard.
4557 * doc/Makefile.am (DIST_OTHER): Don't set to mdate-sh. mdate-sh is
4558 distributed automatically. From Tom Tromey.
4560 Thu Jan 4 20:32:52 1996 Jim Meyering (meyering@na-net.ornl.gov)
4562 * nl.c: Include rx.h after limit.h (not before) to avoid warning
4563 about the redeclaration of RE_DUP_MAX in limit.h. rx.h protects
4564 its definition. From Kaveh Ghazi.
4566 * src/Makefile.am (DIST_OTHER): Include md5-test.rfc so make check
4567 works again. Reported by François Pinard and Kaveh Ghazi.
4569 * rx.c [SYNTAX]: Rename from SYNTAX_TABLE.
4570 [SYNTAX_TABLE]: Remove extern dcl of re_syntax_table.
4571 (RE_SEARCH_2_FN): Cast string1 and string2 to avoid pointer type
4572 mismatch errors from e.g. SunOS's /bin/cc.
4573 Reported by Kaveh Ghazi.
4575 Wed Jan 3 23:34:39 1996 Jim Meyering (meyering@na-net.ornl.gov)
4577 * configure.in (VERSION): Set variable directly rather than from
4579 * Makefile.am (DIST_OTHER): Remove VERSION.
4580 * src/Makefile.am (version.c): Depend on Makefile, not ../VERSION.
4581 (stamp-v): New target; depend on Makefile.
4582 (DISTCLEANFILES): Add stamp-v, version.c.
4584 Tue Jan 2 00:08:08 1996 Jim Meyering (meyering@na-net.ornl.gov)
4586 * sort.c (keycompare): Rewrite cases handling ignored characters
4587 so that they really are ignored. Reported by Carl Johnson
4588 <carlj@cjlinux.home.org>.
4590 Fri Dec 22 21:34:55 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
4592 * configure.in: Touch stamp-h only if config.h is remade.
4594 * csplit.c (extract_regexp) [!WITH_REGEX]: Intialize
4595 syntax_parens field.
4597 Mon Dec 18 21:42:44 1995 Jim Meyering (meyering@comco.com)
4599 Use automake to generate Makefile.in files.
4600 * Makefile.am: New file.
4601 * doc/Makefile.am: New file.
4602 * lib/Makefile.am: New file.
4603 * man/Makefile.am: New file.
4604 * src/Makefile.am: New file.
4606 Thu Dec 14 21:13:22 1995 Jim Meyering (meyering@comco.com)
4608 * fmt.c (main): Use xstrtol instead of atoi.
4610 * fold.c (main): Use xstrtol instead of atoi.
4611 (fold_file): Make a couple locals `int', not size_t, and cast
4612 fwrite's third parameter to size_t.
4614 * nl.c (main): Use xstrtol instead of atoi.
4615 Rename misleading --first-page=N option to --starting-line-number=N.
4618 * uniq.c (main): Use xstrtol instead of atoi.
4620 Fri Dec 8 20:48:00 1995 Jim Meyering (meyering@comco.com)
4622 * aclocal.m4 (fp_C_PROTOTYPES): Set ANSI2KNR to ./ansi2knr.
4624 Thu Dec 7 19:55:03 1995 Jim Meyering (meyering@comco.com)
4626 * aclocal.m4 (ud_WITH_REGEX): New macro.
4627 * configure.in: Use it.
4628 * rx.c, rx.h: New files.
4629 * lib/Makefile.in (REGEX): Set to @REGEXOBJ@, not regex.o.
4630 (SOURCES, DISTFILES): Add rx.c, rx.h.
4631 * acconfig.h (WITH_REGEX): Add it.
4632 * csplit.c [!WITH_REGEX]: Include rx.h.
4633 * nl.c [!WITH_REGEX]: Likewise.
4634 * tac.c [!WITH_REGEX]: Likewise.
4635 From Ulrich Drepper and François Pinard.
4637 Tue Dec 5 17:49:53 1995 Jim Meyering (meyering@comco.com)
4639 * sort.c (main): Diagnose invalid arguments to -k, then fail.
4641 * sort.c (numcompare): Properly handle all cases in which signs differ.
4644 * Makefile.in (mandir): @mandir@ is just $(prefix)/man.
4645 Append `/man1'. Reported by Karl Heuer.
4647 * sum.c (bsd_sum_file): Remove misleading comment. From Karl Heuer.
4649 * src/Makefile.in [.c._o]: Don't create $<-tmp. From Kaveh Ghazi.
4651 Fri Dec 1 01:02:36 1995 Jim Meyering (meyering@comco.com)
4653 * lib/Makefile.in (default): New target.
4655 * sort.c (numcompare): Properly order `-' and valid integers;
4656 treat `-' as if it were zero. Reported by Ross Alexander
4657 <r.alexander@auckland.ac.nz>.
4659 * Makefile.in (DISTFILES): Remove unused mkdep-Makefile.
4660 (.PHONY): Depend on default.
4662 Wed Nov 29 21:50:53 1995 Jim Meyering (meyering@comco.com)
4664 * aclocal.m4 (jm_PROG_C_MKDEP): Remove, for now.
4665 (jm_AUTODEPS): Likewise.
4666 (jm_WITH_GNU_MAKE): Likewise.
4667 * configure.in (jm_AUTODEPS): Remove.
4669 * sort.c (begfield): Replace loop with equivalent if-else.
4670 (limfield): Fix bug that made field specs like -k1.5 return a
4671 pointer into LINE beyond the first field.
4672 Don't try to trim trailing blanks here; it's not
4673 possible because we don't know where the field begins.
4674 Replace loop with equivalent if-else.
4675 (trim_trailing_blanks): New function.
4676 (findlines): Call it.
4677 (keycompare): Likewise.
4678 (main): Don't decrement T2 corresponding to `x' in field
4679 specs like -ku.v,w.x.
4681 Sun Nov 26 15:50:23 1995 Jim Meyering (meyering@comco.com)
4683 * csplit.c [!UINT_MAX]: Define.
4686 (string_to_number): Remove function.
4687 (check_for_offset): Use xstrtoul instead of string_to_number.
4688 (parse_repeat_count): Likewise.
4689 (parse_patterns): Likewise.
4692 Wed Nov 22 23:12:47 1995 Jim Meyering (meyering@comco.com)
4694 * Makefile.in (all et. al.): If make was invoked with -k and a
4695 sub-make fails, fail after the loop rather than exiting right away.
4696 Otherwise, make's -k option could be ineffective.
4698 Sat Nov 18 12:04:30 1995 Jim Meyering (meyering@comco.com)
4700 * src/Makefile.in (version.c): Depend on ../VERSION, not Makefile.
4702 Update for autoconf-2.5:
4703 * src/Makefile.in (libdir): Set to @libdir@.
4704 (bindir): Set to @bindir@.
4705 * doc/Makefile.in (infodir): Set to @infodir@.
4706 * man/Makefile.in (exec_prefix): Remove it.
4707 (mandir): Set to @mandir@.
4708 (bindir): Remove it.
4710 Thu Nov 16 21:25:45 1995 Jim Meyering (meyering@comco.com)
4712 * Makefile.in (default): New default target. Depend on `all' to
4713 work around bug in AIX-3.2.5's /bin/make. Reported by Andreas Luik
4716 Wed Nov 15 23:48:31 1995 Jim Meyering (meyering@comco.com)
4718 * mkdep-Makefile (.deps/empty.P): Depend on BUILT-HEADERS.
4720 * aclocal.m4 (jm_PROG_C_MKDEP): Rename from jm_PROG_MKDEP.
4721 * src/Makefile.in (C_MKDEP): Rename from MKDEP.
4722 * lib/Makefile.in (C_MKDEP): Likewise.
4723 * mkdep-Makefile (C_MKDEP): Likewise.
4726 * csplit.c [__P]: Don't define it here.
4727 * pr.c [__P]: Don't define it here.
4728 * fmt.c [__P]: Don't define it here.
4729 * system.h [__P]: Define it here.
4731 * aclocal.m4 (jm_AUTODEPS): Rename from jm_WITH_AUTODEPS.
4732 Revamp, with suggestions from Franc,ois Pinard.
4733 (jm_WITH_GNU_MAKE): New macro.
4734 (jm_PROG_MKDEP): New macro.
4735 * configure.in (jm_PROG_MKDEP): Use it.
4736 * src/Makefile.in (MKDEP): Set it.
4737 * lib/Makefile.in (MKDEP): Likewise.
4738 * mkdep-Makefile: Use MKDEP, not DEP_CC.
4739 (DEP_CFLAGS): Remove it.
4741 Tue Nov 14 23:10:54 1995 Jim Meyering (meyering@comco.com)
4743 * sort.c: Add support for sorting numbers in scientific notation.
4745 (struct keyfield): Add field: general_numeric.
4746 (usage): Describe -g option.
4747 (general_numcompare): New function.
4748 (keycompare): Use new comparison function when general_numeric
4750 (set_ordering): Honor `g' flag.
4751 (main): Initialize and use new field.
4752 From Marcus Daniels <marcus@sysc.pdx.edu>.
4754 * configure.in (AC_REPLACE_FUNCS): Add strtod.
4755 * lib/Makefile.in (SOURCES): Add xstrtod.c.
4756 (OBJECTS): Add xstrtod.o.
4757 (DISTFILES): Add xstrtod.h.
4759 * csplit.c (cleanup): Don't exit.
4760 (interrupt_handler): Rewrite to reset default signal handler
4761 then repost caught signal.
4762 (xmalloc, xrealloc, read_input, write_to_file, handle_line_error,
4763 process_line_count, process_regexp, create_output_file,
4764 close_output_file): Call cleanup_fatal, not cleanup.
4765 Add const attribute to lots of parameters.
4766 (cleanup_fatal): Renamed from cleanup. Call cleanup, then exit.
4769 * tac.c: (cleanup): Don't exit.
4770 (cleanup_fatal): New function. Call cleanup, then exit.
4771 (sighandler): New function.
4772 (cleanup_fatal): Renamed from cleanup. Call cleanup, then exit.
4774 (tac_stdin): Set up sighandler as signal handler, not `cleanup'.
4776 Sat Nov 11 15:46:02 1995 Jim Meyering (meyering@comco.com)
4778 * od.c (skip): Cast fseek's offset argument to `long'.
4779 Erik Bennett <bennett@cvo.oneworld.com> reported that this is
4780 necessary on BSDI systems. And if offset doesn't fit in a long,
4781 then try using lseek instead.
4783 * sort.c (xmalloc): Declare static.
4784 (xrealloc): Likewise.
4786 * tac.c (cleanup): Add signal number parameter.
4789 * cat.c (main): Don't die when dev/ino of input and output are
4790 the same and the file descriptors correspond to stdin and stdout.
4791 This is necessary on at least Digital UNIX (aka OSF1) 3.2C.
4792 Otherwise, running `cat << X > $$' would fail with `cat: -: input
4793 file is output file'. From Jarkko Hietaniemi <jhi@epsilon.hut.fi>.
4795 * Makefile.in (DISTFILES): Add @README_ALPHA@.
4796 (config.status) Depend on VERSION.
4797 * configure.in: Set README_ALPHA if the version number ends in [a-z].
4799 Fri Nov 10 21:13:42 1995 Jim Meyering (meyering@comco.com)
4801 * fold.c (usage): Clarify meaning of --spaces. From Karl Berry.
4803 src/Makefile.in (.c._c): Don't redirect directly to $@.
4804 (._c._o, .c._o): Remove temporary src file.
4806 Tue Nov 7 23:55:24 1995 Jim Meyering (meyering@comco.com)
4808 * VERSION: New file.
4809 * configure.in (VERSION): New variable.
4810 (PACKAGE): New variable.
4812 * Makefile.in (DISTFILES): Add VERSION.
4813 (distdir): Use @PACKAGE@-@VERSION@, not distname.
4814 Remove all references to distname.
4815 * src/Makefile.in (version.c): Generate it.
4816 (SOURCES): Remove now-generated version.c.
4817 (distclean): Delete version.c.
4818 * doc/Makefile.in (version.texi): Use @PACKAGE@-@VERSION@,
4821 * */Makefile.in (distdir): Use @PACKAGE@-@VERSION@, not distname.
4822 Remove all references to distname.
4824 * split.c: New option: --verbose.
4825 (main): Recognize it.
4826 (usage): Document it.
4827 From Marty Leisner <leisner@sdsp.mc.xerox.com>.
4829 Sun Nov 5 06:59:27 1995 Jim Meyering (meyering@comco.com)
4831 * src/Makefile.in: Reflect protoization of csplit.c, fmt.c, pr.c,
4835 (store_columns): Remove spurious 2nd argument in call to read_line.
4836 [__P]: Define. Use it in prototyped forward decls.
4838 * csplit.c: Move prototypes after struct declarations.
4839 Remove prototypes for xmalloc, xrealloc.
4840 Protect prototypes with __P.
4841 (new_control_record): Cast arg 1 to realloc.
4843 * fmt.c [__P]: Test PROTOTYPES, not __STDC__.
4846 Sat Nov 4 23:51:30 1995 Jim Meyering (meyering@comco.com)
4848 * csplit.c (close_output_file): Set output_stream to NULL so we
4849 don't recurse endlessly between this function and cleanup.
4851 * unexpand.c: Reorder functions to obviate forward dcls. Remove
4852 forward dcls. Protoize. Add `const' attribute to some parameters.
4854 Mon Oct 30 23:15:56 1995 Jim Meyering (meyering@comco.com)
4856 * wc.c: Reorder functions to obviate forward dcls. Remove
4857 forward dcls. Protoize. Add `const' attribute to some parameters.
4859 * split.c: Likewise.
4861 * split.c (isdigits, convint): Remove these.
4862 (main): Use xstrtol instead.
4864 Sun Oct 29 14:04:36 1995 Jim Meyering (meyering@comco.com)
4866 * paste.c (main): Move function body to end of file.
4867 Remove forward dcls and protoize.
4868 * sum.c (main): Likewise.
4869 * nl.c: Protoize. Reorder functions to obviate forward dcls.
4870 Remove forward dcls.
4872 * src/Makefile.in (OBJECTS): Reflect that all of the above
4875 * sum.c (bsd_sum_file): Give file name parameter const attribute.
4876 (sysv_sum_file): Likewise.
4878 * tac.c (xwrite): Give output buffer parameter const attribute.
4879 (output): Likewise for both parameters.
4880 (tac): Likewise for file name parameter.
4881 (tac_file): Likewise.
4883 Sat Oct 28 16:02:39 1995 Jim Meyering (meyering@comco.com)
4885 * md5sum.c (md5_check): Use the same message format when there is
4886 a single file and it gets a read error or checksum mismatch as when
4887 there are more. Write that warning to standard error, not standard
4888 output. Suggestions from Greg Troxel (gdt@b-sgi.bbn.com).
4890 Thu Oct 26 00:11:35 1995 Jim Meyering (meyering@comco.com)
4892 * sort.c (xtmpfopen): New function to set proper permissions on
4893 temporary files. Use it instead of xfopen. Reported by Erik Corry
4894 (erik@kroete2.freinet.de).
4896 Mon Oct 23 23:17:04 1995 Jim Meyering (meyering@comco.com)
4898 * aclocal.m4 (jm_WITH_AUTODEPS): New directive.
4899 * configure.in: Use it.
4901 * lib/Makefile.in (INCLUDE, COMPILE): New variables.
4902 (.c.o): Rewrite to be more like src/Makefile.in.
4904 * src/Makefile.in (distclean): Remove .deps.
4905 Include @top_srcdir@/mkdep-Makefile.
4907 * mkdep.Makefile: New file.
4908 * Makefile.in (DISTFILES): Add mkdep-Makefile.
4909 * doc/Makefile.in (mostlyclean): Also remove *.info.
4911 Thu Oct 19 17:38:28 1995 Jim Meyering (meyering@comco.com)
4913 * od.c: Indent cpp directives.
4915 * tr.c (BEGIN_STATE): Use INT_MAX - 1 so as not to interfere
4916 with large repeat counts.
4917 (struct E_string): New struct.
4918 (find_closing_delim): Take E_string arg rather than char* and length.
4919 (find_bracketed_repeat): Likewise.
4920 (star_digits_closebracket): New function.
4921 (append_char_class): No longer give diagnostic.
4922 (append_equiv_class): Likewise.
4923 (build_spec_list): Give them here instead, allowing string1 like
4924 [:*][:upper:] that got errors before.
4925 Take E_string arg rather than char*.
4926 Convert switch stmts into if-then so as to use ES_MATCH.
4928 Tue Oct 17 22:48:00 1995 Jim Meyering (meyering@comco.com)
4930 * cat.c: Protoize. Reorder functions to obviate forward dcls.
4931 Remove forward dcls.
4932 * expand.c: Likewise.
4939 * src/Makefile.in (OBJECTS): Reflect that all of the above
4942 * head.c: Add `const' attribute to dcls of lots of formals.
4944 * sort.c: Add `const' attribute to dcls of lots of formals.
4945 Move struct dcls to precede dcls of file-scope variables.
4946 (monthtab, keyhead): Separate variable dcls from type dcls.
4948 Fri Oct 13 20:38:39 1995 Jim Meyering (meyering@comco.com)
4950 * join.c (add_field_list): Allow SPACE and TAB as well as `,' as
4951 list item separators, per POSIX spec.
4952 (prjoin): Rewrite loop that iterates over field specs.
4953 Handle case in which file spec is 0.
4955 Sun Oct 8 22:41:15 1995 Jim Meyering (meyering@comco.com)
4957 * strpbrk.c: New file.
4958 * lib/Makefile.in (SOURCES): Add strpbrk.c.
4961 Sat Oct 7 22:27:01 1995 Jim Meyering (meyering@comco.com)
4963 * join.c (add_field): No longer return a value.
4964 (decode_field_spec): New function.
4965 (add_field_list): Rewrite to be more strict.
4966 Before, `,1.2' was accepted as valid.
4967 (main): Use xstrtol instead atoi.
4968 Combine nearly identical -a and -v cases.
4971 Fri Oct 6 23:10:01 1995 Jim Meyering (meyering@comco.com)
4973 * join.c (main): Report `too few/many non-option arguments'
4974 then print --help output rather than just the latter.
4975 Properly interpret obsolescent usage like `join -o 2.1 2.1 2.2'.
4976 (usage): Describe POSIX -1, -2 options and deprecate -j* ones
4978 * join.c (usage): Move to precede all other functions.
4982 Tue Oct 3 22:44:05 1995 Jim Meyering (meyering@comco.com)
4984 * csplit.c, sort.c, tac.c: Test SA_INTERRUPT, not _POSIX_VERSION,
4985 to determine whether `sigaction' functions are available.
4986 Reported by Paul Nevai <nevai@ops.mps.ohio-state.edu>.
4987 Fix suggested by Karl Berry.
4989 * md5sum.c (main): Declare counter, N_STRINGS, to be an integral
4992 * cut.c: Convert many declarations using `int' to use `unsigned int'
4993 to avoid warnings from `gcc -Wall' about comparing signed and
4995 (set_fields): Use memset (not open coded loop) to initialize array.
4997 Thu Sep 28 23:16:05 1995 Jim Meyering (meyering@comco.com)
5001 * Makefile.in (DISTFILES): Remove README.alpha for major release.
5003 * od.c (decode_one_format): Remove spurious semicolon.
5006 Tue Sep 26 23:05:01 1995 Jim Meyering (meyering@comco.com)
5008 * man/Makefile.in (install-data, uninstall): Use sed not basename.
5009 The GNU Coding Standard suggests that only a select set of
5010 relatively standard utilities be used in Makefiles. basename is
5011 not among them. Suggested by Ulrich Drepper.
5013 Sun Sep 24 08:36:47 1995 Jim Meyering (meyering@comco.com)
5015 * cksum.c: Protoize.
5018 * src/Makefile.in (OBJECTS): Reflect that cksum.c and cut.c use
5020 (cksum): Depend on cksum$O.
5021 (cut): Depend on cut$O.
5023 Sat Sep 23 15:43:46 1995 Jim Meyering (meyering@comco.com)
5027 * Makefile.in (DISTFILES): Add README.alpha.
5029 * lib/Makfile.in: (GETOPT, MEMCHR, REGEX): New variables.
5030 (OBJECTS): Use them instead of hardcoding object file names.
5031 Suggested by Ulrich Drepper.
5033 * md5sum.c (md5_check): Distinguish between open/read failure
5034 and checksum mismatch.
5036 Mon Sep 18 23:15:05 1995 Jim Meyering (meyering@comco.com)
5038 * md5sum.c: Protoize.
5039 * src/Makefile.in (OBJECTS): Change md5sum.o to md5sum$O.
5040 (join.o, md5sum$O, sort.o) Depend on ../lib/long-options.h.
5041 (md5sum): Depend on md5sum$O.
5043 * md5sum.c (main, usage): Remove -h, -s, -v short options.
5044 Rename --verbose to --warn, --quiet to --status.
5045 (main): Handle --help and --version using parse_long_options.
5046 (md5_check): Check ferror.
5048 * sort.c (tempname): Replace `16' with a more readable expansion.
5049 Make sure that counter never exceeds 99999.
5050 (checkfp): Rearrange loop to avoid duplicate test.
5051 Move a couple dcls from function scope into inner block.
5053 Tue Aug 8 21:49:27 1995 Jim Meyering (meyering@comco.com)
5055 * md5sum.c (main): Fail if either --verbose or --quiet is specified
5056 when not verifying checksums.
5058 * md5sum.c (md5_check): Fail if no valid line is found.
5059 Don't use the word `fail' unless there were failures --
5060 instead, say `all N tests passed.'
5062 * md5sum.c (main) [handling --string option]: Don't output
5063 nonstandard `b' binary flag. From Greg Troxel (gdt@bbn.com).
5064 * md5-test.rfc: Remove now-inconsistant `b' marker.
5065 (usage): Clarify help message. With suggestions from Greg Troxel.
5067 Mon Aug 7 23:27:54 1995 Jim Meyering (meyering@comco.com)
5069 * sort.c (mergefps) [lint]: Initialize SAVEALLOC to avoid spurious
5070 compiler warning. From Ulrich Drepper.
5072 * pr.c (read_line) [lint]: Initialize CHARS to avoid spurious
5073 compiler warning. From Ulrich Drepper.
5075 * Makefile.in (DISTFILES): Don't distribute unneeded COPYING.LIB.
5078 Mon Aug 7 00:02:59 1995 Jim Meyering (meyering@comco.com)
5080 * system.h (_): Define macro -- as empty for now.
5081 * src/*.c: Annotate localizable strings with _(...). From Franc,ois.
5083 Sat Aug 5 23:51:25 1995 Jim Meyering (meyering@comco.com)
5087 * configure.in: Add fp_C_PROTOTYPES.
5089 Fri Aug 4 23:21:46 1995 Jim Meyering (meyering@comco.com)
5091 * src/Makefile.in (DISTFILES): Include ansi2knr.c and ansi2knr.1.
5092 Add suffixes, dependencies, and rules to convert ANSI source to K&R
5093 when required. Mark tr.o and comm.o as the only such files (for now).
5098 * Makefile.in (DISTFILES): Add aclocal.m4 and acconfig.h.
5099 (configure): Depend on aclocal.m4.
5100 (stamp.h.in): Depend on aclocal.m4 and acconfig.h.
5102 Sun Jul 30 00:01:58 1995 Jim Meyering (meyering@comco.com)
5104 * md5sum.c (md5_check): Use getline instead of fgets.
5106 * lib/Makefile.in: (SOURCES): Add getline.c.
5107 (OBJECTS): Add getline.o.
5108 (DISTFILES): Add getline.h.
5109 (getline.o): Depend on getline.h.
5111 * md5.c [memcpy]: Define to bcopy if needed.
5112 (md5_buffer): Explicitely cast SWAP expressions to unsigned
5115 * lib/Makefile.in (strtoul.o): Depend on strtol.c.
5117 * sort.c (check): Print `disorder on...' message on standard error,
5118 not stdout. This is a minor concession to POSIX which says
5119 `no output shall be produced...'.
5121 * sort.c (main): Fix -k so it works. -k 2,3 was being treated
5122 like -k 2. Reported by Marcus Daniels <marcus@sysc.pdx.edu>.
5124 Wed Jul 26 22:54:48 1995 Jim Meyering (meyering@comco.com)
5126 * man/Makefile.in (install, uninstall): Strip off `.1', not just `1'
5127 before applying $(transform) to manual name. From Karl Berry.
5129 * md5sum.c (have_read_stdin): New global variable.
5130 (md5_file, md5_check): Set it.
5133 * md5sum.c [OPENOPTS]: Depend explicitly on BINARY.
5134 (md5_file): Take a new parameter, MD5_RESULT, and no longer
5136 (md5_check): Invoke md5_file instead of calling fopen directly.
5137 When giving a diagnostic for a line with invalid format, also report
5139 (main): Generate output after a successful md5_file call.
5140 [in many places]: Upon detection of an error, rather than exiting
5141 immediately, issue a diagnostic, note that an error occurred and
5144 Mon Jul 24 21:48:26 1995 Jim Meyering (meyering@comco.com)
5146 * tail.c (tail_bytes) [from_start]: For regular files, seek
5147 relative to the initial input file pointer position, not
5148 necessarily from the beginning of the file.
5149 [!from_start]: Don't back up past the initial position of the
5151 (tail_lines): Call file_lines only if FD refers to a regular file
5152 with its file pointer positioned at beginning of file. Otherwise,
5153 call pipe_lines. This is a kludge. Once there's a decent test
5154 suite, fix this properly.
5155 Before, (echo 1; echo 2) > k; sh -c 'read x; tail' < k
5156 would output both lines of the input file even though the first had
5157 already been read. Reported by John Roll (john@panic.harvard.edu).
5159 * md5sum.c [_LIBC || STDC_HEADERS] (TOLOWER): Define to tolower.
5161 * csplit.c (main): When too few arguments are given, don't just
5162 issue the usage message; also report why.
5164 Sat Jul 22 00:16:01 1995 Jim Meyering (meyering@comco.com)
5166 * md5sum.c (md5_check): New function -- extracted from main.
5168 Fri Jul 21 01:21:49 1995 Jim Meyering (meyering@comco.com)
5170 * md5sum.c (md5_file): New function -- extracted from main.
5171 (main): Call the new function instead of doing all that in an
5172 if-stmt. Always use "%s" format rather than raw filename as
5173 format argument in printf-style functions like error. Otherwise,
5174 filenames containing `%' are likely to lose.
5175 Remove all mention of `old format'.
5176 (split_3): No longer parse the `new format.' There is only one
5177 valid format now: the compatible one.
5179 * lib/Makefile.in: (SOURCES): Add md5.c.
5180 (OBJECTS): Add md5.o.
5181 (DISTFILES): Add md5.h.
5182 (md5.o): Depend on md5.h.
5184 * system.h [!EXIT_FAILURE, !EXIT_SUCCESS]: Define them.
5185 * lib/md5.c (md5_stream): Check for read failure and return
5186 indication of success rather than second argument.
5187 * lib/md5.h (md5_stream): Update prototype.
5188 [__P]: Define macro.
5189 * md5sum.c: Use EXIT_FAILURE and EXIT_SUCCESS.
5190 (main): Report an error if md5_stream fails. Otherwise, running
5191 `md5sum dir-on-mounted-filesystem' always reported the checksum
5192 for an empty file. Now it gets the `is a directory' error.
5193 Greg McGary (gkm@magilla.cichlid.com) reported that the released
5194 version got stuck in an infinite loop with such arguments.
5196 * lib/md5.c: New file.
5197 * lib/md5.h: New file.
5198 * md5sum.c: Rewritten to use library interface.
5199 From Ulrich Drepper.
5201 Sun Jul 16 18:42:34 1995 Jim Meyering (meyering@comco.com)
5203 * configure.in: Add AC_C_INLINE: md5sum.c uses inline keyword.
5205 Tue Jul 11 21:56:02 1995 Jim Meyering (meyering@comco.com)
5207 * md5sum.c Add #else block after #ifdef VMS.
5208 (main): Rename local variable.
5209 Detect and report failed fclose calls on stdout and checkfile_stream.
5211 * tr.c (unqote): Comment out unreachable break stmts.
5212 (append_range): Declare FIRST and LAST parameters to be unsigned int,
5214 (find_closing_delim): Clean up interface, separating boolean success
5215 indicator and index.
5216 (find_bracketed_repeat): Likewise.
5217 (build_spec_list): Adapt to use new interfaces.
5218 Declare CLOSING_DELIM_IDX and CLOSING_BRACKET_IDX to be of
5219 type size_t, not int.
5220 (main): Declare NR and CHARS_READ to be of type long, not int.
5222 * sort.c (main): Comment out unreachable break stmt.
5224 * tail.c (tail): Explicitly cast to long the N_UNITS argumennt in
5225 call to tail_lines. Otherwise, NetBSD lost because N_UNITS (of type
5226 off_t, a 64-bit type on NetBSD) wasn't converted to the target type,
5227 long. Reported by Dan Hagerty (hag@gnu.ai.it.edu).
5229 * comm.c: Reorder functions so main is last, so no forward dcls
5232 Sun Jul 9 11:41:15 1995 Jim Meyering (meyering@comco.com)
5234 * sort.c (main): When using obsolescent +pos -pos syntax, allow
5235 omission of field spec only when character offset is specified.
5236 Otherwise, -. +. would be accepted.
5238 Sat Jul 8 13:48:06 1995 Jim Meyering (meyering@comco.com)
5240 * sort.c (main): Allow field spec, M, to be omitted in +M.N or -M.N
5241 position specification. For compatibility with existing practice
5242 (what vendors?), omitting M is now equivalent to specifying `0' for M,
5243 but only when using the +pos -pos syntax, not with the -k option.
5244 From Rick Sladkey (jrs@world.std.com).
5246 Thu Jul 6 23:44:20 1995 Jim Meyering (meyering@comco.com)
5248 * od.c (dump): Correct loop-termination criterion.
5249 Before, running `printf 1234| ./od --width=4 --read-bytes=4'
5250 printed output for 8 bytes -- the last four were garbage.
5251 This happened only when the dump limit, N, was specified (with
5252 --read-bytes=N) and N was a multiple of bytes_per_block
5253 (usually 16, but 4 in this example). From Andreas Schwab.
5255 Sun Jul 2 22:12:40 1995 Jim Meyering (meyering@comco.com)
5257 * lib/Makefile.in (check): Depend on libtu.a.
5259 * md5sum.c (split_3): Rewrite to parse Plumb/Lankester format as well.
5260 (main): Print each sum line in (de facto) standard Plumb/Lankester
5262 New option: --quiet.
5263 Check option no longer takes an argument.
5264 When checking, exit status reflects success.
5266 Sat Jun 24 16:18:01 1995 Jim Meyering (meyering@comco.com)
5268 * md5sum.c [__GNUC__]: Don't conditionalize use of "inline".
5269 Autoconf (via config.h) defines it away for compilers that don't
5272 * cat.c, comm.c, join.c, sort.c, uniq.c: Undefine min/max before
5273 defining to avoid redefinition warning on some systems.
5275 * csplit.c (read_input): Rename paramater MAX to MAX_N_BYTES.
5276 This avoids potential conflict with max macro from some system's
5277 header files when using bad pre-ANSI compilers.
5279 * uniq.c (usage): Fix typo in text of --help output.
5280 From Steve McConnel <steve@acadcomp.sil.org>
5282 * md5sum.c [uint32]: When testing for 32-bit arithmetic type,
5283 also check `unsigned long', as a concession to systems with
5284 int's smaller than 32 bits.
5286 * configure.in (AC_REPLACE_FUNCS): Remove memcmp (again!) since
5287 AC_FUNC_MEMCMP already handles it. This avoids warnings from
5288 ranlib on nextstep systems. From Kaveh Ghazi.
5290 * csplit.c (interrupt_handler): Declare to have a single integer
5291 parameter. Otherwise, some compilers fail with a type mismatch
5292 error in sa_handler assignment.
5294 * fmt.c [word]: Redefine. Otherwise, systems (Unicos for one) with
5295 headers that typedef `word' get syntax errors because of the
5296 variable by the same name.
5298 * join.c [join]: Redefine to avoid conflict with prototype in some
5299 system header file. Also for Unicos.
5301 * md5sum.c (main): Remove spurious colon in getopt spec string.
5302 From Ken Pizzini <kenp@spry.com>.
5304 Tue Jun 20 06:59:16 1995 Jim Meyering (meyering@comco.com)
5306 * md5sum.c (md5_file): Initialize two elements of LEN portably,
5307 rather than with ANSI aggregate initialization. Reported by
5308 Edzer Pebesma <Edzer.Pebesma@rivm.nl>.
5310 Sun Jun 18 09:15:57 1995 Jim Meyering (meyering@comco.com)
5314 * md5sum.c (process_buffer): Copy values from struct into
5315 individual local variables before performing computation on them,
5316 then copy results back into returned struct. Solely for better
5317 optimization by compilers that can't keep struct members in
5318 registers. From Ulrich Drepper.
5320 Thu Jun 15 22:09:14 1995 Jim Meyering (meyering@comco.com)
5322 * md5sum.c: Remove unnecessary uses of `defined' in #if* tests.
5323 Don't use #elif. Some older compilers don't grok it.
5324 (split_3): New function to parse out sum, flag, and filename
5325 when reading check file.
5326 (hex_digits): Remove length parameter since string parameter is
5328 (main): Don't allocate separate arrays for filename and sum
5329 when checking. Get pointers into line buffer with split_3 instead
5331 (main): Treat `no file args' just like `-' when not checking
5333 (hex_digits): Unprotoize.
5335 * md5sum.c (main): Don't use a separate loop to convert to lower
5336 case. Suggested by Ulrich Drepper.
5339 From Ulrich Drepper.
5341 * md5sum.c: Don't include values.h.
5344 * md5sum.c: [UNIX || unix]: Also test __UNIX__, __unix__,
5345 and _POSIX_VERSION. Reported by Arne H. Juul.
5347 Tue Jun 13 21:20:10 1995 Jim Meyering (meyering@comco.com)
5349 * tr.c [NDEBUG]: Define it to disable assertions. Some systems
5350 have a broken <assert.h> header.
5351 (is_char_class_member): Set a variable in each branch of switch
5352 stmt and return that value after the switch (rather than returning
5353 directly from every branch).
5354 (unquote): More int->size_t changes.
5355 (build_spec_list): More int->size_t changes.
5356 Be very careful about comparison now that variables are unsigned:
5357 Use i + 2 < len rather than i < len - 2. The latter didn't work
5358 for len < 2. Caught early thanks to a thorough regression test
5361 Mon Jun 12 23:07:59 1995 Jim Meyering (meyering@comco.com)
5363 * sort.c (xfclose): Don't try to flush stdin, only stdout.
5364 Otherwise, at least Ultrix-4.3's fflush would return EOF.
5365 Reported by Jim Blandy (jimb@cyclic.com).
5367 * tr.c (non_neg_strtol): Don't compare signed and unsigned.
5368 [struct Spec_list] (indefinite_repeat_element): New member.
5369 Use size_t rather than int or unsigned long where reasonable.
5370 (get_spec_status): Make interface cleaner.
5371 (get_s1_spec_status): New function.
5372 (get_s2_spec_status): New function.
5373 (validate): Use new functions instead of get_spec_status.
5375 Sun Jun 11 00:39:50 1995 Jim Meyering (meyering@comco.com)
5377 * md5sum.c: New file. From Ulrich Drepper.
5378 * md5-test.rfc: New file.
5379 * Makefile.in: (PROGS): Add md5sum.
5380 (check): Run a recursive make in each subdirectory.
5381 * man/Makefile.in: (MANFILES): Add md5sum.1.
5382 * src/Makefile.in: (SOURCES): Add md5sum.c.
5383 (OBJECTS): Add md5sum.o.
5384 (PROGS): Add md5sum.
5385 (check): Add basic checks for md5sum.
5386 (md5sum): Add dependency and link rule.
5387 (DISTFILES): Add md5-test.rfc.
5389 * tr.c (look_up_char_class, append_char_class, append_equiv_class):
5390 Use const attribute when appropriate.
5392 Sun May 28 14:48:58 1995 Jim Meyering (meyering@comco.com)
5394 * join.c: Overhauled to make -a1 and -a2 options work.
5395 Passed all tests in a fairly thorough test suite.
5396 Reported by Michael Hasselberg (mikelh@zonta.ping.de).
5398 Sat May 27 00:35:47 1995 Jim Meyering (meyering@comco.com)
5400 * tail.c (main): Remove dcl of and statements that set now-unused
5403 * system.h [!STDC_HEADERS && HAVE_MEMORY_H]: Include memory.h.
5404 Without this, SunOS doesn't get type for memchr.
5405 Reported by Kaveh Ghazi.
5407 Thu May 25 00:06:50 1995 Jim Meyering (meyering@comco.com)
5409 * tail.c (tail_lines): Change one more `long' to `off_t'.
5410 Otherwise, tail didn't work on NetBSD. From Arne H. Juul.
5412 * csplit.c [struct control]: Change type of `repeat' to unsigned
5413 long to avoid conversion warning.
5415 Sun May 21 07:50:00 1995 Jim Meyering (meyering@comco.com)
5417 * Makefile.in (.PHONY): TAGS is not a phony target. From Franc,ois.
5419 * xstrtol.c (__strtol): Remove prototype altogether.
5420 Move inclusion of xstrtol.h back so that it follows system headers.
5424 Sat May 20 06:44:14 1995 Jim Meyering (meyering@comco.com)
5426 * join.c (ADD_FIELD): Declare in K&R style, not ANSI.
5429 * xstrtol.c: Define NDEBUG for systems with losing assert.h.
5430 (__strtol): Add __unsigned to prototype and use __P.
5431 Move inclusion of xstrtol.h to precede prototype.
5434 * memmove.c: Include config.h for definition of const.
5437 * All Makefile.in (install-exec, install-exec): New targets.
5440 * tr.c (look_up_char_class): Take a string length argument -- required
5441 because the argument is a string that is *not* NUL-terminated.
5442 Use strncmp, not strcmp and add string lengths comparison.
5443 (append_char_class): Update caller. Before this change,
5444 tr '[:upper:]' '[:lower:]' read one uninitialized byte.
5445 From Andreas Schwab.
5447 * split.c (next_file_name): Move dcls of file-scope variables into
5448 this function. Don't rely on arithmetic being two's complement.
5450 * paste.c [CLOSED, ENDLIST]: Don't cast constants to FILE pointers.
5451 Instead, declare two FILE structs and use their addresses.
5453 * csplit.c (record_line_starts): Remove set-but-not-used,
5454 file-scope variable.
5456 Sat May 13 08:57:20 1995 Jim Meyering (meyering@comco.com)
5458 * all source files (usage): Include one- or two-line synopsis
5459 in --help output. From Karl Berry.
5461 * lib/Makefile.in [.c.o]: Remove -I. since safe-l?stat.h are no
5464 Wed May 10 22:26:35 1995 Jim Meyering (meyering@comco.com)
5468 Sun May 7 13:35:49 1995 Jim Meyering (meyering@comco.com)
5470 * all Makefile.in (maintainer-clean): Renamed from realclean
5473 Thu May 4 23:15:58 1995 Jim Meyering (meyering@comco.com)
5475 * sort.c (main): Use stat, not safe_stat. The latter was unnecessary.
5476 Don't include safe-stat.h.
5478 * lib/Makefile.in (DISTFILES): Remove safe-xstat.hin.
5479 Remove all associated rules. safe-l?stat.h are no longer used.
5481 * sort.c Don't hard-code /tmp.
5482 [DEFAULT_TMPDIR]: Use this instead.
5483 * tac.c (save_stdin): Likewise.
5485 * sort.c (set_ordering): Properly parse arguments like `+x.yn'.
5486 Reported by John Salmon (johns@mullet.anu.edu.au).
5487 Patch from Mike Haertel.
5489 Wed Apr 26 23:48:13 1995 Jim Meyering (meyering@comco.com)
5491 * sort.c (tempname): AND-off high bits of pid so that its decimal
5492 string representation is no longer than five digits.
5493 From Hans Verkuil (hans@wyst.hobby.nl).
5495 Thu Apr 20 23:09:33 1995 Jim Meyering (meyering@comco.com)
5497 * expand.c (add_tabstop): Give correct size when reallocating
5498 tab_list buffer. From Geoff Odhner (geoff@franklin.com).
5499 Reproduce with expand --t=`perl -e "print join (',', (1..300));"`.
5501 Tue Apr 18 22:57:43 1995 Jim Meyering (meyering@comco.com)
5503 * configure.in: (AC_OUTPUT): Use echo, not date, to avoid creating
5504 unnecessary conflicts for people using version control software
5506 (AC_ARG_PROGRAM): Use it.
5508 Thu Apr 13 23:22:57 1995 Jim Meyering (meyering@comco.com)
5510 * head.c: Remove block of redundant comments describing options.
5511 (usage): Remove reference to -l option. It's not valid.
5513 * od.c (write_block): Declare index I as unsigned int, not int.
5514 (get_lcm): Likewise.
5515 (dump_strings): Likewise.
5517 (dump): Cast BYTES_PER_BLOCK to off_t in MIN expression.
5518 (dump_strings): Declare bufsize to be of type size_t, not int.
5520 * split.c (next_file_name): Don't reuse X as an index.
5521 Declare new variable I instead.
5523 Sat Mar 25 15:07:23 1995 Jim Meyering (meyering@comco.com)
5525 * csplit.c: Declare as `unsigned int' all variables that were
5527 (make_filename): Change type of arg to unsigned int.
5528 (split_file): Change type of indices to unsigned int.
5530 Thu Mar 16 22:05:05 1995 Jim Meyering (meyering@comco.com)
5532 * od.c (main): Detect and fail when argument to -N is too large
5535 Sun Mar 12 12:02:39 1995 Jim Meyering (meyering@comco.com)
5537 * configure.in (AC_REPLACE_FUNCS): Add memcmp.c.
5538 Remove check for sizeof long.
5540 * linebuffer.h: Undefine __P before defining it.
5541 * long-options.h: Likewise.
5542 * xstrtol.h: Likewise.
5544 * memcpy.c: New file.
5545 * lib/Makefile.in (SOURCES): Add memcpy.c.
5547 Fri Mar 10 21:14:11 1995 Jim Meyering (meyering@comco.com)
5549 * src/*.c: Update Copyright dates.
5551 Sat Feb 11 07:31:08 1995 Jim Meyering (meyering@comco.com)
5553 * system.h: Remove index/rindex and bcmp/bcopy/bzero references.
5554 Separate errno declaration from STDC_HEADERS.
5556 * wc.c (wc): For efficiency, handle separately the cases in which
5557 words need not be counted. Suggested by Karl Heuer.
5559 * wc.c (wc): Don't overcount the number of bytes when reading
5560 from a regular file on stdin with file pointer not at BOF.
5561 From Karl Heuer <karl@gnu.ai.mit.edu>. Before, the command
5562 `(dd ibs=99k skip=1; wc -c) < /etc/group' made wc wrongly output
5563 the size of the file. Now it outputs `0'.
5565 Sat Jan 28 07:07:23 1995 Jim Meyering (meyering@comco.com)
5567 * cat.c (cat): Use memmove rather than bcopy.
5568 * csplit.c (load_buffer): Use memcpy rather than bcopy.
5569 (extract_regexp): Use strrchr, not rindex.
5570 * fmt.c (isopen, isclose, isperiod): Use strchr, not index.
5571 (flush_paragraph): Use memmove instead of bcopy.
5572 * fold.c (fold_file): Use memmove instead of bcopy.
5573 * od.c (decode_format_string): Use memmove instead of bcopy.
5574 [EQUAL_BLOCKS]: Use memcmp, not bcmp.
5575 (parse_old_offset): Use strchr, not index.
5576 (dump): Use memset, not bzero.
5577 * sort.c (checkfp, mergefps): Use memcpy instead of bcopy.
5578 (fillbuf): Use memmove instead of bcopy.
5579 * split.c (main): Use memset, not bzero.
5580 (line_bytes_split): Use memmove instead of bcopy.
5581 * tac.c (tac): Use memmove instead of bcopy.
5582 (output): Use memcpy instead of bcopy.
5583 * tail.c (pipe_lines, pipe_bytes): Use memcpy instead of bcopy.
5584 * tr.c (substr): Use memcpy instead of bcopy.
5585 (card_of_complement, set_initialize): Use memset, not bzero.
5587 * tr.c (substr): Don't allocate a byte for trailing NUL in result
5588 since the result needn't be NUL-terminated. Don't NUL terminate it.
5590 * configure.in (AC_REPLACE_FUNCS): Check for memmove and memcpy,
5592 (AC_CHECK_FUNCS): Add strchr and strrchr.
5594 * lib/Makefile.in (SOURCES): Add memmove.c and memcpy.c.
5595 * memmove.c: New file.
5596 * memcpy.c: New file.
5598 Tue Jan 24 22:18:19 1995 Jim Meyering (meyering@comco.com)
5600 * fmt.c (copy_rest): Replace `||' with `&&'. Before, a paragraph
5601 not followed by a newline would be followed by data copied from
5602 uninitialized storage. Repeat by `printf abc|fmt|od -ac'.
5603 Reported by Franc,ois Pinard.
5605 * od.c: Rename macros with FP_ prefix. Use FLOAT_ instead.
5606 AIX-2.2.1 declares a typedef, FP_DOUBLE, that conflicted.
5607 Be careful to use off_t instead of explicit `unsigned long'.
5608 Otherwise, systems like 4.4BSD lose on calls to fseek that
5609 expect off_t (which is long long on that system).
5610 (parse_old_offset): Use xstrtoul
5613 * src/Makefile.in (od.o, tail.o): Depend on ../lib/strtol.h.
5615 Mon Dec 19 22:13:55 1994 Jim Meyering (meyering@comco.com)
5617 * tail.c (numerous functions): Give char* filename arguments the
5620 * lib/Makefile.in (SOURCES): Remove xwrite.c. It was no longer used.
5621 Add xstrtol.c and xstrtoul.c.
5622 (OBJECTS): Likewise for .o files.
5623 (DISTFILES): Add error.h and xstrtol.h and xstrtoul.h.
5625 * lib/Makefile.in (DISTFILES): Remove safe-xstat.cin.
5626 (distclean): Remove references to safe-l?stat.c.
5627 Remove all related rules and dependencies.
5629 * src/Makefile.in: $(OBJECTS): Depend on ../lib/error.h.
5631 Thu Dec 15 23:14:04 1994 Jim Meyering (meyering@comco.com)
5633 * tail.c (tail_file): Fix call to error with %s in format, but
5634 no corresponding argument.
5636 * src/*.c: Include "error.h" instead of simply declaring
5638 * od.c (main): Use %lu, not %d for unsigned long.
5639 (my_strtoul, uint_fatal_error): Remove functions. Use xstrtoul
5640 and STRTOL_FATAL_ERROR instead.
5642 Sun Dec 11 17:24:09 1994 Jim Meyering (meyering@comco.com)
5644 * sort.c (main): Fix interpretation of field offsets when specified
5645 via -k option. They were being interpreted as zero-indexed. POSIX
5646 says they are 1-based indices. From Rik Faith <faith@cs.unc.edu>.
5647 (keycompare): Don't ignore characters at the end of words when
5648 otherwise they would compare equal. From Rik Faith.
5650 * tail.c (<most functions>): Change the type of n_units/n_lines/n_bytes
5651 to off_t because n_bytes is used as the option to fseek and off_t may
5652 be long long (e.g. on BSD4.4). The only place where a 32-bit limit is
5653 imposed is in the string-to-integer converstion of xstrtol.
5654 (main): Use xstrtol instead of manual string to integer conversion.
5656 * csplit.c (get_format_width, get_format_prec): Use ISDIGIT instead of
5657 comparisons against '0' and '9'.
5659 * tr.c [!ULONGMAX]: Define it.
5660 [!LONGMAX]: Define in terms of ULONGMAX instead of as a 32-bit constant.
5662 * full-write.c: Declare (or not) errno based on definedness or
5663 errno, not STDC_HEADERS.
5664 * safe-read.c: Likewise.
5665 * xwrite.c: Likewise.
5667 Thu Nov 17 06:37:33 1994 Jim Meyering (meyering@comco.com)
5669 * tail.c (dump_remainder): Flush standard output just before
5670 sleeping so that `tail -f' will output partial lines sooner.
5671 This applies only when following the end of a single file.
5672 From Leonard N. Zubkoff <lnz@dandelion.com>.
5674 * tail.c (file_lines, pipe_lines, pipe_bytes, start_bytes,
5675 start_lines, dump_remainder): Use STDOUT_FILENO instead of `1' in
5677 * tac.c (output): Use STDOUT_FILENO instead of `1' in xwrite call.
5678 * system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Define if
5679 not already defined.
5681 Wed Nov 16 07:01:38 1994 Jim Meyering (meyering@comco.com)
5683 * tr.c: Include <getopt.h> instead of "getopt.h".
5685 * sort.c (tempname): Merge two very similar sprintf stmts into one.
5687 * tail.c: Use BUFSIZ instead of BUFSIZE.
5689 * cut.c: Declare DELIM to be `int' rather than unsigned char.
5691 * fmt.c: Use index, not strchr -- per GNU Standards.
5692 Reported by Kaveh Ghazi.
5693 Always include <config.h>.
5694 (main): Include program name in --version output.
5696 Sun Nov 06 00:17:21 1994 Jim Meyering (meyering@comco.com)
5700 Sat Nov 05 15:14:44 1994 Jim Meyering (meyering@comco.com)
5702 * memcmp.c, srtoul.c: Use up-to-date versions.
5703 Reported by Franc,ois Pinard.
5705 * src/Makefile.in (DEFS): Remove -Dlint... again.
5707 * src/Makefile.in (PROGS): Add fmt!
5708 Reported by Andreas Stolcke (stolcke@ICSI.Berkeley.EDU).
5710 Fri Nov 04 17:26:16 1994 Jim Meyering (meyering@comco.com)
5714 Thu Nov 03 23:23:08 1994 Jim Meyering (meyering@comco.com)
5716 * linebuffer.h: Use __P instead of _P since the latter conflicts
5717 with a definition in some <ctype.h>. From Kaveh Ghazi.
5719 Wed Nov 02 17:36:34 1994 Jim Meyering (meyering@comco.com)
5721 * tr.c: Add const attribute where appropriate.
5723 * tail.c (BUFSIZ): Use definition from <stdio.h>.
5725 Tue Nov 01 23:54:09 1994 Jim Meyering (meyering@comco.com)
5727 * tail.c (XWRITE): Allow n_bytes == 0 but call fwrite only if
5728 n_bytes is positive. Turn off assertions. `tail /dev/null' was
5729 getting a failed assertion. Reported by Doug McLaren
5732 * cut.c (cut_bytes): Print at least a newline for every line of input.
5733 (cut_fields): Print a newline even for lines whose only selected
5734 field is empty. But print nothing when using -s without -f1.
5735 And print nothing for empty input. Reported by
5736 Richard_Sharman@software.mitel.com.
5738 Tue Nov 01 06:05:23 1994 Jim Meyering (meyering@comco.com)
5740 * fmt.c: Change #ifdef __STDC__ to #if defined (__STDC__) && __STDC__.
5741 * linebuffer.h: Likewise.
5743 Mon Oct 31 06:53:32 1994 Jim Meyering (meyering@comco.com)
5745 * configure.in (AC_REPLACE_FUNCS): Remove memcmp since AC_FUNC_MEMCMP
5746 already handles it. From Kaveh Ghazi.
5748 * {lib,src}/Makefile.in (DEFS): Don't use -Dlint. Some systems
5749 get failures when it's defined. From Kaveh Ghazi.
5751 * cat.c (cat): Conditionalize test for errno == ENOSYS. It's not
5752 defined on some Next and Alliant systems. From Kaveh Ghazi.
5754 * sort.c join.c (main): Include version.h and call parse_long_options
5755 with the proper number of arguments. Reported by Franc,ois Pinard.
5757 Sun Oct 30 01:30:41 1994 Jim Meyering (meyering@comco.com)
5759 * (configure.in): Add AC_OFF_T and rearrange by type along the
5760 same lines as autoscan.
5762 * fmt.c, fmt.1: New files.
5763 Both from Ross Paterson (rap@doc.ic.ac.uk).
5765 * Makefile.in (PROGS): Add fmt.
5766 * src/Makefile.in (SOURCES, OBJECTS): Add fmt.c and fmt.o respectively.
5767 (fmt): Add a link rule.
5768 * man/Makefile.in (MANFILES): Add fmt.1.
5770 Sat Oct 08 10:44:30 1994 Jim Meyering (meyering@comco.com)
5772 * Makefile.in (All of them): Update from the ones in sh-utils.
5773 From now on, rules and definitions that are comon to the fileutils,
5774 textutils, and sh-utils will get ChangeLog entries only in the
5777 Tue Oct 04 20:42:46 1994 Jim Meyering (meyering@comco.com)
5779 * od.c (my_strtoul): Set errno to zero before calling strtoul.
5780 Otherwise, od can fail complaining about a valid integer argument.
5781 From Andreas Schwab.
5783 Sun Oct 02 17:57:09 1994 Jim Meyering (meyering@comco.com)
5785 * tr.c (main): Give an error and fail when squeezing repeats
5786 and no non-options are given. Reported by Tony Robinson
5787 (ajr@eng.cam.ac.uk).
5789 * sort.c (main): Temporarily copy each input file that might be
5790 another name for the output file. When in doubt (e.g. a pipe),
5791 copy. This allows the dangerous (historical -- in cnews) idiom
5792 `cat file | sort -o file' to work properly. Don't rely on this
5793 behavior in new shell scripts. From Paul Eggert (eggert@twinsun.com).
5795 Mon Sep 26 18:01:47 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
5797 * lib/xwrite.c safe-read.c memchr.c linebuffer.c full-write.c:
5798 Remove CONFIG_BROKETS ifdef.
5799 * src/Makefile.in lib/Makefile.in: Don't define it.
5801 Sat Sep 24 21:26:27 1994 Jim Meyering (meyering@comco.com)
5803 * full-write.c (full_write): Declare argument LEN to be size_t.
5805 Mon Sep 12 13:35:27 1994 Jim Meyering (meyering@comco.com)
5807 * tail.c (tail_file): [For multiple files only]: Report truncation
5808 of monitored file and reset current file size. From Franc,ois Pinard.
5810 Sat Aug 27 16:57:20 1994 Jim Meyering (meyering@comco.com)
5812 * system.h [BROKEN_STAT_MACROS]: Remove unnecessary #ifdef's.
5813 From Franc,ois Pinard.
5815 Tue Jul 26 11:33:53 1994 Jim Meyering (meyering@comco.com)
5817 * system.h: Remove `|| defined(_POSIX_VERSION)' from test that
5818 decides whether to include <fcntl.h>. From Francois Pinard.
5820 Wed Jul 13 12:33:34 1994 Jim Meyering (meyering@comco.com)
5822 * tr.c (substr): Fix off-by-one allocation error.
5824 Wed Jun 22 01:02:50 1994 Jim Meyering (meyering@comco.com)
5826 * tac.c (tac_file): Use O_RDONLY instead of zero in call to open.
5827 (tac): Fix typo that had `1' as arg #2 of error after failed read.
5828 Use errno instead. From Michael I Bushnell <mib@gnu.ai.mit.edu>.
5830 Thu May 26 08:46:32 1994 Jim Meyering (meyering@comco.com)
5832 * configure.in [INSTALL]: Revert change of March 25. autoconf
5835 Mon Apr 11 17:25:43 1994 Jim Meyering (meyering@comco.com)
5837 * join.c (prline): Remove unused function. Indent.
5839 Fri May 6 05:44:24 1994 Jim Meyering (meyering@comco.com)
5841 * tail.c (tail_forever): Don't print headers when asked not to.
5842 From Karsten Thygesen <karthy@kom.auc.dk>.
5844 * wc.c (wc): Optimize for the case when only bytes are being counted
5845 and the input is not a regular file. From Jeff Moore <jbm@mordor.com>.
5847 Sun Apr 24 10:54:08 1994 Jim Meyering (meyering@comco.com)
5849 * configure.in [AC_SIZEOF_TYPE]: Update for autoconf-1.9.
5850 * memchr.c: Test SIZEOF_LONG instead of LONG_64_BITS.
5852 Mon Apr 11 17:55:52 1994 Jim Meyering (meyering@comco.com)
5854 * csplit.c (struct control): Add new field, repeat_forever.
5855 Remove now-unneeded definition of INT_MAX.
5856 (process_regexp): Test repeat_forever instead of comparing `repeat'
5858 (split_file): Don't even reference `repeat' count if repeat_forever
5860 (new_control_record): Initialize repeat_forever field.
5861 (parse_repeat_count): Set it instead of setting repeat count to
5863 (process_line_count): Abort for internal error instead of calling
5866 * long-options.c (parse_long_options): Take a new argument indicating
5867 the utility name (e.g. "join", not "gjoin") for version output.
5868 Print both the utility and the package names, e.g. `join - GNU
5869 textutils-1.9.1' instead of just the package name.
5871 * join.c (main): Call parse_long_options with program name arg.
5872 * sort.c (main): Ditto.
5874 * All source except sort.c and join.c (main): Change --version output
5875 to include utility name as well as package name and version info.
5877 Wed Mar 30 08:53:21 1994 Jim Meyering (meyering@comco.com)
5879 * configure.in: Use AC_SET_MAKE.
5880 * Makefile.in: Edit MAKE assignments into @SET_MAKE@.
5882 Mon Mar 28 09:55:05 1994 Jim Meyering (meyering@comco.com)
5884 * tr.c (main): In addition to the --help usage pointer, give an
5885 explicit error message for too many arguments.
5887 Fri Mar 25 18:11:19 1994 Jim Meyering (meyering@comco.com)
5889 * configure.in: Use AC_VERBOSE, AC_CHECKING, and AC_WARN instead
5890 of explicit echo commands.
5891 [INSTALL]: When AC_PROG_INSTALL resorts to setting this to
5892 `./install.sh', make it `../install.sh' instead since that
5893 script will be invoked only from subdirectories.
5894 [AC_SIZEOF_TYPE]: Use this instead of deprecated AC_LONG_64_BITS.
5896 * cat.c (cat): The command `:|cat -s' failed on Irix5 because
5897 ioctl (d, FIONREAD,... now returns ENOSYS for pipes -- under Irix4
5898 it returned EINVAL. Detect this.
5899 (main) [lint]: Initialize variables to suppress `used before
5900 initialized' warnings.
5902 * csplit.c: Change long option name from --suffix to --suffix-format.
5904 * od.c (skip): Correct a comment.
5905 (main): Don't output anything to stdout if the sole input file
5906 doesn't exist. Reported by Bauke Jan Douma <bjd@dds.hacktic.nl>.
5908 * od.c (dump) [lint]: Initialize a variable to suppress `used before
5909 initialized' warning.
5910 (main) [lint]: Ditto.
5911 * paste.c (paste_parallel) [lint]: Ditto.
5913 Fri Jan 28 11:02:21 1994 Jim Meyering (meyering@comco.com)
5915 * configure.in: Don't set LDFLAGS since linking now uses both
5918 Wed Jan 18 16:14:00 1994 Jim Meyering (meyering@comco.com)
5920 * unexpand.c (unexpand): Don't segfault when given a name of a
5922 * expand.c (expand): Ditto.
5923 Both from Bauke Jan Douma <bjd@dds.hacktic.nl>.
5925 Thu Jan 13 17:27:38 1994 Jim Meyering (meyering@comco.com)
5927 * src/Makefile.in: Change all link commands to use both $(CFLAGS)
5930 * csplit.c (load_buffer): Rather than incrementing buffer size,
5931 double it each time we fail to find a newline. Otherwise, csplit
5932 would run out of memory when processing files with very long lines.
5934 Mon Jan 10 01:20:38 1994 Jim Meyering (meyering@comco.com)
5936 * man/Makefile.in (manprefix): Use binprefix as the default.
5938 Sat Jan 08 22:22:45 1994 Jim Meyering (meyering@comco.com)
5940 * cat.c: Use full_write and safe_read instead of write and read resp.
5946 * sum.c: Use safe_read instead of read.
5950 * tail.c: Replace calls to xwrite with calls to fwrite.
5951 Use fopen/fclose instead of open/close.
5952 (write_header): Use a single call to printf instead of four to xwrite.
5953 Use safe_read instead of read.
5956 Tue Dec 28 15:49:32 1993 Jim Meyering (meyering@comco.com)
5958 * install.sh: New file.
5959 Makefile.in [DISTFILES]: Add it.
5961 Wed Dec 22 18:52:44 1993 Jim Meyering (meyering@comco.com)
5963 * memcmp.c: Use the latest version from the GNU C library.
5965 * cut.c [ADD_RANGE_PAIR]: New macro.
5966 (set_fields): Collect the list of all selected ranges before
5967 allocating and initializing the boolean lookup table.
5968 (cut_bytes, cut_fields): Complete rewrite. Avoid copying
5969 into buffer whenever possible. Properly handle input without
5971 (getstr): New function. Copied from getline.c, but with minor changes.
5973 * sort.c (main): Properly handle -Tdir.
5974 Before, `sort -T/var/tmp' gave `sort: unrecognized option `-v''.
5975 Reported by Kristoffer Rose (kris@diku.dk).
5977 * cut.c (main): Give separate errors for `-s without -f'
5978 and `-d without -f'.
5979 (main): Now -d '' means `use the NUL byte as the delimiter'.
5980 Before, it got an error.
5982 Mon Dec 20 23:29:30 1993 Jim Meyering (meyering@comco.com)
5984 * configure.in [test for 8-bit clean memcmp]: Add a test to detect
5985 losing memcmp from SunOS4.1.x. From Robert H. de Vries
5988 Sat Dec 18 01:12:24 1993 Jim Meyering (meyering@comco.com)
5990 * configure.in (AC_OUTPUT): Put `touch stamp-config' in second arg
5991 so it goes in config.status. This eliminates unnecessary second run
5994 Thu Dec 02 23:53:03 1993 Jim Meyering (meyering@comco.com)
5996 * configure.in (AC_HAVE_FUNCS): Add isascii.
5997 * system.h [!defined (isascii) || defined (STDC_HEADERS)]: This failed
5998 on AIX PS/2 1.3 systems because isascii is a function and it is used
5999 in definitions (with the necessary side effect of assigning to a
6000 global variable) of the is* macros. Also test HAVE_ISASCII and
6001 redefine ISASCII(c) instead of isascii.
6002 Reported by Minh Tran-Le (tranle@intellicorp.com).
6004 Fri Nov 19 22:41:48 1993 Jim Meyering (meyering@comco.com)
6006 * configure.in: Don't run the test for 8-bit clean memcmp if we
6007 already know we'll be using our replacement.
6009 Fri Nov 12 00:44:49 1993 Jim Meyering (meyering@comco.com)
6013 * tac.c (usage): Fix typo in long usage.
6014 * sort.c (usage): Likewise.
6015 From Philippe.Schnoebelen@imag.fr.
6017 * cut.c [FATAL_ERROR]: New macro.
6018 (main): Call both error and usage (2) through FATAL_ERROR in
6019 many places. Before, only `error (2...' was called.
6020 (invalid_list): Removed. This function is subsumed by FATAL_ERROR.
6022 * cut.c (cut_fields): Properly handle input lacking a terminating
6023 newline. Before, the command `printf "a\tb" |cut -f 1' generated
6026 Tue Nov 09 17:26:25 1993 Jim Meyering (meyering@comco.com)
6028 od.c (usage): Change --backward-compatible to --traditional in
6029 the long usage message.
6031 Sun Nov 07 00:50:05 1993 Jim Meyering (meyering@comco.com)
6035 Sat Nov 06 22:51:31 1993 Jim Meyering (meyering@comco.com)
6037 * cut.c (cut_fields): Revert July 27 change. Instead, strip off
6038 trailing delimiter unless given a range of fields like `3-' that
6039 extends to end of line.
6040 (set_fields): Moved local `eol_range_start' to file-scope.
6041 Reported by Arne H. Juul (arnej@solan.unit.no).
6043 Tue Nov 02 00:53:41 1993 Jim Meyering (meyering@comco.com)
6045 * fold.c (fold_file): Don't get stuck in an endless loop when
6046 width is smaller than 8 and there are TABs in the input.
6048 Sat Oct 30 15:31:28 1993 Jim Meyering (meyering@comco.com)
6050 * join.c: Remove now-unused dcls of show_help and show_version.
6052 Fri Oct 29 13:58:50 1993 Jim Meyering (meyering@comco.com)
6054 * csplit.c [INT_MAX]: Make sure it's defined.
6055 [not HAVE_LIMITS_H]: Don't include limits.h.
6056 From Kaveh R. Ghazi (ghazi@noc.rutgers.edu).
6058 Wed Oct 27 01:13:52 1993 Jim Meyering (meyering@comco.com)
6062 Mon Oct 25 20:16:33 1993 Jim Meyering (meyering@comco.com)
6064 * sort.c: Accept but ignore -y0 for compatibility with Solaris 2.
6065 From Chuck Hedrick (hedrick@klinzhai.rutgers.edu).
6067 * sort.c (main): Handle --help and --version options.
6068 * Makefile.in (sort.o): Depend on long-options.h.
6070 Sun Oct 24 00:31:02 1993 Jim Meyering (meyering@comco.com)
6072 * csplit.c, cut.c, expand.c, fold.c, head.c, nl.c, od.c, paste.c,
6073 split.c, tac.c, tail.c, unexpand.c, uniq.c: Use the preferred
6074 `--longopt=arg' syntax in --help message rather than `--longopt arg'.
6075 From Francois Pinard.
6077 * tail.c: Don't include <signal.h>. It hasn't been necessary
6078 since the Dec 12, 1992 change.
6080 * join.c (main): Accept `-v 1' again. Adding the --version
6081 long option had broken it, although -v1 still worked. Call
6082 parse_long_options instead of adding "help" and "version"
6083 to join's longopt strct.
6084 * Makefile.in [SOURCES, OBJECTS, DISTFILES]: Add long-options.c
6086 * (join): Depend on and link with long-options.o.
6087 * (join.o): Depend on long-options.h.
6089 * od.c: Change --compatible (-C) to --backward-compatible (-B).
6091 * csplit.c: Change --abandon-null-files to --elide-empty-files.
6093 Sat Oct 23 01:00:12 1993 Jim Meyering (meyering@comco.com)
6095 * tr.c (get_next, string2_extend): Add default: label to switch stmt.
6097 * cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fold.c, head.c,
6098 join.c, nl.c, od.c, paste.c, pr.c, split.c, sum.c, tac.c, tail.c,
6099 tr.c, unexpand.c, uniq.c, wc.c (usage): Add long --help.
6100 Exit successfully for --help, non-zero for usage error.
6101 From Francois Pinard.
6103 * configure.in: Add AC_STAT_MACROS_BROKEN.
6104 * system.h [AC_STAT_MACROS_BROKEN]: Test it.
6106 Fri Oct 22 23:26:17 1993 Jim Meyering (meyering@comco.com)
6108 * linebuffer.c, memchr.c [HAVE_CONFIG_H, CONFIG_BROKETS]: Include
6109 <config.h> or "config.h".
6110 * cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fold.c, head.c,
6111 join.c, nl.c, od.c, paste.c, pr.c, sort.c, split.c, sum.c, tac.c,
6112 tail.c, tr.c, unexpand.c, uniq.c, version.c, wc.c: Ditto.
6114 * configure.in: Use AC_CONFIG_HEADER.
6115 * Makefile.in [DIST]: Add config.h.in.
6117 * Makefile.in: Convert so make may be run from subdirectories.
6118 Add dependencies on config.h.
6119 * src/Makefile.in: Ditto.
6120 * lib/Makefile.in: Ditto.
6121 * man/Makefile.in: Ditto.
6123 Wed Oct 20 20:05:48 1993 Jim Meyering (meyering@comco.com)
6125 * memchr.c (memchr): Do the 32-bit assignment only if !LONG_64_BITS.
6126 In the 64-bit assignment, be careful to cast the shift operand to
6128 Abort if sizeof (unsigned long) > 8.
6130 Tue Oct 19 22:37:58 1993 Jim Meyering (meyering@comco.com)
6132 * csplit.c: Allow repeat counts to be specified via `{*}'.
6133 New option --suffix=format. Supercedes --digits option.
6134 New option --abandon-null-files.
6135 From Ronald F. Guilmette (rfg@netcom.com).
6137 * csplit.1: Updated.
6138 From Ronald F. Guilmette.
6140 * csplit.c: Remove register keyword (replace with `int' in two cases).
6142 * csplit.c: [MAX]: Macro renamed from max and moved to top of file.
6143 (bytes_to_octal_digits): New static array.
6144 (get_format_flags): Combine '+' and ' ' cases of switch stmt.
6145 Return count if for loop terminates.
6146 (get_format_width): Use `bytes_to_octal_digits' instead of just 11.
6147 (get_format_prec): Make sure is_negative is defined before used.
6148 (get_format_conv_type): Give a different error message if there
6149 is no conversion specifier.
6150 Test ISPRINT (ch) instead of `ch < '~' && ch > ' ''.
6151 (max_out): Use `%%' rather than `%' in format string.
6153 Sat Oct 16 10:45:17 1993 Jim Meyering (meyering@comco.com)
6155 * pr.c (main): When argc == 1, don't try to xmalloc (0).
6157 Tue Oct 12 00:53:26 1993 Jim Meyering (meyering@comco.com)
6159 * xwrite.c [HAVE_CONFIG_H, CONFIG_BROKETS]: Include <config.h>
6162 Sat Oct 09 23:37:43 1993 Jim Meyering (meyering@comco.com)
6164 * configure.in: Remove AC_UNISTD_H; add unistd.h to AC_HAVE_HEADERS.
6166 Thu Sep 9 21:52:10 1993 Jim Meyering (meyering@comco.com)
6168 * src/*.c: Print version on standard output, not stderr.
6170 * configure.in: Add AC_LONG_64_BITS.
6171 * memchr.c: Use #ifdef LONG_64_BITS instead of
6172 `if (sizeof(longword) > 4)'.
6174 Tue Jul 27 22:19:39 1993 Jim Meyering (meyering@comco.com)
6176 * cat.c (cat): Don't fail just because ioctl (d, FIONREAD,... can't
6177 always handle devices. Ignore errno == EINVAL and errno == ENODEV.
6178 `cat -v /dev/null' was failing on many systems.
6180 * cut.c (cut_fields): Don't strip off trailing delimiter e.g.
6181 `echo 'a:b:c:' | cut -d: -f3-' should print `c:', not just `c'.
6182 From William Dowling <will@franklin.com>.
6184 Thu May 27 01:37:51 1993 Jim Meyering (meyering@comco.com)
6188 * memchr.c: De-ansify the fixed version from glibc.
6189 It is supposed to work on systems with 64-bit long ints.
6191 Mon May 24 00:32:43 1993 Jim Meyering (meyering@comco.com)
6195 Sat May 22 02:13:12 1993 Jim Meyering (meyering@comco.com)
6199 Fri May 21 22:57:53 1993 Jim Meyering (meyering@comco.com)
6201 * pr.c (cols_ready_to_print): New function. It replaces a global
6202 variable by the same name and computes on the fly the value that
6203 was supposed to be maintained through that variable. This should
6204 put to rest the `pr -2a' bug.
6205 (main): Don't let getopt_long reorder arguments so we can
6206 distinguish between `pr -1 -2' and `pr -12'. Rework handling of
6209 * fold.c: Declare xmalloc.
6211 Wed May 19 19:12:18 1993 Karl Berry (karl@owl.hq.ileaf.com)
6213 * sort.c (main): fflush before exit, so a closed stdout doesn't lose.
6215 Tue May 18 23:49:26 1993 Jim Meyering (meyering@comco.com)
6217 * mkinstalldirs: New file.
6218 * Makefile.in (installdirs): Use it to create installation directories.
6220 Fri May 14 23:45:52 1993 Jim Meyering (meyering@comco.com)
6222 * all source: With --version, print version and exit immediately.
6224 Thu May 13 01:03:16 1993 Jim Meyering (meyering@comco.com)
6226 * Makefile.in (installdirs): New rules for creating installation
6227 directories. (install): depend on it.
6229 * tail.c (main): Remove --compatible since `+1f' may be used
6230 to get the BSD `-0f' behavior portably.
6232 * fold.c (main): Turn -N arguments, where N is a digit, into -wN.
6233 From Ian Lance Taylor (ian@cygnus.com).
6235 Mon May 10 22:33:44 1993 Jim Meyering (meyering@comco.com)
6237 * tail.c (main): New option -C, --compatible to make `tail -0f'
6238 work like `tail +1f' for compatibility with BSD tail.
6240 Thu May 6 23:28:56 1993 Jim Meyering (meyering@comco.com)
6242 * pr.c (print_page): Decrement cols_ready_to_print even when
6243 lines_to_print == 0. The command `echo |pr -2ta' *still* didn't
6244 terminate. Add parentheses for clarity.
6246 Mon May 3 23:57:47 1993 Jim Meyering (meyering@comco.com)
6250 * od.c (main): Remove set-but-not-used variable, `usage_error'.
6252 * split.c (main): Call usage with an argument.
6254 Sun May 2 16:05:04 1993 Jim Meyering (meyering@comco.com)
6256 * configure.in: Reverse if-else branches in AC_TEST_PROGRAM test
6257 for 8-bit clean memcmp.
6259 * cat.c (usage, main): Remove unused argument.
6261 * csplit.c (remove_line): Remove set-but-not-used variable, `line_got.'
6262 (check_for_offset): Remove unused argument `argnum.'
6264 * configure.in: Add AC_SIZE_T.
6266 Sat May 1 09:03:19 1993 Jim Meyering (meyering@comco.com)
6268 * uniq.c (main): Interpret non-option arguments with a leading `+'
6269 only if we haven't seen `--'.
6271 * tr.c (main): Change variable name to avoid shadowed dcl.
6272 * wc.c (write_counts): Ditto.
6274 * sum.1: Make documentation agree with the code.
6276 * od.c: Depend only on HAVE_LONG_DOUBLE for long double support.
6278 Fri Apr 30 20:16:03 1993 Jim Meyering (meyering@comco.com)
6280 * configure.in [AC_HAVE_HEADERS]: Add limits.h.
6282 * configure.in [CFLAGS, LDFLAGS]: Assign reasonable defaults.
6284 * od.c (parse_old_offset): Don't use prototype in function
6285 definition. Remove unnecessary conjunct from test for hexadecimal
6288 * od.c: Depend on __GNUC__ || HAVE_LONG_DOUBLE rather than __STDC__
6289 for long double support; there are compilers (Stardent Vistra svr4)
6290 without long double but still define __STDC__.
6292 Thu Apr 29 02:01:27 1993 Jim Meyering (meyering@comco.com)
6294 * src/*.c and man/*.c except for sort: Add --help and --version
6297 * pr.c: Convert to use getopt_long.
6299 * lib/memcmp.c: Use version from glibc.
6300 [WORDS_BIGENDIAN]: Test this instead of the using glibc's
6302 * configure.in: Use AC_WORDS_BIGENDIAN to set it.
6304 * od.c (parse_old_offset): Allow `0X' as well as `0x' prefix to
6307 * Makefile.in (dist): Depend on Makefile so that changes to
6308 Makefile.in (like adding new files to DISTRIB) are reflected
6309 in the new distribution.
6311 Fri Apr 23 21:53:47 1993 Jim Meyering (meyering@comco.com)
6313 * {lib,src}/Makefile.in [.c.o]: Make CPPFLAGS and CFLAGS follow
6314 other options so users can use them to override DEFS.
6315 * src/Makefile.in [.c.o]: Add -I$(srcdir) for version.h.
6317 * Makefile.in [CFLAGS, LDFLAGS]: Don't set to -g explicitely;
6318 configure's AC_SUBST will set these.
6320 * Makefile.in [Makefile]: Add dependencies and a rule to remake it.
6321 [targets that cd then run make in subdirectories]: Don't depend
6322 on `cd ..'; use a subshell instead.
6324 * Makefile.in [info, install-info, dvi, check, installcheck]:
6325 New targets but no rules; comply with standards.
6327 * configure.in [CFLAGS]: Default to -g -O if CC is gcc and the user
6328 hasn't specified CFLAGS.
6329 [LDFLAGS]: Substitute into Makefile.
6331 Tue Mar 30 21:36:11 1993 Jim Meyering (meyering@comco.com)
6333 * od.c: New option --compatible, -C.
6334 (parse_old_offset): New function.
6335 * od.1: Document new option.
6337 Mon Mar 29 21:27:56 1993 Jim Meyering (meyering@comco.com)
6339 * cut.c, expand.c, join.c, nl.c: Always call error with errno
6340 (not zero) after failed fclose or non-zero ferror.
6342 Sun Mar 28 16:59:31 1993 Mike Haertel (mike@cs.uoregon.edu)
6344 * configure.in: Add check for working memcmp; use GNU's if
6345 the system's doesn't grok the 8th bit.
6346 * memcmp.c: Fix it so it groks the 8th bit.
6347 TODO: We really need to provide a fast memcmp, since most
6348 machines will have a broken memcmp. Probably should get
6350 * sort.c (mergefps): Maintain keybeg and keylim when copying
6351 the current line to `saved'.
6352 (numcompare): Skip white space here since -n no longer implies -b.
6353 (getmonth): Skip white space here since -M no longer implies -b.
6354 (compare): Completely overhauled to make the 8th bit work right,
6355 also to properly handle the global reverse option.
6356 (set_ordering): -n no longer implies -b, according to Posix.
6357 For consistency, -M also no longer implies -b.
6358 (main): Correct treatment of -r and global keys.
6359 (findlines): Clear keybeg and keylim if no keys are used.
6360 (sort): Avoid overwriting tempfiles[] array bounds.
6362 Sun Mar 21 22:29:29 1993 Jim Meyering (meyering@comco.com)
6364 * pr.c (close_file): Reverse May 13, '92 change, but add the condition
6365 that cols_ready_to_print not be decremented when printing across.
6366 The command `echo |pr -2ta' didn't terminate.
6367 (print_page): Rewrite conditional (that had side effects in second
6368 conjunct) using nested if statements to make it clear that we do
6369 indeed want those semantics.
6371 Tue Jan 19 13:35:24 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
6375 * system.h: Try BBSIZE if BSIZE isn't defined.
6376 From Tony Robinson <ajr@eng.cam.ac.uk>.
6378 Sat Dec 12 12:37:00 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
6380 * tail.c (tail_forever): Use an array of file descriptors
6381 instead of forking processes.
6382 (dump_remainder): Return number of bytes read.
6383 (tail_file): Fill in the new array.
6384 From Ian Lance Taylor.
6386 Fri Dec 11 17:18:16 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
6388 * system.h: Only define index, bcmp, etc. if not already defined.
6390 Tue Dec 8 10:31:14 1992 Jim Meyering (meyering@idefix.comco.com)
6392 * tr.c (is_char_class_member): Remove unreached return after abort.
6394 Sun Dec 6 22:34:52 1992 Jim Meyering (meyering@idefix.comco.com)
6396 * csplit, cut.c, expand.c, fold.c, head.c, join.c, od.c, pr.c,
6397 sort.c, split.c, tail.c, tr.c, unexpand.c, uniq.c: Remove inclusion
6398 of <ctype.h> and definitions of is* ctype macros to system.h.
6399 Change a few more uses of is* ctype macros to (protected) upper
6402 * system.h: Add isascii-protected ctype IS* macros.
6404 Wed Dec 2 12:28:10 1992 Jim Meyering (meyering@idefix.comco.com)
6406 * all files using getopt.h: Convert static declarations of
6407 struct option to use new macros from getopt.h: no_argument,
6408 required_argument, and optional_argument.
6410 Tue Dec 01 10:57:24 1992 Jim Meyering (meyering@idefix.comco.com)
6412 * od.c, pr.c, sort.c: Make uses of ctype.h macros consistent.
6414 * tr.c (main): Close stdin and stdout and check return status.
6416 Tue Nov 24 09:26:08 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6418 * system.h, csplit.c: Use HAVE_FCNTL_H and HAVE_STRING_H
6421 Tue Nov 24 08:42:30 1992 Jim Meyering (meyering@idefix.comco.com)
6423 * tr.c: Define new macros ISPRINT, ISALNUM, ISXDIGIT, ... that
6424 use isascii if it is defined.
6425 (is_char_class_member, make_printable_char, make_printable_str,
6426 non_neg_strtol): Use new macros instead of lower case ones
6429 * od.c (print_ascii, dump_strings): Use ISDIGIT and ISPRINT
6430 macros like pr.c. Suggested by David J. MacKenzie.
6432 * od.c (print_ascii, dump_strings): Check for isascii before isprint.
6433 (dump_strings): Free malloc'd buffer before returning.
6434 (skip): Return non-zero if an error occurred, zero otherwise.
6435 Exit only if asked to skip beyond end of combined input.
6436 (check_and_close): New function.
6437 (skip, read_block, read_char): Call check_and_close when done
6438 processing the file associated with in_stream.
6439 (skip, read_block, read_char): Set have_read_stdin.
6440 (main): Close stdin (if it was ever read) and check for errors
6441 just before exiting.
6442 (write_block, dump_strings, dump): Don't test return value from
6443 functions that operate on streams. Rely on later ferror tests.
6445 Sat Nov 21 12:41:49 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6447 * sort.c (main, usage): Add -T option.
6449 Thu Nov 19 14:33:40 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6451 * tail.c (tail_forever, sigusr1, kill_kids): New functions to
6452 do -f on multiple files.
6453 (main): Call tail_forever.
6454 From Ian Lance Taylor.
6456 Tue Nov 10 14:29:11 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6458 * cut.c (cut_fields): Add cast.
6460 * od.c (decode_one_format): Remove '#' from pre_fmt_string;
6461 many systems don't support it.
6462 Conditionalize long double support on __STDC__, not __GNUC__.
6463 From Ian Lance Taylor.
6465 Mon Nov 9 00:24:41 1992 Jim Meyering (meyering@idefix.comco.com)
6467 * sort.c (numcompare, keycompare): Add parentheses suggested
6468 by gcc -Wall. Put braces around individual monthtab initializers.
6470 * cksum.c: Declare error. Make checksum table `const.'
6472 * pr.c: Remove comment and dcl of unused variable, `print_a_number'.
6474 * split.c (main): Add `default: abort();' to enumeration switch.
6476 * All files: Make all functions and extern variables static.
6477 Make all longopts arrays const as well as static.
6478 Make a couple statically initialized aggregates `const.'
6480 Sun Nov 8 19:46:59 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6482 * od.c (main): Make old-style format options accumulate.
6485 Sat Nov 7 00:26:14 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6487 * tr.c (look_up_char_class): Add cast.
6489 * nl.c (build_type_arg), csplit.c (extract_regexp), tac.c (main):
6490 Add `const' to variable receiving value from re_compile_pattern.
6492 * wc.c (wc): If doing only -c, use st_size for regular files.
6494 * fold.c (fold_file): Was folding 1 column too early.
6495 From Eric Backus <ericb@lsid.hp.com>.
6497 * memset.c: New file.
6499 Fri Nov 6 20:14:51 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6501 * cksum.c: New file.
6503 Tue Oct 13 16:24:06 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6505 * tac.c (tac_stdin): Handle SIGPIPE.
6506 * sort.c (main): Handle SIGTERM.
6510 * system.h [USG || STDC_HEADERS]: Define bcmp.
6512 Sat Oct 3 20:41:24 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
6514 * sort.c (main): Handle SIGPIPE. From trq@dionysos.thphys.ox.ac.uk.
6516 Tue Sep 29 01:10:05 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6518 * paste.c (main): Don't write on a string constant.
6520 Mon Aug 24 00:02:45 1992 Jim Meyering (meyering@churchy.gnu.ai.mit.edu)
6522 * tr.c: Minor cleanup. Replaced some assert(0) with abort().
6524 Tue Jul 7 02:14:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6526 * cmp.c, cmp.1: Move to diff distribution.
6528 Fri Jul 3 16:37:59 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6530 * system.h: Change FOO_MISSING to HAVE_FOO.
6532 Wed May 13 20:05:41 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
6534 * pr.c (COLUMN): Add structure member to remember filename.
6535 (main, init_fps, open_file, close_file): Use it.
6537 (close_file): Don't decrement cols_ready_to_print when closing
6538 a file. From cdl@mpl.UCSD.EDU (Carl Lowenstein).
6540 Mon May 11 19:17:33 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
6542 * cmp.c: --show-chars -> --print-chars.
6544 * pr.c: Rename some variables.
6546 Sat May 9 18:39:47 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6548 * system.h: Define DEV_BSIZE if not defined.
6550 Wed Apr 22 02:15:09 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
6552 * system.h, tac.c: SIGTYPE -> RETSIGTYPE.
6554 Fri Apr 17 10:42:23 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6556 * sort.c (main): Don't stop processing args when we hit "-";
6557 treat it like a regular filename.
6558 From ian@airs.com (Ian Lance Taylor).
6560 * pr.c (print_page): Fix off by one line count when ^L is in input.
6561 From Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de).
6563 Mon Apr 6 20:52:29 1992 Jim Meyering (meyering@churchy.gnu.ai.mit.edu)
6565 * tr.c (validate): Change error message so it doesn't mention
6566 actual name of --truncate-set1 option. From David MacKenzie.
6568 Sun Apr 5 14:22:42 1992 Jim Meyering (meyering@hal.gnu.ai.mit.edu)
6570 * tr.c (string2_extend, validate): Give an error message when
6571 translating without --truncate-set1, with empty string2, and
6572 with non-empty string1. "tr 1 ''" produced a failed assertion.
6574 Mon Mar 30 02:20:56 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6576 * system.h: Change how ST_BLKSIZE is calculated to allow for
6577 non-POSIX systems that don't define BSIZE in sys/param.h.
6579 Sat Mar 28 11:18:01 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6581 * sum.c (main, bsd_sum_file): Don't print filename if BSD
6582 algorithm is used and only one file was given.
6584 Wed Mar 25 11:34:41 1992 Jim Meyering (meyering@wombat.gnu.ai.mit.edu)
6586 * tr.c (get_spec_stats): Fix assertion to allow ranges like a-a
6587 with starting character equal to ending character. This is
6588 contrary to the POSIX spec, but what is already implemented
6589 in find_closing_delim.
6591 Mon Mar 16 00:15:11 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6595 * sort.c (numcompare, checkfp): Add parens to placate gcc2.
6597 * sort.c (mergefps): For -u, output the first, not last, of
6598 the lines that compare equal. From Mike Haertel.
6600 Tue Mar 10 10:51:38 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6602 * tr.c: Remove initial capitals and periods from error messages.
6604 Sun Mar 8 22:03:45 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
6606 * sum.c (main): Add -r option for SYSV compat.
6608 Thu Feb 27 22:26:25 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
6610 * sort.c (compare): If -s given, leave lines in their original order.
6611 (main): Recognize -s.
6612 (usage): Document -s.
6615 Tue Feb 18 20:29:45 1992 Randall Smith (randy at geech.gnu.ai.mit.edu)
6617 * sort.c (sort): Check for complete parsing of buffer into
6618 lines before nixing temp files.
6620 Mon Feb 17 10:35:58 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6622 * sum.c (sysv_sum_file): Use %lu instead of %u to print a
6623 long. Not that it matters for GNU . . .
6625 * tr.c (unquote, make_printable_str): Use \007 instead of ANSI \a.
6626 (append_normal_char, append_range, append_char_class,
6627 append_repeated_char, append_equiv_class, spec_init):
6628 Initialize `next' field of new `struct List_element'.
6629 From rommel@informatik.tu-muenchen.de (Kai-Uwe Rommel).
6631 Sat Feb 8 17:16:49 1992 David J. MacKenzie (djm at apple-gunkies.gnu.ai.mit.edu)
6633 * join.c (get_line): Renamed from getline to avoid GNU libc conflict.
6635 Sun Feb 2 21:22:01 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6639 * nl.c: Support multiple files and "-" for stdin.
6640 (main): Check for read and write errors.
6641 (nl_file): New function.
6643 Wed Jan 29 10:09:10 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6645 * tr.c (main): -t option was called -b in getopt spec.
6646 (validate): Don't warn that set1 is longer than set2.
6648 * tr.c: Rename --sysv-string2-truncate to --truncate-string1.
6650 Fri Jan 17 16:29:05 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6652 * nl.c: New program from bin-src.
6654 * nl.c (main): Use a struct linebuffer for line_buf.
6655 (process_file): Use readline instead of fgets, to preserve NULs.
6656 (check_section): Use memcmp instead of strncmp.
6657 (proc_text): Print line_buf with fwrite instead of printf.
6659 * nl.c (main): Usage message if too many args given. Check
6660 for error in closing input file. Lengths of section delimiter
6661 strings were 1 too large. Take separator_str into account in
6662 length of print_no_line_fmt.
6663 (build_print_fmt): Allocate space for print_fmt, in case
6664 separator_str is long.
6665 (proc_text): A blank line is one that contains nothing, not
6666 even nonprinting characters.
6668 Fri Jan 17 01:04:22 1992 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6670 * All programs: Document `--' instead of `+' to introduce
6671 long-named options, in usage messages.
6673 * sum.c (bsd_sum_file): Renamed from sum_file.
6674 (sysv_sum_file): New function.
6675 (main): Recognize an option to select between the algorithms.
6677 Sun Jan 5 17:41:18 1992 Jim Meyering (meyering at churchy.gnu.ai.mit.edu)
6679 * pr.c (close_file, print_page): Fixed bug that had the command
6680 yes |head |pr -t printing "yyyyyyyyyy".
6681 * (print_page): Fixed bug that had pr -3 -a printing two too few
6682 trailer lines per page.
6683 * (main): Added restriction that -a and -m are incompatible.
6684 Although the POSIX spec doesn't explicitly say they shouldn't
6685 be used together, it says -a modifies the -column option and
6686 that -column shouldn't be used with -m.
6688 Thu Jan 2 15:23:59 1992 David J. MacKenzie (djm at albert.gnu.ai.mit.edu)
6690 * nl.c: Include regex.h after, not before, sys/types.h.
6692 Thu Jan 2 12:18:10 1992 Tom Lord (lord at geech.gnu.ai.mit.edu)
6694 * sort.c (fillbuf) return bytes buffered instead of bytes read.
6696 Fri Dec 27 22:53:36 1991 Jim Kingdon (kingdon at geech.gnu.ai.mit.edu)
6698 * sort.c (LINEALLOC): New #define.
6699 (struct lines): New field ``limit''.
6700 (initlines): Set it from new arg ``limit''.
6701 (sort, mergefps, checkfp): Pass new arg to initlines().
6702 (findlines): Don't realloc past lines->limit.
6704 Tue Dec 24 01:24:03 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6706 * tac.c, sort.c, csplit.c, system.h: Change POSIX ifdefs to
6707 HAVE_UNISTD_H and _POSIX_VERSION.
6709 * xwrite.c: Change POSIX ifdef to HAVE_UNISTD_H.
6711 Sat 14 Dec 1991 11:46:42 Jim Meyering (meyering at wombat)
6713 * tr.c: Fixed an inaccurate comment on posix_pedantic.
6715 Thu 12 Dec 1991 21:15:20 Jim Meyering (meyering at hal)
6717 * tr.c: Changed underscores to hyphens in long option name
6718 "sysv_string2_truncate".
6720 Wed Dec 11 13:33:34 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6722 * tac.c (main): Set obscure_syntax to tell re_search to
6723 allocate memory for the group registers.
6725 Fri Dec 6 18:26:27 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6727 * tac.c, sort.c, csplit.c [POSIX]: Use sigaction instead of
6728 signal, which POSIX doesn't have.
6729 * sort.c: Replace inthandler and huphandler with sighandler.
6730 * csplit.c (main): Only handle signals if they were not being
6733 * tr.c: POSIX_ME_HARDER -> POSIXLY_CORRECT.
6735 Wed Dec 4 00:47:47 1991 Jim Meyering (meyering at wombat)
6737 * tr.c (unquote): Reformat code so it doesn't go beyond column 80.
6738 * tr.c (squeeze_filter): Comment a little on why it's better
6739 to step through the input by two.
6740 * tr.c (set_initialize): Write a comment describing the function.
6741 * tr.c: Eliminated the variable `portability_warnings' and replaced
6742 references to it by references to `!posix_pedantic'. One of the
6743 uses of portability_warnings had been wrong.
6745 Tue Dec 3 14:03:35 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6747 * tr.c: New program.
6749 Sun Dec 1 15:07:35 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6751 * linebuffer.[ch] (freebuffer): New function (used by cron).
6753 Thu Oct 17 22:30:22 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6755 * system.h, configure, Makefile.in: Don't include memory.h if
6756 STDC_HEADERS, removing need for MEMORY_H_MISSING.
6758 Thu 17 Oct 1991 16:53:07 Jim Meyering (meyering at wombat)
6760 * pr.c (print_page): REALLY fixed `extra newline at EOF' problem.
6761 Somehow, part of my patch didn't make it last time.
6763 Sat Oct 12 12:04:47 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu)
6765 * tail.c (pipe_lines, pipe_bytes): Initialize `first->next'.
6767 * cmp.c (cmp): Print EOF message to stderr, not stdout, for
6770 * sort.c (xfwrite): fwrite never returns < 0, so check if
6771 number written is number we asked to write.
6772 (fillbuf, main): fread never returns < 0, so check ferror instead.
6775 Tue Oct 8 18:07:08 1991 Jim Meyering (meyering at churchy)
6777 * pr.c (print_page): Really fixed `extra newline at EOF' problem.
6778 * (store_columns): Fixed bug that caused `pr -b -2' to coredump
6779 on files of certain lengths.
6781 Fri Oct 4 22:30:25 1991 Jim Meyering (meyering at churchy)
6783 * pr.c (print_page): Fixed to not add single spurious newline
6784 at EOF when using -t.
6786 Wed Oct 2 01:02:05 1991 David J. MacKenzie (djm at apple-gunkies)
6788 * pr.c (print_page): Don't pad the page if -t given.
6790 * csplit.c (load_buffer), sort.c (mergefps): Use bcopy, not memcpy.
6792 Thu Sep 26 12:35:00 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu)
6796 * configure, system.h: Include memory.h if it works.
6798 * split.c: Allow `b' unit as well as `k' and `m'.
6800 * head.c, tail.c: Replace -b +blocks option with specifying
6801 units (b, k, or m) after the number.
6802 (parse_unit): New function.
6804 * fold.c (main): Check that -w arg is a number.
6806 * cut.c: +delimiter takes an arg.
6808 Mon Sep 16 14:52:38 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu)
6810 * pr.c (close_file): Don't close an already closed file.
6812 Thu Sep 12 00:14:43 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6814 * memchr.c: New file.
6815 * configure: Check if it's needed.
6817 * csplit.c, gcsplit.1: New program.
6819 * pr.c (cleanup): Only free buffers if they were allocated.
6821 * sort.c [!USG && !STDC_HEADERS]: Declare memchr.
6823 Wed Sep 11 20:54:16 1991 Jim Meyering (meyering at churchy)
6825 * pr.c: The following 3 bugs appeared (at least) when printing
6826 a single file with the options `-3 -f'.
6827 * (print_white_space): Single spaces were being replaced
6829 * (print_page): Some lines were getting too much white space
6830 at the beginning because spaces_not_printed wasn't being reset
6832 * (read_line): The single space between a truncated column
6833 on its left and the column on its right was omitted. Fixed
6834 so that previous value of input_position is restored before
6837 Sat Sep 7 03:22:18 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6839 * configure: Only remove /etc from PATH when it's not part of
6842 Wed Sep 4 17:09:24 1991 David J. MacKenzie (djm at apple-gunkies)
6844 * linebuffer.c (readline): Fix incorrect recalculation of `end'.
6846 * head.c, tail.c: Replace `mode' variables and bitmasks with
6847 separate variables for each option.
6849 Mon Sep 2 04:00:37 1991 David J. MacKenzie (djm at apple-gunkies)
6851 * wc.c: New program.
6853 Sun Sep 1 01:18:38 1991 David J. MacKenzie (djm at apple-gunkies)
6855 * fold.c (fold_file): Read in an int, not a char, for EOF
6858 * configure: Check whether st_blksize is missing.
6860 * tac.c (save_stdin): Put copy of pipe input in TMPDIR if
6861 defined, instead of /tmp.
6863 Thu Aug 29 14:48:15 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6865 * xwrite.c [POSIX]: unistd.h might require sys/types.h.
6867 Wed Aug 28 11:57:39 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6869 * paste.c (main): Consider -d "" to be like -d "\0",
6870 for POSIX (if I read it right).
6872 * sort.c, join.c: New programs.
6874 * cut.c (set_field): Allow blanks as well as commas to
6875 separate numbers in ranges.
6877 Sun Aug 25 19:57:40 1991 Jim Meyering (meyering at apple-gunkies)
6879 * pr.c: Failure to open an input file is no longer a fatal error.
6880 A message is printed for each failed open. When printing
6881 in parallel, each failed open results in one fewer output column.
6882 Added POSIX -r option to suppress the message.
6883 * pr.c: Added variables: failed_opens, ignore_failed_opens.
6884 These changes were based in part on work by David MacKenzie.
6886 Sat Aug 24 15:27:39 1991 Jim Meyering (meyering at pogo)
6888 * pr.c: Complain if user gives both -m and -[0-9]+ options.
6890 Wed Aug 21 22:04:57 1991 David J. MacKenzie (djm at apple-gunkies)
6894 Mon Aug 19 00:16:51 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6896 * expand.c: Rename some variables.
6897 (expand): Don't access value off end of array.
6898 * unexpand.c: Rename some variables.
6899 (unexpand): Don't access value off end of array.
6900 Instead of copying tabs verbatim and flushing pending spaces
6901 when one is reached, count them as the proper number of
6902 pending spaces. Instead of changing tabs to single spaces if
6903 the tabstop list is exhausted, print the rest of the line
6904 unchanged (for POSIX).
6906 Sat Aug 17 01:49:41 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6908 * cut.c (cut_file), paste.c (paste_parallel, paste_serial):
6909 Clear EOF and error conditions on stdin so it can be reused.
6911 * expand.c, unexpand.c (parse_tabstops): Allow blanks as well
6912 as commas to separate tabstops, for POSIX.
6913 * expand.c (expand), unexpand.c (unexpand): Don't line-buffer
6914 the output; send it directly to stdout.
6915 * unexpand.c (main): Make -t stupidly imply -a for POSIX.
6916 (unexpand): If a tab stop list was given and we move past its end,
6917 copy the rest of the line verbatim.
6919 * split.c (convint): New function to allow 'm' and 'k' after
6921 (main): Use it. Change -c option to -b for POSIX.
6923 Fri Aug 9 02:47:02 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6925 * pr.c: Protect isdigit with isascii, if required.
6927 Tue Aug 6 21:42:25 1991 David J. MacKenzie (djm at wheat-chex)
6929 Most of the following is from Paul Eggert:
6930 * cat.c (main): If stdin is read, check close at end.
6931 * cmp.c (main): Check for stdin being closed.
6932 Check for close errors on stdin and stdout.
6933 (cmp): Return a value instead of exiting.
6934 * cut.c (cut_file): New function, from code in main.
6935 Check for read errors.
6936 (main): Check for close errors.
6937 * expand.c, unexpand.c (main): Check for close errors.
6938 (next_file): Go to next file if one can't be opened.
6939 Check for close errors.
6940 * head.c (main), tail.c (main): If stdin was read, check for
6942 * head.c (head_file), tail.c (tail_file): Check for close errors.
6943 * paste.c (main, paste_parallel, paste_serial), tac.c (main):
6944 Check for close errors. Close stdin if it was read.
6945 * split.c (main): Check for close errors.
6947 * configure, Makefile.in's: Support +srcdir option.
6948 Make config.status. Fix up clean targets.
6950 Wed Jul 31 01:32:59 1991 David J. MacKenzie (djm at hal)
6952 * linebuffer.h (struct linebuffer): Add a field to indicate
6953 the number of valid chars in the line.
6954 * linebuffer.c (initbuffer, readline): Fill it in.
6955 * uniq.c, comm.c: Use it.
6957 * pr.c (main): Check stdin and stdout fclose for errors.
6958 (init_parameters): If there's no room for header and footer,
6959 omit them rather than dying (for POSIX).
6960 (init_header): Take a file descriptor as additional arg.
6961 (init_fps): Change callers. Note when stdin is read.
6962 (open_file): For filename "-" use stdin.
6963 (close_file): Don't close stdin. Check close for errors.
6964 (print_char, char_to_clump): Use isprint instead of explicit
6967 * memcmp.c: New file (needed for comm).
6968 * bcopy.c: New file (needed for fold).
6969 * system.h: Don't define bcopy as memcpy.
6970 * configure: Check for bcopy and memcmp.
6972 * uniq.c (main): Use "-" instead of NULL to mean stdin or
6974 (check_file): Use "-" instead of NULL to mean stdin or stdout.
6975 Check readline return instead of for NUL character to
6977 Check fclose for errors.
6978 (find_field): Use linebuffer length, not NULs, to detect end
6980 (different): New function, replaces compare. Uses memcmp
6982 (writeline): Use fwrite instead of fputs so NULs are preserved.
6984 * comm.c (compare_files): Return an error indication.
6985 Don't take a filename of NULL to mean stdin.
6986 Use memcmp instead of strcmp to allow for NULs.
6987 Check fclose for errors.
6988 (writeline): Use fwrite instead of fputs so NULs are preserved.
6990 * sum.c (sum_file): Take an arg indicating whether to print
6991 the filename, and don't take NULL meaning stdin. Set a flag
6992 when we read stdin. Check fclose return for errors.
6993 (main): If stdin was read, check fclose return for errors.
6994 Use filename of "-" if no args given.
6996 Thu Jul 25 15:17:10 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
6998 * fold.c: Rewritten from scratch for POSIX.
7000 Wed Jul 24 01:55:41 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
7002 * split.c (line_bytes_split): Use xmalloc instead of alloca.
7003 * system.h: Don't declare alloca.
7005 * tac.c, tail.c: Use SEEK_ instead of L_ for lseek.
7006 * system.h: Define SEEK_ macros if not defined.
7008 * pr.c: Rename variable `truncate' to avoid library function conflict.
7010 Tue Jul 23 13:21:48 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
7012 * linebuffer.c, linebuffer.h: New files.
7013 * comm.c, uniq.c (initbuffer, readline): Functions
7014 removed (use versions in linebuffer.c).
7016 Mon Jul 22 13:23:53 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
7018 * sum.c (sumfile): Always print 5 digits for second number, too.
7019 Interpret "-" to mean stdin.
7021 Sat Jul 20 14:24:40 1991 David J. MacKenzie (djm at bleen)
7023 * uniq.c: Use isblank instead of isspace, to support POSIX.2.
7024 * comm.c, pr.c, uniq.c (concat, fatal, error,
7025 pfatal_with_name, xmalloc, xrealloc): Functions removed.
7027 Sat Jul 13 02:04:53 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7029 * nl.c: Add long-named options. Doc fixes.
7031 Sat Jul 6 02:19:09 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7033 * expand.c, unexpand.c [STDC_HEADERS]: Include stdlib.h.
7035 * xwrite.c [POSIX]: Include unistd.h.
7036 [STDC_HEADERS]: Don't declare errno.
7038 Sun Jun 30 23:35:16 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7040 * uniq.c: Add long-named options. Remove marginally useful -z
7041 option (zero padded repeat counts).
7043 Thu Jun 27 16:31:45 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7045 * tail.c (tail_file), tac.c (save_stdin, tac_file), split.c
7046 (cwrite), head.c (head_file), cat.c (main): Check close return
7047 value for delayed error report due to NFS.
7049 Tue Jun 11 00:12:15 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7051 * cat.c: Replace "uchar" with "unsigned char", to avoid
7052 problems with various systems' typedefs.
7054 Thu Jun 6 12:54:26 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
7056 * cat.c (cat): Interpret ENOTTY return from FIONREAD ioctl to mean
7057 operation is unsupported, for HP-UX 7.0.
7059 Sun Apr 14 21:49:17 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
7061 * sum.c: Always print five digits for first number.
7063 Fri Mar 15 16:16:54 1991 David J. MacKenzie (djm at geech.ai.mit.edu)
7065 * cat.c, cmp.c: Don't use fileno(); not needed.
7067 Thu Jan 10 02:16:55 1991 David J. MacKenzie (djm at albert.ai.mit.edu)
7069 * tac.c, tail.c: Change _POSIX_SOURCE to POSIX.
7071 Thu Dec 27 00:06:45 1990 David J. MacKenzie (djm at egypt)
7073 * cut.c (cut_file_bytes, cut_file_fields): Make inbufp and
7075 (enlarge_line): Adjust inbufp and outbufp.
7077 Sun Sep 9 16:54:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7079 * cat.c: Declare free returning void, not int, so it
7080 doesn't bomb on Xenix.
7082 Mon Sep 3 22:23:57 1990 David J. MacKenzie (djm at coke)
7084 * tac.c: Print error messages before calling cleanup, not after.
7086 Tue Aug 28 18:05:24 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7088 * tac.c (cleanup): Return SIGTYPE, not int.
7090 Tue Aug 7 12:51:18 1990 David J. MacKenzie (djm at apple-gunkies)
7092 * cut.c (main, usage): Add -b and -n options for POSIX.
7093 (set_fields): Don't allow SPC or TAB as number separators.
7095 * paste.c (paste_parallel): If open of any file fails, quit
7098 Mon Aug 6 22:14:13 1990 David J. MacKenzie (djm at apple-gunkies)
7100 * pr.c: Add POSIX -F option (same as -f).
7102 * uniq.c (check_file): Allow '-' to mean stdin or stdout.
7104 Mon Aug 6 14:43:30 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7106 * head.c, tail.c: Change `chars' to `bytes' globally.
7107 (main, usage): Use POSIX.2 draft 10 option syntax.
7109 Sun Aug 5 11:51:12 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7111 * cat.c (main): Don't delay error messages, so they appear
7113 (main, simple_cat, cat): Make errors in input files nonfatal.
7115 Sat Aug 4 10:11:30 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7117 * cat.c: Remove -c option added for POSIX draft 9, since POSIX
7118 draft 10 removed it.
7120 * tac.c (tac_stdin): Use fstat instead of lseek to determine
7121 whether stdin is seekable, because lseek silently fails on
7122 some special files, like tty's.
7123 tail.c (tail_chars, tail_lines): Use fstat instead of lseek;
7124 don't turn off -f for non-regular files (assume the user knows
7125 what he's doing; it might work for fifo's and sockets).
7127 * paste.c (main): If no files given, use stdin.
7128 Don't let collapse_escapes write on string constant (delim default).
7129 (paste_parallel): Don't close stdin.
7131 * cut.c (main): Use standard input for filename of "-".
7133 * comm.c (compare_files): Allow '-' to mean stdin.
7135 Fri Aug 3 13:38:28 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7137 * cut.c (enlarge_line): Take an arg giving the required amount
7138 of space. Change callers.
7139 (main): Don't allow -t'<TAB>' without -f.
7140 Make `delim' unsigned to fix sign extension problem in comparison.
7142 Tue Jul 17 12:36:11 EDT 1990 Jay Fenlason (hack@ai.mit.edu)
7144 * pr.c Deleted excess whitespace from ends of lines.
7145 Modified to work with current version of getopt, which
7146 returns 1 instead of 0 for non-options.
7147 Reversed the meaning of the -f option, to be compatable
7150 Sun Jul 8 00:39:31 1990 David J. MacKenzie (djm at apple-gunkies)
7152 * cmp.c (main, usage): Rename -L option to -c and don't have
7154 (printc): Take an arg to specify number of chars to pad to,
7155 for column alignment.
7156 (cmp): Respect flag_print_chars in default output format.
7157 Align columns for cmp -cl.
7159 Sat Jul 7 17:23:30 1990 David J. MacKenzie (djm at apple-gunkies)
7161 * cmp.c: For +show-chars, have getopt return 'L' so
7162 `flag_print_chars' gets set.
7164 Fri Jun 29 01:04:19 1990 David J. MacKenzie (djm at apple-gunkies)
7166 * tac.c (main): Initialize fastmap and translate fields of
7167 regex before compiling it.
7169 Fri Jun 22 00:38:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7171 * tac.c: Change +regexp to +regex for consistency with GNU find.
7173 Wed Jun 20 01:46:09 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7175 * cat.c (cat): If FIONREAD is available, only use it if it is
7176 supported by the filesystem that the file is on.
7178 Sun Jun 3 20:26:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7180 * cat.c (main): Add a variable to control whether the check
7181 for input file == output file is made, because no values of
7182 st_dev and st_ino should be assumed to be available for this
7183 purpose. Only do the check for regular files.
7185 * tac.c: Use bcopy instead of memcpy.
7187 Thu May 31 00:55:36 1990 David J. MacKenzie (djm at apple-gunkies)
7189 * head.c: Use longs instead of ints for file offsets, for 16
7192 Tue May 22 00:56:51 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7194 * cmp.c: Change some ints to longs for 16 bit machines.
7195 (bcmp_cnt): Make char-pointer counting slightly simpler.
7197 Sat May 12 01:16:42 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7199 * cat.c (main): Allow input file to be output file for devices
7200 (ttys, etc.). Check whether input file is output file when
7201 reading standard input. Print any error messages for standard
7204 * cmp.c (bcmp_cnt): Handle int comparisons correctly on 16 bit
7205 machines as well as 32 bit ones.
7206 * cmp.c, tail.c: Use longs instead of ints for file offsets.
7208 Fri May 11 02:11:03 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7210 * cmp.c: Fix some exit statuses for POSIX.
7212 Tue May 8 03:41:42 1990 David J. MacKenzie (djm at abyss)
7214 * tac.c: Use regular expressions as the record boundaries.
7215 Give better error messages.
7216 Reformat code and make it more readable.
7217 (main): Use getopt_long to parse options.
7218 (tac_stdin): Do not make a temporary file if standard input
7220 (tac_file): New function.
7221 (tac): Take an open file desc as an arg.
7222 (output): Rewrite to use its own efficient buffering.
7223 (xmalloc, xrealloc, xwrite): New functions.
7225 Sun Apr 8 20:33:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7227 * head.c, tail.c: Use `error' instead of `fatal_perror' and
7228 `nonfatal_perror'. Remove some unnecessary info from messages.
7230 Wed Mar 21 09:30:18 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7232 * comm.c (main): Pass the list of files to compare_files as a
7233 char ** instead of a char *.
7234 (compare_files): Make arg a char **.
7236 * uniq.c: Declare some functions as void.
7237 Change global vars `countmode' and `mode' from ints to enums.
7238 (main): Use getopt to parse options and support POSIX options.
7239 Don't use integer_arg to parse numbers, since `-#' can't be
7240 parsed that way using getopt.
7241 (find_field): Use isspace for finding fields boundaries.
7243 Tue Mar 20 14:28:25 1990 David J. MacKenzie (djm at pogo.ai.mit.edu)
7245 * comm.c (main): Call usage if given bad option or wrong
7246 number of args. Exit with 0 status normally.
7247 (usage): New function.
7248 Declare some other functions as void.
7250 Wed Mar 14 10:48:40 1990 David J. MacKenzie (djm at rice-chex)
7252 * cmp.c (main, cmp, usage): Replace -q +quick option with -L
7253 +show-chars option to add ASCII representation of bytes to -l format.
7255 Tue Mar 13 00:50:14 1990 David J. MacKenzie (djm at rice-chex)
7257 * cmp.c (cmp): Change EOF message for POSIX compatibility.
7258 For -l format, clear bits > FF.
7260 Mon Mar 5 17:21:00 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7262 * tail.c: Move global `errors' into main instead of having
7263 nonfatal_perror set it.
7264 (tail, tail_chars, tail_file, tail_lines, pipe_chars, pipe_lines):
7265 Return an error status.
7266 (file_lines, start_chars, start_lines): Reverse the meaning of
7268 (tail_lines, tail_chars): Account for that reversal.
7270 Mon Mar 5 00:34:36 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7272 * head.c: Move global `errors' into main and have the various
7273 functions return an error status instead of setting it in
7276 Sat Mar 3 11:27:27 1990 Torbj|rn Granlund (tege at echnaton)
7278 * cmp.c (cmp): Call function bcmp_cnt for flag == 0 (i.e. no
7279 options specified), to compare the two blocks and count
7280 newlines simultaneously.
7281 * cmp.c New function: bcmp_cnt.
7283 * cmp.c (main): Test if output is redirected to /dev/null, and
7284 assume `-s' if this is so.
7286 Tue Feb 20 17:09:19 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7288 * cat.c: Change `argbad' from a char to a short, so it will
7289 work on machines with unsigned chars.
7291 Sat Feb 10 02:16:40 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
7293 * cmp.c (cmp): Rename `r' to `first_diff', and `x' to `smaller'.
7294 Remove unneccessary variable `c1'. If -l was given, increase
7295 `char_number' by the number of bytes read, after producing output,
7296 rather than by the offset of the first differing bytes, before
7298 Replace if-else-if constructions with case statements for clarity.
7299 (bcmp2): Rename `n' to `nread'.
7301 Wed Dec 20 01:32:06 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7303 * nl.c (proc_text): Use re_search instead of re_match.
7305 Tue Dec 19 01:26:34 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7307 * nl.c: Indent. Un-nest statements. Use GNU regexp functions
7308 instead of System V ones. Move function declarations together.
7309 (quit): Remove useless function.
7310 (program_name): New variable for error messages.
7311 (main): Use perror in error message.
7312 (xmalloc): New function to replace myalloc.
7313 (myalloc): Function removed.
7314 Global: use program_name and xmalloc.
7316 Sun Dec 17 00:36:36 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7318 * uniq.c: Declare some functions.
7319 (main): Initialize infile and outfile. Call usage if given
7320 invalid args. Normally exit with 0 status instead of garbage.
7321 (usage): New function to print usage message and exit.
7322 (check_file): Remove unused variable.
7323 (readline): Compare against EOF, not < 0.
7324 (xmalloc, xrealloc): Return char *, not int.
7325 Ok to return 0 if 0 bytes requested.
7326 (lb1, lb2): Remove unused global vars.
7327 (concat): Remove unused function.
7329 Sat Dec 16 15:15:50 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
7331 * comm.c: Remove unused global variables lb1, lb2.
7332 (main): Remove unneeded variable.
7333 (compare_files): Remove unused arg.
7334 (readline): un-nest assignment. Test against EOF instead of < 0.
7335 (error): Print to stderr, not stdout.
7336 (xmalloc, xrealloc): Return char * instead of int.
7337 Returning 0 is ok if 0 bytes requested (ANSI C).
7341 version-control: never