experimental "diffs" to give sh script
[unix-history] / usr / src / usr.bin / sccs / sccs.c
index 3a5f3db..8b8cc83 100644 (file)
@@ -92,7 +92,7 @@
 **             Copyright 1980 Regents of the University of California
 */
 
 **             Copyright 1980 Regents of the University of California
 */
 
-static char SccsId[] = "@(#)sccs.c     1.52 %G%";
+static char SccsId[] = "@(#)sccs.c     1.52.1.1 %G%";
 \f
 /*******************  Configuration Information  ********************/
 
 \f
 /*******************  Configuration Information  ********************/
 
@@ -1139,8 +1139,32 @@ dodiff(getv, gfile)
        auto int st;
        extern int errno;
        int (*osig)();
        auto int st;
        extern int errno;
        int (*osig)();
+       register char *p;
+       register char **ap;
+       bool makescript = FALSE;
 
 
-       printf("\n------- %s -------\n", gfile);
+       for (ap = getv; *ap != NULL; ap++)
+       {
+               p = *ap;
+               if (p[0] == '-')
+               {
+                       switch (p[1])
+                       {
+                         case 'E':
+                               p[1] = 'e';
+                               makescript = TRUE;
+                               break;
+                       }
+               }
+       }
+
+       if (makescript)
+       {
+               printf("sccs edit %s\n", gfile);
+               printf("ed - %s << 'xxEOFxx'\n", gfile);
+       }
+       else
+               printf("\n------- %s -------\n", gfile);
        fflush(stdout);
 
        /* create context for diff to run in */
        fflush(stdout);
 
        /* create context for diff to run in */
@@ -1177,6 +1201,15 @@ dodiff(getv, gfile)
                }
                command(&getv[1], FALSE, "-diff:elsfhbC");
        }
                }
                command(&getv[1], FALSE, "-diff:elsfhbC");
        }
+
+       if (makescript)
+       {
+               printf("w\n");
+               printf("q\n");
+               printf("'xxEOFxx'\n");
+               printf("sccs delta %s\n", gfile);
+       }
+
        return (rval);
 }
 \f
        return (rval);
 }
 \f