shithub: mc

Download patch

ref: 6ef4f09df64f4215213545cc9d1da748c830362b
parent: 507c0dc4eb7b20d87dc7ac06316e4620057e47ab
author: Ori Bernstein <[email protected]>
date: Thu May 2 07:42:48 EDT 2013

Remove terminating 'Z' from usefile definition.

    It's not useful. We have EOF to signal the end.

--- a/parse/use.c
+++ b/parse/use.c
@@ -538,6 +538,12 @@
     return s;
 }
 
+/* Usefile format:
+ *     U<pkgname>
+ *     T<pickled-type>
+ *     D<picled-decl>
+ *     G<pickled-decl><pickled-initializer>
+ */
 int loaduse(FILE *f, Stab *st)
 {
     char *pkg;
@@ -566,7 +572,7 @@
             s = st;
         }
     }
-    while ((c = fgetc(f)) != 'Z') {
+    while ((c = fgetc(f)) != EOF) {
         switch(c) {
             case 'G':
             case 'D':
@@ -621,13 +627,6 @@
         die("Could not load usefile %s", use->use.name);
 }
 
-/* Usefile format:
- * U<pkgname>
- * T<pickled-type>
- * D<picled-decl>
- * G<pickled-decl><pickled-initializer>
- * Z
- */
 void writeuse(FILE *f, Node *file)
 {
     Stab *st;
@@ -661,5 +660,4 @@
         wrsym(f, s);
     }
     free(k);
-    wrbyte(f, 'Z');
 }