joes        2003/04/13 10:53:10

  Modified:    src      apreq_parsers.c
  Log:
  bugfixes for nextval()
  
  Revision  Changes    Path
  1.9       +11 -4     httpd-apreq-2/src/apreq_parsers.c
  
  Index: apreq_parsers.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- apreq_parsers.c   13 Apr 2003 17:03:54 -0000      1.8
  +++ apreq_parsers.c   13 Apr 2003 17:53:10 -0000      1.9
  @@ -680,10 +680,11 @@
           if (loc == NULL || loc - *line < nlen)
               return APR_NOTFOUND;
   
  -        *val = loc + 1;
           vlen = 0;
  +        *val = loc + 1;
  +        --loc;
   
  -        while ( apr_isspace(*loc) && loc - *line > nlen )
  +        while (apr_isspace(*loc) && loc - *line > nlen)
               --loc;
   
           loc -= nlen;
  @@ -691,12 +692,16 @@
           if (strncasecmp(loc, name, nlen) != 0)
               return APR_NOTFOUND;
   
  +        while (apr_isspace(**val))
  +            ++*val;
  +
           *line = *val;
           return APR_SUCCESS;
       }
   
   
       *val = loc + 1;
  +    --loc;
   
       while (apr_isspace(*loc) && loc - *line > nlen)
           --loc;
  @@ -716,21 +721,23 @@
       
       for(loc = *val; *loc; ++loc) {
           switch (*loc) {
  +        case ' ':
  +        case '\t':
           case ';':
               if (in_quotes)
                   continue;
               /* else fall through */
           case '"':
  -            break;
  +            goto finish;
           case '\\':
               if (in_quotes && loc[1] != 0)
                   ++loc;
  -            break;
           default:
               break;
           }
       }
   
  + finish:
       *vlen = loc - *val;
       *line = (*loc == 0) ? loc : loc + 1;
       return APR_SUCCESS;
  
  
  

Reply via email to