+ case DODIFF: /* internal diff call */
+ setuid(getuid());
+ for (np = ap; *np != NULL; np++)
+ {
+ if ((*np)[0] == '-' && (*np)[1] == 'C')
+ (*np)[1] = 'c';
+ }
+
+ /* insert "-" argument */
+ np[1] = NULL;
+ np[0] = np[-1];
+ np[-1] = "-";
+
+ /* execute the diff program of choice */
+# ifndef V6
+ execvp("diff", ap);
+# endif
+ execv(cmd->sccspath, argv);
+ syserr("cannot exec %s", cmd->sccspath);
+ exit(EX_OSERR);
+
+ case ENTER: /* enter new sccs files */
+ /* skip over flag arguments */
+ for (np = &ap[1]; *np != NULL && **np == '-'; np++)
+ continue;
+ argv = np;
+
+ /* do an admin for each file */
+ p = argv[1];
+ while (*np != NULL)
+ {
+ printf("\n%s:\n", *np);
+ strcpy(buf, "-i");
+ gstrcat(buf, *np, sizeof(buf));
+ ap[0] = buf;
+ argv[0] = tail(*np);
+ argv[1] = NULL;
+ rval = command(ap, TRUE, "admin");
+ argv[1] = p;
+ if (rval == 0)
+ {
+ strcpy(buf, ",");
+ gstrcat(buf, tail(*np), sizeof(buf));
+ if (link(*np, buf) >= 0)
+ unlink(*np);
+ }
+ np++;
+ }
+ break;
+