[BACK]Return to eval.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / m4

Diff for /src/usr.bin/m4/eval.c between version 1.30 and 1.31

version 1.30, 2001/09/18 13:52:58 version 1.31, 2001/09/18 14:05:14
Line 65 
Line 65 
 #include "extern.h"  #include "extern.h"
 #include "pathnames.h"  #include "pathnames.h"
   
   #define BUILTIN_MARKER  "__builtin_"
   
 static void     dodefn __P((const char *));  static void     dodefn __P((const char *));
 static void     dopushdef __P((const char *, const char *));  static void     dopushdef __P((const char *, const char *));
 static void     dodump __P((const char *[], int));  static void     dodump __P((const char *[], int));
Line 544 
Line 546 
         const char *defn;          const char *defn;
 {  {
         ndptr p;          ndptr p;
           int n;
   
         if (!*name)          if (!*name)
                 errx(1, "%s at line %lu: null definition.", CURRENT_NAME,                  errx(1, "%s at line %lu: null definition.", CURRENT_NAME,
Line 552 
Line 555 
                 p = addent(name);                  p = addent(name);
         else if (p->defn != null)          else if (p->defn != null)
                 free((char *) p->defn);                  free((char *) p->defn);
           if (strncmp(defn, BUILTIN_MARKER, sizeof(BUILTIN_MARKER)-1) == 0) {
                   n = builtin_type(defn+sizeof(BUILTIN_MARKER)-1);
                   if (n != -1) {
                           p->type = n;
                           p->defn = null;
                           return;
                   }
           }
         if (!*defn)          if (!*defn)
                 p->defn = null;                  p->defn = null;
         else          else
Line 570 
Line 581 
         const char *name;          const char *name;
 {  {
         ndptr p;          ndptr p;
           char *real;
   
         if ((p = lookup(name)) != nil && p->defn != null) {          if ((p = lookup(name)) != nil) {
                   if (p->defn != null) {
                 pbstr(rquote);                  pbstr(rquote);
                 pbstr(p->defn);                  pbstr(p->defn);
                 pbstr(lquote);                  pbstr(lquote);
                   } else if ((real = builtin_realname(p->type)) != NULL) {
                           pbstr(real);
                           pbstr(BUILTIN_MARKER);
                   }
         }          }
 }  }
   

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31