Bill added more buffers, and I put in sccs.
[unix-history] / usr / src / usr.bin / ex / ex3.7preserve / ex3.7preserve.c
index c915b6b..2934468 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex3.7preserve.c     4.2 %G%";
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
@@ -7,6 +8,12 @@
 #include <pwd.h>
 #include "local/uparm.h"
 
 #include <pwd.h>
 #include "local/uparm.h"
 
+#ifdef VMUNIX
+#define        HBLKS   2
+#else
+#define        HBLKS   1
+#endif
+
 /*
  * Expreserve - preserve a file in usrpath(preserve)
  * Bill Joy UCB November 13, 1977
 /*
  * Expreserve - preserve a file in usrpath(preserve)
  * Bill Joy UCB November 13, 1977
  *      temporaries.
  */
 
  *      temporaries.
  */
 
+#ifndef VMUNIX
 #define        LBLKS   125
 #define        LBLKS   125
+#else
+#define        LBLKS   900
+#endif
 #define        FNSIZE  128
 
 struct         header {
        time_t  Time;                   /* Time temp file last updated */
        short   Uid;                    /* This users identity */
 #define        FNSIZE  128
 
 struct         header {
        time_t  Time;                   /* Time temp file last updated */
        short   Uid;                    /* This users identity */
+#ifndef VMUNIX
        short   Flines;                 /* Number of lines in file */
        short   Flines;                 /* Number of lines in file */
+#else
+       int     Flines;
+#endif
        char    Savedfile[FNSIZE];      /* The current file name */
        short   Blocks[LBLKS];          /* Blocks where line pointers stashed */
 } H;
        char    Savedfile[FNSIZE];      /* The current file name */
        short   Blocks[LBLKS];          /* Blocks where line pointers stashed */
 } H;
@@ -170,7 +185,7 @@ format:
 #endif
                goto format;
        }
 #endif
                goto format;
        }
-       if (H.Blocks[0] != 1 || H.Blocks[1] != 2) {
+       if (H.Blocks[0] != HBLKS || H.Blocks[1] != HBLKS+1) {
 #ifdef DEBUG
                fprintf(stderr, "Blocks %d %d\n", H.Blocks[0], H.Blocks[1]);
 #endif
 #ifdef DEBUG
                fprintf(stderr, "Blocks %d %d\n", H.Blocks[0], H.Blocks[1]);
 #endif