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

Diff for /mandoc/Attic/argv.c between version 1.16 and 1.19

version 1.16, 2009/01/17 20:10:36 version 1.19, 2009/01/20 13:05:28
Line 25 
Line 25 
   
 #include "private.h"  #include "private.h"
   
   
 /* FIXME: .It called with -column and quoted arguments. */  /* FIXME: .It called with -column and quoted arguments. */
   /* FIXME: if arguments are quoted, they should not be later parsed for
    * macros. */
   
 static  int              lookup(int, const char *);  static  int              lookup(int, const char *);
 static  int              parse(struct mdoc *, int,  static  int              parse(struct mdoc *, int,
Line 78  mdoc_args(struct mdoc *mdoc, int line, int *pos, char 
Line 79  mdoc_args(struct mdoc *mdoc, int line, int *pos, char 
   
         /* Parse routine for non-quoted string. */          /* Parse routine for non-quoted string. */
   
         if ('\"' != buf[*pos]) {          assert(*pos > 0);
           if ('\"' != buf[*pos] || ! (ARGS_QUOTED & fl)) {
                 *v = &buf[*pos];                  *v = &buf[*pos];
   
                 /* FIXME: UGLY tab-sep processing. */                  /* FIXME: UGLY tab-sep processing. */
Line 98  mdoc_args(struct mdoc *mdoc, int line, int *pos, char 
Line 100  mdoc_args(struct mdoc *mdoc, int line, int *pos, char 
                                 }                                  }
                                 (*pos)++;                                  (*pos)++;
                         }                          }
                 else                  else {
                         while (buf[*pos] && ! isspace(buf[*pos]))                          while (buf[*pos]) {
                                   if (isspace(buf[*pos]))
                                           if ('\\' != buf[*pos - 1])
                                                   break;
                                 (*pos)++;                                  (*pos)++;
                           }
                   }
   
                 if (0 == buf[*pos])                  if (0 == buf[*pos])
                         return(ARGS_WORD);                          return(ARGS_WORD);
Line 141  mdoc_args(struct mdoc *mdoc, int line, int *pos, char 
Line 148  mdoc_args(struct mdoc *mdoc, int line, int *pos, char 
   
         buf[(*pos)++] = 0;          buf[(*pos)++] = 0;
         if (0 == buf[*pos])          if (0 == buf[*pos])
                 return(ARGS_WORD);                  return(ARGS_QWORD);
   
         while (buf[*pos] && isspace(buf[*pos]))          while (buf[*pos] && isspace(buf[*pos]))
                 (*pos)++;                  (*pos)++;
   
         if (buf[*pos])          if (buf[*pos])
                 return(ARGS_WORD);                  return(ARGS_QWORD);
   
         if ( ! mdoc_pwarn(mdoc, line, *pos, WARN_COMPAT, "whitespace at end-of-line"))          if ( ! mdoc_pwarn(mdoc, line, *pos, WARN_COMPAT, "whitespace at end-of-line"))
                 return(ARGS_ERROR);                  return(ARGS_ERROR);
   
         return(ARGS_WORD);          return(ARGS_QWORD);
 }  }
   
   
Line 451  mdoc_argv(struct mdoc *mdoc, int line, int tok,
Line 458  mdoc_argv(struct mdoc *mdoc, int line, int tok,
         v->line = line;          v->line = line;
         v->pos = *pos;          v->pos = *pos;
   
         while (buf[*pos] && ! isspace(buf[*pos]))          assert(*pos > 0);
           while (buf[*pos]) {
                   if (isspace(buf[*pos]))
                           if ('\\' != buf[*pos - 1])
                                   break;
                 (*pos)++;                  (*pos)++;
           }
   
         if (buf[*pos])          if (buf[*pos])
                 buf[(*pos)++] = 0;                  buf[(*pos)++] = 0;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.19

CVSweb