httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: httpd-2.0/modules/dav/fs dbm.c
Date Tue, 18 Sep 2001 08:40:25 GMT
gstein      01/09/18 01:40:25

  Modified:    modules/dav/fs dbm.c
  Log:
  Simplify dav_propdb_define_namespaces(); since we're putting the value in
  the pool (now), forget the stack-based buffer altogether.
  
  Revision  Changes    Path
  1.20      +4 -10     httpd-2.0/modules/dav/fs/dbm.c
  
  Index: dbm.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/dav/fs/dbm.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- dbm.c	2001/09/18 04:09:19	1.19
  +++ dbm.c	2001/09/18 08:40:25	1.20
  @@ -534,22 +534,16 @@
   
   static dav_error * dav_propdb_define_namespaces(dav_db *db, dav_xmlns_info *xi)
   {
  -    int ns = db->ns_count;
  +    int ns;
       const char *uri = db->ns_table.buf + sizeof(dav_propdb_metadata);
  -    char prefix[23];    /* "ns" + 20 digits + '\0' */
   
  -    prefix[0] = 'n';
  -    prefix[1] = 's';
  -
       /* within the prop values, we use "ns%d" for prefixes... register them */
       for (ns = 0; ns < db->ns_count; ++ns, uri += strlen(uri) + 1) {
  -        sprintf(&prefix[2], "%d", ns);
   
  -        /* prefix is on the stack, and ns_table.buf can move, so copy the
  -           two strings (and we simply want the values to last as long as
  -           the provided dav_xmlns_info). */
  +        /* ns_table.buf can move, so copy its value (we want the values to
  +           last as long as the provided dav_xmlns_info). */
           dav_xmlns_add(xi,
  -                      apr_pstrdup(xi->pool, prefix),
  +                      apr_psprintf(xi->pool, "ns%d", ns),
                         apr_pstrdup(xi->pool, uri));
       }
   
  
  
  

Mime
View raw message