summaryrefslogtreecommitdiff
path: root/src/cmp.c
Commit message (Collapse)AuthorAgeFilesLines
...
* (main): Call initialize_main first.Paul Eggert1994-09-011-7/+6
| | | | | Use filename_cmp to compare file names. Use same_file to determine whether two files are the same.
* (word): Change from typedef to #define, to avoid collision withPaul Eggert1994-06-171-1/+1
| | | | Unicos 8.0 <sys/types.h>, which also typedefs `word'.
* (word): New type. All uses of `long' for word-at-a-time comparisonsPaul Eggert1993-11-101-43/+47
| | | | | | | changed to `word'. (long_options, main, usage): Add `--help'. (usage): Send usage to stdout, not stderr. (main): Add `-v'. Send version number to stdout, not stderr.
* (main, usage, version_string): Add --version option.Paul Eggert1993-09-271-2/+9
|
* Include "system.h" first.Paul Eggert1993-09-181-1/+1
|
* (cmp): Don't try to read past end of file; this doesn'tPaul Eggert1993-09-151-2/+3
| | | | work on ttys.
* Add prototypes to function declarations. Use size_t, not int, when needed.Paul Eggert1993-08-271-259/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `const' when needed to pacify gcc. Use 0, not NULL, for portability. Make globals static when possible. (file): Now a 2-element array; replaces `file1' and `file2'. (file_desc, buffer): Likewise, for file[12]_desc and buf[12]. (main): Likewise, for stat_buf[12]. Index these variables with `i'. (ignore_initial): New var. (long_options): Now const. Add `--ignore-initial'. (usage): Sort options and add `--ignore-initial'. (main, cmp): Add `--ignore-initial' support. (main): `cmp - -' now succeeds. Use STD{IN,OUT,ERR}_FILENO instead of [012]. When comparing standard input to a file, and using a shortcut (e.g. looking at file sizes or inode numbers), take the lseek offset into account before deciding whether the files are identical. Avoid mentioning `dev_t', `ino_t' for portability to nonstandard hosts. Use l.c.m. of files' buffer sizes, not 8 * 1024. ferror (stdout) does not imply errno has a useful value. If 2nd file is "-", treat it first, in case stdin is closed. (cmp): Always compute `char_number', `smaller' for speed and simplicity. Say `cmp: EOF on input', not `/usr/gnu/bin/cmp: EOF on input', as per Posix.2. (block_compare_and_count): Increment line_number argument. Remove end_char argument; it's always '\n'. All callers changed. Do not assume sizeof(long) == 4; this isn't true on some 64-bit hosts. (block_compare): Minimize differences with block_compare_and_count. (block_read): Coalesce `bp += nread's. (printc): Remove `FILE *' arg; output to stdout. All callers changed.
* entered into RCSDavid MacKenzie1992-07-081-19/+14
|
* *** empty log message ***David MacKenzie1992-07-071-22/+9
|
* Initial revisionDavid MacKenzie1992-05-121-0/+530