Lines Matching +full:differ +full:-
1 /* cmp - compare two files byte by byte
19 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 #include <c-stack.h>
31 #include <file-type.h>
33 #include <hard-locale.h>
36 #include <unlocked-io.h>
37 #include <version-etc.h>
85 /* If nonzero, print values of bytes quoted like cat -t does. */
88 /* Values for long options that do not have single-letter equivalents. */
96 {"print-bytes", 0, 0, 'b'},
97 {"print-chars", 0, 0, 'c'}, /* obsolescent as of diffutils 2.7.3 */
98 {"ignore-initial", 1, 0, 'i'},
115 _("Try `%s --help' for more information."), program_name); in try_help()
122 *operand ARGPTR of --ignore-initial, updating *ARGPTR to point
124 *followed by DELIMITER; otherwise it must be null-terminated. */
135 try_help ("invalid --ignore-initial value `%s'", arg); in specify_ignore_initial()
145 try_help ("options -l and -s are incompatible", 0); in specify_comparison_type()
159 N_("-b --print-bytes Print differing bytes."),
160 N_("-i SKIP --ignore-initial=SKIP Skip the first SKIP bytes of input."),
161 N_("-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2"),
163 N_("-l --verbose Output byte numbers and values of all differing bytes."),
164 N_("-n LIMIT --bytes=LIMIT Compare at most LIMIT bytes."),
165 N_("-s --quiet --silent Output nothing; yield exit status only."),
166 N_("-v --version Output version info."),
167 N_("--help Output this help."),
186 _("If a FILE is `-' or missing, read standard input."), in usage()
188 _("Report bugs to <bug-gnu-utils@gnu.org>.")); in usage()
208 != -1) in main()
232 try_help ("invalid --bytes value `%s'", optarg); in main()
244 Granlund" to an o-with-umlaut (U+00F6, LATIN SMALL LETTER O in main()
261 try_help ("missing operand after `%s'", argv[argc - 1]); in main()
264 file[1] = optind < argc ? argv[optind++] : "-"; in main()
277 /* If file[1] is "-", treat it first; this avoids a misdiagnostic if in main()
279 int f1 = f ^ (strcmp (file[1], "-") == 0); in main()
287 file_desc[f1] = (strcmp (file[f1], "-") == 0 in main()
309 /* If output is redirected to the null device, we may assume `-s'. */ in main()
323 conclude that the files differ if they have different sizes in main()
330 off_t s0 = stat_buf[0].st_size - file_position (0); in main()
331 off_t s1 = stat_buf[1].st_size - file_position (1); in main()
344 PTRDIFF_MAX - sizeof (word)); in main()
346 /* Allocate word-aligned buffers, with space for sentinels at the end. */ in main()
348 words_per_buffer = (buf_size + 2 * sizeof (word) - 1) / sizeof (word); in main()
392 off_t file_bytes = stat_buf[f].st_size - file_position (f); in cmp()
404 if (ig && file_position (f) == -1) in cmp()
417 ig -= r; in cmp()
431 remaining -= bytes_to_read; in cmp()
468 /* See POSIX 1003.1-2001 for this format. This in cmp()
472 "%s %s differ: char %s, line %s\n"; in cmp()
481 N_("%s %s differ: byte %s, line %s\n"); in cmp()
497 printf (_("%s %s differ: byte %s, line %s is %3o %s %3o %s\n"), in cmp()
517 /* See POSIX 1003.1-2001 for this format. */ in cmp()
527 printf ("%*s %3o %-4s %3o %s\n", in cmp()
544 /* See POSIX 1003.1-2001 for this format. */ in cmp()
556 /* Compare two blocks of memory P0 and P1 until they differ,
601 return c0 - (char const *) p0; in block_compare_and_count()
604 /* Compare two blocks of memory P0 and P1 until they differ.
629 return c0 - (char const *) p0; in block_compare()
633 visible by quoting like cat -t does. */
643 *buf++ = '-'; in sprintc()
644 c -= 128; in sprintc()