You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/04/30 19:43:40 UTC

cvs commit: apache-2.0/src/lib/apr/include apr_lib.h

rbb         00/04/30 10:43:40

  Modified:    src      CHANGES
               src/lib/apr/lib apr_cpystrn.c
               src/lib/apr/include apr_lib.h
  Log:
  Fix ap_tokenize_to_argv to respect the const arguments it is passed.  This
  is the first step to getting piped and reliable piped logs workin in 2.0
  
  Revision  Changes    Path
  1.94      +4 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- CHANGES	2000/04/30 03:11:42	1.93
  +++ CHANGES	2000/04/30 17:43:39	1.94
  @@ -1,4 +1,8 @@
   Changes with Apache 2.0a4-dev
  +  *) Fix ap_tokenize_to_argv to respect the const arguments that are
  +     passed to it.
  +     [Ryan Bloom]
  +
     *) Fix mm's memcpy/memset macros, pointer arithmetic was broken.
        Patch submitted to author.
        [Sascha Schumann]
  
  
  
  1.18      +7 -4      apache-2.0/src/lib/apr/lib/apr_cpystrn.c
  
  Index: apr_cpystrn.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/lib/apr_cpystrn.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- apr_cpystrn.c	2000/04/28 01:14:12	1.17
  +++ apr_cpystrn.c	2000/04/30 17:43:39	1.18
  @@ -118,10 +118,12 @@
    *                   pool and filled in with copies of the tokens
    *                   found during parsing of the arg_str. 
    */
  -API_EXPORT(ap_status_t) ap_tokenize_to_argv(char *arg_str, char ***argv_out,
  +API_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, 
  +                                            char ***argv_out,
                                               ap_pool_t *token_context)
   {
  -    char *cp, *tmpCnt;
  +    const char *cp;
  +    const char *tmpCnt;
       int isquoted, numargs = 0, rc = APR_SUCCESS;
   
   #define SKIP_WHITESPACE(cp) \
  @@ -186,8 +188,9 @@
               break;
           }
           else {
  -            *cp++ = '\0';
  -            (*argv_out)[numargs] = ap_pstrdup(token_context, tmpCnt);
  +            cp++;
  +            (*argv_out)[numargs] = ap_palloc(token_context, cp - tmpCnt);
  +            ap_cpystrn((*argv_out)[numargs], tmpCnt, cp - tmpCnt);
               numargs++;
           }
           
  
  
  
  1.29      +2 -1      apache-2.0/src/lib/apr/include/apr_lib.h
  
  Index: apr_lib.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_lib.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- apr_lib.h	2000/04/28 01:14:11	1.28
  +++ apr_lib.h	2000/04/30 17:43:39	1.29
  @@ -127,7 +127,8 @@
    * Define the prototypes for the various APR GP routines.
    */
   API_EXPORT(char *) ap_cpystrn(char *d, const char *s, size_t l);
  -API_EXPORT(ap_status_t) ap_tokenize_to_argv(char *arg_str, char ***argv_out,
  +API_EXPORT(ap_status_t) ap_tokenize_to_argv(const char *arg_str, 
  +                                            char ***argv_out,
                                               ap_pool_t *token_context);
   API_EXPORT(const char *) ap_filename_of_pathname(const char *pathname);
   API_EXPORT(char *) ap_collapse_spaces(char *dest, const char *src);