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

Diff for /mandoc/roff.c between version 1.142 and 1.144

version 1.142, 2011/05/26 11:58:25 version 1.144, 2011/07/08 09:28:33
Line 347  roff_free1(struct roff *r)
Line 347  roff_free1(struct roff *r)
 void  void
 roff_reset(struct roff *r)  roff_reset(struct roff *r)
 {  {
           int              i;
   
         roff_free1(r);          roff_free1(r);
   
           for (i = 0; i < PREDEFS_MAX; i++)
                   roff_setstr(r, predefs[i].name, predefs[i].str, 0);
 }  }
   
   
Line 592  roff_parse(struct roff *r, const char *buf, int *pos)
Line 596  roff_parse(struct roff *r, const char *buf, int *pos)
         size_t           maclen;          size_t           maclen;
         enum rofft       t;          enum rofft       t;
   
         if ('\0' == buf[*pos] || '"' == buf[*pos])          if ('\0' == buf[*pos] || '"' == buf[*pos] ||
                           '\t' == buf[*pos] || ' ' == buf[*pos])
                 return(ROFF_MAX);                  return(ROFF_MAX);
   
           /*
            * We stop the macro parse at an escape, tab, space, or nil.
            * However, `\}' is also a valid macro, so make sure we don't
            * clobber it by seeing the `\' as the end of token.
            */
   
         mac = buf + *pos;          mac = buf + *pos;
         maclen = strcspn(mac, " \\\t\0");          maclen = strcspn(mac + 1, " \\\t\0") + 1;
   
         t = (r->current_string = roff_getstrn(r, mac, maclen))          t = (r->current_string = roff_getstrn(r, mac, maclen))
             ? ROFF_USERDEF : roff_hash_find(mac, maclen);              ? ROFF_USERDEF : roff_hash_find(mac, maclen);
Line 878  roff_cond_sub(ROFF_ARGS)
Line 889  roff_cond_sub(ROFF_ARGS)
                         ep++;                          ep++;
                         if ('}' != *ep)                          if ('}' != *ep)
                                 continue;                                  continue;
                         *ep = '&';  
                           /*
                            * Make the \} go away.
                            * This is a little haphazard, as it's not quite
                            * clear how nroff does this.
                            * If we're at the end of line, then just chop
                            * off the \} and resize the buffer.
                            * If we aren't, then conver it to spaces.
                            */
   
                           if ('\0' == *(ep + 1)) {
                                   *--ep = '\0';
                                   *szp -= 2;
                           } else
                                   *(ep - 1) = *ep = ' ';
   
                         roff_ccond(r, ROFF_ccond, bufp, szp,                          roff_ccond(r, ROFF_ccond, bufp, szp,
                                         ln, pos, pos + 2, offs);                                          ln, pos, pos + 2, offs);
                         break;                          break;

Legend:
Removed from v.1.142  
changed lines
  Added in v.1.144

CVSweb