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

Diff for /mandoc/mdoc.c between version 1.262 and 1.265

version 1.262, 2017/04/24 23:06:18 version 1.265, 2017/06/07 20:30:40
Line 253  mdoc_ptext(struct roff_man *mdoc, int line, char *buf,
Line 253  mdoc_ptext(struct roff_man *mdoc, int line, char *buf,
                  * blank lines aren't allowed, but enough manuals assume this                   * blank lines aren't allowed, but enough manuals assume this
                  * behaviour that we want to work around it.                   * behaviour that we want to work around it.
                  */                   */
                 roff_elem_alloc(mdoc, line, offs, MDOC_sp);                  roff_elem_alloc(mdoc, line, offs, ROFF_sp);
                 mdoc->last->flags |= NODE_VALID | NODE_ENDED;                  mdoc->last->flags |= NODE_VALID | NODE_ENDED;
                 mdoc->next = ROFF_NEXT_SIBLING;                  mdoc->next = ROFF_NEXT_SIBLING;
                 return 1;                  return 1;
Line 278  mdoc_ptext(struct roff_man *mdoc, int line, char *buf,
Line 278  mdoc_ptext(struct roff_man *mdoc, int line, char *buf,
         for (c = buf + offs; c != NULL; c = strchr(c + 1, '.')) {          for (c = buf + offs; c != NULL; c = strchr(c + 1, '.')) {
                 if (c - buf < offs + 2)                  if (c - buf < offs + 2)
                         continue;                          continue;
                 if (end - c < 4)                  if (end - c < 3)
                         break;                          break;
                 if (isalpha((unsigned char)c[-2]) &&                  if (isalpha((unsigned char)c[-2]) &&
                     isalpha((unsigned char)c[-1]) &&                      isalpha((unsigned char)c[-1]) &&
Line 302  mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, 
Line 302  mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, 
 {  {
         struct roff_node *n;          struct roff_node *n;
         const char       *cp;          const char       *cp;
           size_t            sz;
         enum roff_tok     tok;          enum roff_tok     tok;
         int               i, sv;          int               sv;
         char              mac[5];  
   
         sv = offs;          /* Determine the line macro. */
   
         /*          sv = offs;
          * Copy the first word into a nil-terminated buffer.          tok = TOKEN_NONE;
          * Stop when a space, tab, escape, or eoln is encountered.          for (sz = 0; sz < 4 && strchr(" \t\\", buf[offs]) == NULL; sz++)
          */                  offs++;
           if (sz == 2 || sz == 3)
         i = 0;                  tok = roffhash_find(mdoc->mdocmac, buf + sv, sz);
         while (i < 4 && strchr(" \t\\", buf[offs]) == NULL)  
                 mac[i++] = buf[offs++];  
   
         mac[i] = '\0';  
   
         tok = (i > 1 && i < 4) ? mdoc_hash_find(mac) : TOKEN_NONE;  
   
         if (tok == TOKEN_NONE) {          if (tok == TOKEN_NONE) {
                 mandoc_msg(MANDOCERR_MACRO, mdoc->parse,                  mandoc_msg(MANDOCERR_MACRO, mdoc->parse,
                     ln, sv, buf + sv - 1);                      ln, sv, buf + sv - 1);

Legend:
Removed from v.1.262  
changed lines
  Added in v.1.265

CVSweb