Commit Graph

486 Commits

Author SHA1 Message Date
Jim Meyering 67718aff76 (dump): Correct loop-termination criterion.
Before, running `printf 1234| ./od --width=4 --read-bytes=4'
printed output for 8 bytes -- the last four were garbage.
This happened only when the dump limit, N, was specified (with
--read-bytes=N) and N was a multiple of bytes_per_block
(usually 16, but 4 in this example).  From Andreas Schwab.
1995-07-07 04:46:03 +00:00
Jim Meyering c8e05ecd8d (split_3): Rewrite to parse Plumb/Lankester format as well.
(main): Write (de facto) standard Plumb/Lankester format.
New option: --quiet.
Check option no longer takes an argument.
When checking, exit status reflects success.
1995-07-03 03:10:59 +00:00
Jim Meyering 9c8e5123bd Remove unused dcl of isnumber. 1995-06-25 01:46:32 +00:00
Jim Meyering 9a5882ba80 (parse_group): Use xstrtoul instead of isnumber; the latter would
silently overflow, accepting a group id larger than INT_MAX.
(isnumber): Remove now-unused static function.
(change_file_group) [MAXUID]: Give a more descriptive message
when numeric group id is larger than MAXUID.
1995-06-25 01:44:35 +00:00
Jim Meyering 4610e33cb2 Don't conditionalize use of "inline". Autoconf takes care of defining
it away for compilers that don't grok it.
1995-06-24 21:33:52 +00:00
Jim Meyering 86671a4ed0 Undefine min and/or max before defining to avoid redefinition warning
on systems.
1995-06-24 21:10:12 +00:00
Jim Meyering 5cd7a18539 (read_input): Rename paramater MAX to MAX_N_BYTES. To avoid potential
conflict with max macro from some system's header files and bad pre-ANSI
compilers.
1995-06-24 21:07:55 +00:00
Jim Meyering 4b366ceed5 [uint32]: When testing for 32-bit arithmetic type,
also check `unsigned long', as a concession to systems with
int's smaller than 32 bits.
1995-06-24 20:53:17 +00:00
Jim Meyering eb5665733a (usage): Fix typo. 1995-06-24 20:38:52 +00:00
Jim Meyering ec8d1fce62 (main): Include program name in --version output. 1995-06-22 18:43:14 +00:00
Jim Meyering 4afe3f334a [join]: Redefine. Otherwise, systems (Unicos for one) with
headers that have a different prototype for `join' get an error.
1995-06-22 04:03:33 +00:00
Jim Meyering e7d420aabb [word]: Redefine. Otherwise, systems (Unicos for one) with
headers that define `word' to be a type get syntax errors because
of the variable by the same name.
1995-06-22 03:59:55 +00:00
Jim Meyering 3f76720636 (interrupt_handler): Declare to have a single integer
parameter.  Otherwise, some compilers failed with a type mismatch
error in sa_handler assignment.
1995-06-22 03:59:27 +00:00
Jim Meyering 3fba1e486e (main): Remove spurious colon in getopt spec string.
From Ken Pizzini <kenp@spry.com>.
1995-06-22 03:58:21 +00:00
Jim Meyering 59f93bf56c (md5_file): Initialize two elements of LEN portably,
rather than with ANSI aggregate initialization.  Reported by
Edzer Pebesma <Edzer.Pebesma@rivm.nl>.
1995-06-20 12:00:55 +00:00
Jim Meyering 6ebaf82426 merge with 1.12 1995-06-18 19:33:31 +00:00
Jim Meyering 755cdcee27 (process_buffer): Copy values from struct into
individual local variables before performing computation on them,
then copy results back into returned struct.  Solely for better
optimization by compilers that can't keep struct members in
registers.  From Ulrich Drepper.
1995-06-18 14:21:50 +00:00
Jim Meyering 19ffe3f16e (split_3): Unprotoize.
(hex_digits): Unprotoize.
(main): Interpret `no file args' as request to read from stdin.
(usage): Reflect that change.
1995-06-16 04:13:36 +00:00
Jim Meyering cdfc0cf26f Remove unnecessary uses of `defined' in #if* tests.
Don't use #elif.  Some older compilers don't grok it.
(split_3): New function to parse out sum, flag, and filename
when reading check file.
(hex_digits): Remove length parameter since string parameter is
now nul-terminated.
(main): Don't allocate separate arrays for filename and sum
when checking.  Get pointers into line buffer with split_3 instead
of using sscanf.
1995-06-16 03:14:19 +00:00
Jim Meyering aab046d29b Don't include values.h.
[__P]: Undefine it.

[UNIX || unix]: Also test __UNIX__, __unix__,
and _POSIX_VERSION.  Reported by Arne H. Juul.
1995-06-15 18:44:48 +00:00
Jim Meyering f9f17d4b0f merge with 1.11.5b 1995-06-15 16:46:34 +00:00
Jim Meyering 33969b2c90 patch from drepper 1995-06-15 15:02:01 +00:00
Jim Meyering 8f6e9e8827 (main): Rename char binary' to type_flag to avoid confusion with int binary'. 1995-06-15 03:18:13 +00:00
Jim Meyering 9387b92371 Don't use #elif. Some old C compilers don't recognize it.
(hex_digits): New function.
(result): Give ctx parameter the `const' attribute.
(usage): Rewrite to make it clearer that there are three modes.
(main): Process all options before generating any output.
In particular, collect all --string options rather than operating
on them as they are encountered.

Allow --check=-.  Before it tried to open the file named `-'.

