BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / diff / diff / diff.c
index 0f937ee..ddab61f 100644 (file)
@@ -1,13 +1,15 @@
-static char sccsid[] = "@(#)diff.c 4.4 %G%";
+static char sccsid[] = "@(#)diff.c 4.7 5/11/89";
 
 #include "diff.h"
 
 #include "diff.h"
+#include "pathnames.h"
+
 /*
  * diff - driver and subroutines
  */
 
 /*
  * diff - driver and subroutines
  */
 
-char   diff[] = DIFF;
-char   diffh[] = DIFFH;
-char   pr[] = PR;
+char   diff[] = _PATH_DIFF;
+char   diffh[] = _PATH_DIFFH;
+char   pr[] = _PATH_PR;
 
 main(argc, argv)
        int argc;
 
 main(argc, argv)
        int argc;
@@ -57,6 +59,9 @@ main(argc, argv)
                case 'f':
                        opt = D_REVERSE;
                        continue;
                case 'f':
                        opt = D_REVERSE;
                        continue;
+               case 'n':
+                       opt = D_NREVERSE;
+                       continue;
                case 'b':
                        bflag = 1;
                        continue;
                case 'b':
                        bflag = 1;
                        continue;
@@ -118,7 +123,7 @@ main(argc, argv)
        file2 = argv[1];
        if (hflag && opt) {
                fprintf(stderr,
        file2 = argv[1];
        if (hflag && opt) {
                fprintf(stderr,
-                   "diff: -h doesn't support -e, -f, -c, or -I\n");
+                   "diff: -h doesn't support -e, -f, -n, -c, or -I\n");
                done();
        }
        if (!strcmp(file1, "-"))
                done();
        }
        if (!strcmp(file1, "-"))
@@ -173,7 +178,8 @@ max(a,b)
 
 done()
 {
 
 done()
 {
-       unlink(tempfile);
+       if (tempfile)
+               unlink(tempfile);
        exit(status);
 }
 
        exit(status);
 }