[BACK]Return to roff.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/roff.c between version 1.315 and 1.318

version 1.315, 2017/06/18 17:36:03 version 1.318, 2017/07/04 22:52:00
Line 330  const char *__roff_name[MAN_MAX + 1] = {
Line 330  const char *__roff_name[MAN_MAX + 1] = {
         "RE",           "RS",           "DT",           "UC",          "RE",           "RS",           "DT",           "UC",
         "PD",           "AT",           "in",          "PD",           "AT",           "in",
         "OP",           "EX",           "EE",           "UR",          "OP",           "EX",           "EE",           "UR",
         "UE",           NULL          "UE",           "MT",           "ME",           NULL
 };  };
 const   char *const *roff_name = __roff_name;  const   char *const *roff_name = __roff_name;
   
Line 819  roff_man_free(struct roff_man *man)
Line 819  roff_man_free(struct roff_man *man)
   
 struct roff_man *  struct roff_man *
 roff_man_alloc(struct roff *roff, struct mparse *parse,  roff_man_alloc(struct roff *roff, struct mparse *parse,
         const char *defos, int quick)          const char *os_s, int quick)
 {  {
         struct roff_man *man;          struct roff_man *man;
   
         man = mandoc_calloc(1, sizeof(*man));          man = mandoc_calloc(1, sizeof(*man));
         man->parse = parse;          man->parse = parse;
         man->roff = roff;          man->roff = roff;
         man->defos = defos;          man->os_s = os_s;
         man->quick = quick;          man->quick = quick;
         roff_man_alloc1(man);          roff_man_alloc1(man);
         roff->man = man;          roff->man = man;
Line 1138  roff_res(struct roff *r, struct buf *buf, int ln, int 
Line 1138  roff_res(struct roff *r, struct buf *buf, int ln, int 
         size_t           maxl;  /* expected length of the escape name */          size_t           maxl;  /* expected length of the escape name */
         size_t           naml;  /* actual length of the escape name */          size_t           naml;  /* actual length of the escape name */
         enum mandoc_esc  esc;   /* type of the escape sequence */          enum mandoc_esc  esc;   /* type of the escape sequence */
         enum mdoc_os     os_e;  /* kind of RCS id seen */          enum mandoc_os   os_e;  /* kind of RCS id seen */
         int              inaml; /* length returned from mandoc_escape() */          int              inaml; /* length returned from mandoc_escape() */
         int              expand_count;  /* to avoid infinite loops */          int              expand_count;  /* to avoid infinite loops */
         int              npos;  /* position in numeric expression */          int              npos;  /* position in numeric expression */
Line 1161  roff_res(struct roff *r, struct buf *buf, int ln, int 
Line 1161  roff_res(struct roff *r, struct buf *buf, int ln, int 
                 /* Comment found, look for RCS id. */                  /* Comment found, look for RCS id. */
   
                 if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) {                  if ((cp = strstr(stesc, "$" "OpenBSD")) != NULL) {
                         os_e = MDOC_OS_OPENBSD;                          os_e = MANDOC_OS_OPENBSD;
                         cp += 8;                          cp += 8;
                 } else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) {                  } else if ((cp = strstr(stesc, "$" "NetBSD")) != NULL) {
                         os_e = MDOC_OS_NETBSD;                          os_e = MANDOC_OS_NETBSD;
                         cp += 7;                          cp += 7;
                 }                  }
                 if (cp != NULL &&                  if (cp != NULL &&
Line 1926  roff_cond_sub(ROFF_ARGS)
Line 1926  roff_cond_sub(ROFF_ARGS)
   
         rr = r->last->rule;          rr = r->last->rule;
         roffnode_cleanscope(r);          roffnode_cleanscope(r);
         t = roff_parse(r, buf->buf, &pos, ln, ppos);  
   
         /*          /*
          * Fully handle known macros when they are structurally  
          * required or when the conditional evaluated to true.  
          */  
   
         if (t != TOKEN_NONE && (rr || roffs[t].flags & ROFFMAC_STRUCT))  
                 return (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs);  
   
         /*  
          * If `\}' occurs on a macro line without a preceding macro,           * If `\}' occurs on a macro line without a preceding macro,
          * drop the line completely.           * drop the line completely.
          */           */
Line 1948  roff_cond_sub(ROFF_ARGS)
Line 1939  roff_cond_sub(ROFF_ARGS)
         /* Always check for the closing delimiter `\}'. */          /* Always check for the closing delimiter `\}'. */
   
         while ((ep = strchr(ep, '\\')) != NULL) {          while ((ep = strchr(ep, '\\')) != NULL) {
                 if (*(++ep) == '}') {                  switch (ep[1]) {
                         *ep = '&';                  case '}':
                         roff_ccond(r, ln, ep - buf->buf - 1);                          memmove(ep, ep + 2, strlen(ep + 2) + 1);
                 }                          roff_ccond(r, ln, ep - buf->buf);
                 if (*ep != '\0')                          break;
                   case '\0':
                         ++ep;                          ++ep;
                           break;
                   default:
                           ep += 2;
                           break;
                   }
         }          }
         return rr ? ROFF_CONT : ROFF_IGN;  
           /*
            * Fully handle known macros when they are structurally
            * required or when the conditional evaluated to true.
            */
   
           t = roff_parse(r, buf->buf, &pos, ln, ppos);
           return t != TOKEN_NONE && (rr || roffs[t].flags & ROFFMAC_STRUCT)
               ? (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs) : rr
               ? ROFF_CONT : ROFF_IGN;
 }  }
   
 static enum rofferr  static enum rofferr

Legend:
Removed from v.1.315  
changed lines
  Added in v.1.318

CVSweb