Detect bogus input when --check'ing: non-hex, non-[tb] flag.

Map to lower case all hex digits read from check file.
1995-06-15 03:15:37 +00:00
Jim Meyering 60437a80ca [NDEBUG]: Define it to disable assertions.
(is_char_class_member): Set a variable in each branch of switch stmt
and return that value after the switch (rather than returning directly
from every branch).
(unquote): More int->size_t changes.
(build_spec_list): More int->size_t changes.
Be very careful about comparison now that variables are unsigned:
Use i + 2 < len rather than i < len - 2.  The latter failed for len < 2.
1995-06-14 02:23:48 +00:00
Jim Meyering 1aa5954b42 (xfclose): Don't try to flush stdin, only stdout.
Otherwise, at least Ultrix-4.3's fflush would return EOF.
Reported by Jim Blandy (jimb@cyclic.com).
1995-06-13 04:46:12 +00:00
Jim Meyering ca73f85acf [struct Spec_list] (indefinite_repeat_element): New member.
Use size_t rather than int or unsigned long where reasonable.
(get_spec_status): Make interface cleaner.
(get_s1_spec_status): New function.
(get_s2_spec_status): New function.
(validate): Use new functions.
1995-06-13 04:08:59 +00:00
Jim Meyering da78e2df64 Indent some things.
(long_options): Add NULL entry.  From Uli.
Touch up some comments.
(process_buffer): Bracket definition of OP with do...while(0) so stmts can be
semicolon terminated.
1995-06-13 04:02:22 +00:00
Jim Meyering bcee3d43ca (non_neg_strtol): Don't compare signed and unsigned. 1995-06-12 18:28:24 +00:00
Jim Meyering afe762e4e6 [!__GNUC__]: Define INLINE to /* empty */. 1995-06-12 14:42:41 +00:00
Jim Meyering c502988b26 Use invalid', not illegal' in error message. 1995-06-11 19:54:49 +00:00
Jim Meyering 1d1094a69e Remove trailing white space. 1995-06-11 19:37:03 +00:00
Jim Meyering 8ddb66cff4 [SWAP]: Parenthesize uses of macro argument.
Don't use autoconf macros that require running test programs.
1995-06-11 06:16:17 +00:00
Jim Meyering 3763a4f24e From Ulrich Drepper. 1995-06-11 06:04:15 +00:00
Jim Meyering c3754d6f21 (look_up_char_class, append_char_class, append_equiv_class): Use const
attribute when appropriate.
1995-06-11 05:40:05 +00:00
Jim Meyering 9584732376 (add_field_list): Compute max once for each call to add_field. 1995-05-28 20:12:24 +00:00
Jim Meyering 88daaaf385 (main): Call make_blank after *all* argument processing.
Get rid of blank1, blank2.  Just use uni_blank instead.
1995-05-28 19:46:04 +00:00
Jim Meyering 5c08b11b30 Overhaul so -a1 and -a2 (as used in cnews) work. 1995-05-28 18:01:54 +00:00
Jim Meyering 4657b1e9ec (main): Remove dcl of and statements that set now-unused variable. 1995-05-28 02:04:55 +00:00
Jim Meyering a528bd5d9f [!STDC_HEADERS && HAVE_MEMORY_H]: Include memory.h.
Without this, SunOS doesn't get type for memchr.
Reported by Kaveh Ghazi.
1995-05-27 11:41:00 +00:00
Jim Meyering 0be7c19204 Remove trailing white space. 1995-05-26 14:15:37 +00:00
Jim Meyering 1bca766a5d [struct control]: Change type of `repeat' member to unsigned
long to avoid conversion warning.
1995-05-25 05:09:50 +00:00
Jim Meyering a660862d4c (tail_lines): Change one more long' to off_t'.
Otherwise, tail didn't work on NetBSD.  From by Arne H. Juul.
1995-05-25 05:09:00 +00:00
Jim Meyering ee79446888 (usage): Add one or two lines of descriptive text. 1995-05-22 04:30:18 +00:00
Jim Meyering 7f9311c20e merge with 1.11.1b 1995-05-21 11:44:22 +00:00
Jim Meyering e8db76575a (look_up_char_class): Take a string length argument.
Use strncmp, not strcmp and verify that string lengths are the same.
(append_char_class): Update caller.
From Andreas Schwab.
1995-05-20 12:08:35 +00:00
Jim Meyering 9918713e5b (next_file_name): Move dcls of file-scope variables into this function.
Don't rely on arithmetic being two's complement.
1995-05-20 11:52:36 +00:00
Jim Meyering 4c9e84124c [CLOSED, ENDLIST]: Don't cast constants to FILE pointers.
Instead, declare two FILE structs and use their addresses.
1995-05-20 11:47:31 +00:00
Jim Meyering 0753cff4a1 (usage): Tweak wording. 1995-05-20 11:41:13 +00:00
Jim Meyering c253f9ba51 (record_line_starts): Remove set-but-not-used, file-scope variable. 1995-05-19 15:59:40 +00:00