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

Diff for /src/usr.bin/mandoc/mdoc_argv.c between version 1.27 and 1.28

version 1.27, 2010/05/15 12:30:59 version 1.28, 2010/05/15 13:12:55
Line 394 
Line 394 
         assert(*pos);          assert(*pos);
         assert(' ' != buf[*pos]);          assert(' ' != buf[*pos]);
   
         if ('\0' == buf[*pos])          if ('\0' == buf[*pos]) {
                   if (MDOC_PPHRASE & m->flags)
                           return(ARGS_EOLN);
                   /*
                    * If we're not in a partial phrase and the flag for
                    * being a phrase literal is still set, the punctuation
                    * is unterminated.
                    */
                   if (MDOC_PHRASELIT & m->flags)
                           if ( ! mdoc_pwarn(m, line, *pos, EQUOTTERM))
                                   return(ARGS_ERROR);
   
                   m->flags &= ~MDOC_PHRASELIT;
                 return(ARGS_EOLN);                  return(ARGS_EOLN);
           }
   
         /*          /*
          * If the first character is a closing delimiter and we're to           * If the first character is a closing delimiter and we're to
Line 441 
Line 454 
         if (ARGS_TABSEP & fl) {          if (ARGS_TABSEP & fl) {
                 /* Scan ahead to tab (can't be escaped). */                  /* Scan ahead to tab (can't be escaped). */
                 p = strchr(*v, '\t');                  p = strchr(*v, '\t');
                   pp = NULL;
   
                 /* Scan ahead to unescaped `Ta'. */                  /* Scan ahead to unescaped `Ta'. */
                 for (pp = *v; ; pp++) {                  if ( ! (MDOC_PHRASELIT & m->flags))
                         if (NULL == (pp = strstr(pp, "Ta")))                          for (pp = *v; ; pp++) {
                                 break;                                  if (NULL == (pp = strstr(pp, "Ta")))
                         if (pp > *v && ' ' != *(pp - 1))                                          break;
                                 continue;                                  if (pp > *v && ' ' != *(pp - 1))
                         if (' ' == *(pp + 2) || 0 == *(pp + 2))                                          continue;
                                 break;                                  if (' ' == *(pp + 2) || 0 == *(pp + 2))
                 }                                          break;
                           }
   
                 /* By default, assume a phrase. */                  /* By default, assume a phrase. */
                 rc = ARGS_PHRASE;                  rc = ARGS_PHRASE;
Line 503 
Line 518 
          * Whitespace is NOT involved in literal termination.           * Whitespace is NOT involved in literal termination.
          */           */
   
         if ('\"' == buf[*pos]) {          if (MDOC_PHRASELIT & m->flags || '\"' == buf[*pos]) {
                 *v = &buf[++(*pos)];                  if ( ! (MDOC_PHRASELIT & m->flags))
                           *v = &buf[++(*pos)];
   
                   if (MDOC_PPHRASE & m->flags)
                           m->flags |= MDOC_PHRASELIT;
   
                 for ( ; buf[*pos]; (*pos)++) {                  for ( ; buf[*pos]; (*pos)++) {
                         if ('\"' != buf[*pos])                          if ('\"' != buf[*pos])
                                 continue;                                  continue;
Line 514 
Line 533 
                         (*pos)++;                          (*pos)++;
                 }                  }
   
                 if (0 == buf[*pos]) {                  if ('\0' == buf[*pos]) {
                         if (ARGS_NOWARN & fl)                          if (ARGS_NOWARN & fl || MDOC_PPHRASE & m->flags)
                                 return(ARGS_QWORD);                                  return(ARGS_QWORD);
                         if ( ! mdoc_pwarn(m, line, *pos, EQUOTTERM))                          if ( ! mdoc_pwarn(m, line, *pos, EQUOTTERM))
                                 return(ARGS_ERROR);                                  return(ARGS_ERROR);
                         return(ARGS_QWORD);                          return(ARGS_QWORD);
                 }                  }
   
                 buf[(*pos)++] = 0;                  m->flags &= ~MDOC_PHRASELIT;
                   buf[(*pos)++] = '\0';
   
                 if (0 == buf[*pos])                  if ('\0' == buf[*pos])
                         return(ARGS_QWORD);                          return(ARGS_QWORD);
   
                 while (' ' == buf[*pos])                  while (' ' == buf[*pos])
Line 546 
Line 566 
                 if (' ' == buf[*pos] && '\\' != buf[*pos - 1])                  if (' ' == buf[*pos] && '\\' != buf[*pos - 1])
                         break;                          break;
   
         if (0 == buf[*pos])          if ('\0' == buf[*pos])
                 return(ARGS_WORD);                  return(ARGS_WORD);
   
         buf[(*pos)++] = 0;          buf[(*pos)++] = '\0';
   
         while (' ' == buf[*pos])          while (' ' == buf[*pos])
                 (*pos)++;                  (*pos)++;
   
         if (0 == buf[*pos] && ! (ARGS_NOWARN & fl))          if ('\0' == buf[*pos] && ! (ARGS_NOWARN & fl))
                 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))                  if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
                         return(ARGS_ERROR);                          return(ARGS_ERROR);
   

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28