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

Diff for /src/usr.bin/mandoc/man.c between version 1.90 and 1.91

version 1.90, 2014/11/03 23:17:21 version 1.91, 2014/11/19 03:07:43
Line 481 
Line 481 
 static int  static int
 man_pmacro(struct man *man, int ln, char *buf, int offs)  man_pmacro(struct man *man, int ln, char *buf, int offs)
 {  {
         char             mac[5];  
         struct man_node *n;          struct man_node *n;
           const char      *cp;
         enum mant        tok;          enum mant        tok;
         int              i, ppos;          int              i, ppos;
         int              bline;          int              bline;
           char             mac[5];
   
         ppos = offs;          ppos = offs;
   
         /*          /*
          * Copy the first word into a nil-terminated buffer.           * Copy the first word into a nil-terminated buffer.
          * Stop copying when a tab, space, or eoln is encountered.           * Stop when a space, tab, escape, or eoln is encountered.
          */           */
   
         i = 0;          i = 0;
         while (i < 4 && '\0' != buf[offs] && ' ' != buf[offs] &&          while (i < 4 && strchr(" \t\\", buf[offs]) == NULL)
             '\t' != buf[offs])  
                 mac[i++] = buf[offs++];                  mac[i++] = buf[offs++];
   
         mac[i] = '\0';          mac[i] = '\0';
   
         tok = (i > 0 && i < 4) ? man_hash_find(mac) : MAN_MAX;          tok = (i > 0 && i < 4) ? man_hash_find(mac) : MAN_MAX;
   
         if (MAN_MAX == tok) {          if (tok == MAN_MAX) {
                 mandoc_msg(MANDOCERR_MACRO, man->parse,                  mandoc_msg(MANDOCERR_MACRO, man->parse,
                     ln, ppos, buf + ppos - 1);                      ln, ppos, buf + ppos - 1);
                 return(1);                  return(1);
         }          }
   
         /* The macro is sane.  Jump to the next word. */          /* Skip a leading escape sequence or tab. */
   
           switch (buf[offs]) {
           case '\\':
                   cp = buf + offs + 1;
                   mandoc_escape(&cp, NULL, NULL);
                   offs = cp - buf;
                   break;
           case '\t':
                   offs++;
                   break;
           default:
                   break;
           }
   
           /* Jump to the next non-whitespace word. */
   
         while (buf[offs] && ' ' == buf[offs])          while (buf[offs] && ' ' == buf[offs])
                 offs++;                  offs++;

Legend:
Removed from v.1.90  
changed lines
  Added in v.1.91