You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rb...@apache.org on 2004/03/06 03:49:50 UTC

cvs commit: apr/strings apr_fnmatch.c

rbb         2004/03/05 18:49:50

  Modified:    strings  apr_fnmatch.c
  Log:
  Fix a bug in apr_match_glob.  We need to strdup the filename, otherwise
  each call to apr_dir_read will overwrite the previous name.
  
  Revision  Changes    Path
  1.10      +1 -1      apr/strings/apr_fnmatch.c
  
  Index: apr_fnmatch.c
  ===================================================================
  RCS file: /home/cvs/apr/strings/apr_fnmatch.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- apr_fnmatch.c	5 Mar 2004 19:52:06 -0000	1.9
  +++ apr_fnmatch.c	6 Mar 2004 02:49:50 -0000	1.10
  @@ -285,7 +285,7 @@
   
       while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) {
           if (apr_fnmatch(pattern, finfo.name, 0) == APR_SUCCESS) {
  -            *(const char **)apr_array_push(*result) = finfo.name;
  +            *(const char **)apr_array_push(*result) = apr_pstrdup(p, finfo.name);
           }
       }
       apr_dir_close(dir);