expanded "info" option
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 25 Jul 1980 01:03:34 +0000 (17:03 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 25 Jul 1980 01:03:34 +0000 (17:03 -0800)
SCCS-vsn: usr.bin/sccs/sccs.c 1.16

usr/src/usr.bin/sccs/sccs.c

index ec0fca0..0a544fd 100644 (file)
@@ -5,7 +5,7 @@
 # include <sysexits.h>
 # include <whoami.h>
 
 # include <sysexits.h>
 # include <whoami.h>
 
-static char SccsId[] = "@(#)sccs.c     1.15 %G%";
+static char SccsId[] = "@(#)sccs.c     1.16 %G%";
 
 # define bitset(bit, word)     ((bit) & (word))
 
 
 # define bitset(bit, word)     ((bit) & (word))
 
@@ -390,9 +390,11 @@ clean(really)
        struct direct dir;
        struct stat stbuf;
        char buf[100];
        struct direct dir;
        struct stat stbuf;
        char buf[100];
+       char pline[120];
        register FILE *dirfd;
        register char *basefile;
        bool gotedit;
        register FILE *dirfd;
        register char *basefile;
        bool gotedit;
+       FILE *pfp;
 
        dirfd = fopen(SccsPath, "r");
        if (dirfd == NULL)
 
        dirfd = fopen(SccsPath, "r");
        if (dirfd == NULL)
@@ -415,11 +417,14 @@ clean(really)
                strcpy(buf, SccsPath);
                strcat(buf, "/p.");
                basefile = &buf[strlen(buf)];
                strcpy(buf, SccsPath);
                strcat(buf, "/p.");
                basefile = &buf[strlen(buf)];
-               basefile[sizeof dir.d_name - 2] = '\0';
                strcpyn(basefile, &dir.d_name[2], sizeof dir.d_name - 2);
                strcpyn(basefile, &dir.d_name[2], sizeof dir.d_name - 2);
-               if (stat(buf, &stbuf) >= 0)
+               basefile[sizeof dir.d_name - 2] = '\0';
+               pfp = fopen(buf, "r");
+               if (pfp != NULL)
                {
                {
-                       printf("%s: being editted\n", basefile);
+                       while (fgets(pline, sizeof pline, pfp) != NULL)
+                               printf("%12s: being editted: %s", basefile, pline);
+                       fclose(pfp);
                        gotedit = TRUE;
                        continue;
                }
                        gotedit = TRUE;
                        continue;
                }