Combine diff-spec args and pipe to diff COMPLETE Fixed 'W' Test script COMPLETE Adapt code to FreeBSD style guidelines COMPLETE Fix --width output indention COMPLETE --help COMPLETE Add more information to man file. COMPLETE Fix sdiff to work with binary data COMPLETE TODO: Add some error checking Replace goto statements COMPLETE zsdiff integration COMPLETE NOTES: - In diff, 'w' is used for --ignore-all-spaces instead of 'W'. When 'W' is passed to sdiff, it must be passed to diff as 'w'. - BUG: Right side of output is 2 spaces further than GNU sdiff's output. -FIX: In println(), change column width to width-1, take out extra space when it prints 'div' on no right column. - diff-specific args: -a Treat file1 and file2 as text files. -b Ignore trailing blank spaces. -d Minimize diff size. -I regexp Ignore line changes matching regexp. All lines in the change must match regexp for the change to be ignored. NOTE: Missing ')' on tests. -i Do a case-insensitive comparison. -t Expand tabs to spaces. -W Ignore all spaces (the -w flag is passed to diff(1)). - gdb output for zsdiff: jesse@jesse /u/h/j/D/sdiff> gdb ./zsdiff GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"... (gdb) run sdiff.gz sdiff.1.gz Starting program: /usr/home/jesse/Documents/sdiff/zsdiff sdiff.gz sdiff.1.gz Program received signal SIGBUS, Bus error. 0x0000000800d6bad8 in getdtablesize () from /lib/libc.so.7 (gdb) where #0 0x0000000800d6bad8 in getdtablesize () from /lib/libc.so.7 #1 0x0000000800d4fae8 in funopen () from /lib/libc.so.7 #2 0x0000000800d4f5ca in rewind () from /lib/libc.so.7 #3 0x000000000040218a in istextfile (f=0x7fffffffdb77) at sdiff.c:558 #4 0x0000000000402e44 in main (argc=2, argv=Variable "argv" is not available. ) at sdiff.c:468 (gdb) list 468 if (!istextfile(file1) || !istextfile(file2)) { 469 /* Close open files and pipe, delete temps */ 470 fclose(file1); 471 fclose(file2); 472 fclose(diffpipe); 473 if (tmp1) 474 if (unlink(tmp1)) 475 warn("Error deleting %s.", tmp1); 476 if (tmp2) 477 if (unlink(tmp2))