~ubuntu-branches/ubuntu/precise/subversion/precise-security

« back to all changes in this revision

Viewing changes to subversion/libsvn_ra_neon/mergeinfo.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-06-06 22:57:04 UTC
  • mfrom: (1.2.1 upstream)
  • mto: (1.3.4 merge)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20090606225704-aivy7dhglo1zd120
Tags: upstream-1.5.6dfsg
ImportĀ upstreamĀ versionĀ 1.5.6dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <apr_tables.h>
23
23
#include <apr_strings.h>
24
24
#include <apr_xml.h>
 
25
#include <assert.h>
25
26
 
26
27
#include <ne_socket.h>
27
28
 
43
44
struct mergeinfo_baton
44
45
{
45
46
  apr_pool_t *pool;
46
 
  const char *curr_path;
 
47
  svn_stringbuf_t *curr_path;
47
48
  svn_stringbuf_t *curr_info;
48
49
  svn_mergeinfo_catalog_t catalog;
49
50
  svn_error_t *err;
86
87
  if (elm->id == ELEM_mergeinfo_item)
87
88
    {
88
89
      svn_stringbuf_setempty(mb->curr_info);
89
 
      mb->curr_path = NULL;
 
90
      svn_stringbuf_setempty(mb->curr_path);
90
91
    }
91
92
 
92
93
  SVN_ERR(mb->err);
112
113
        {
113
114
          svn_mergeinfo_t path_mergeinfo;
114
115
 
115
 
          mb->err = svn_mergeinfo_parse(&path_mergeinfo, mb->curr_info->data,
116
 
                                        mb->pool);
117
 
          SVN_ERR(mb->err);
118
 
 
119
 
          apr_hash_set(mb->catalog, mb->curr_path,  APR_HASH_KEY_STRING,
120
 
                       path_mergeinfo);
 
116
          assert(mb->curr_path->data);
 
117
          SVN_ERR((mb->err = svn_mergeinfo_parse(&path_mergeinfo, 
 
118
                                                 mb->curr_info->data,
 
119
                                                 mb->pool)));
 
120
          apr_hash_set(mb->catalog, apr_pstrdup(mb->pool, mb->curr_path->data),
 
121
                       APR_HASH_KEY_STRING, path_mergeinfo);
121
122
        }
122
123
    }
123
124
 
133
134
  switch (state)
134
135
    {
135
136
    case ELEM_mergeinfo_path:
136
 
      mb->curr_path = apr_pstrndup(mb->pool, cdata, nlen);
 
137
      if (mb->curr_path)
 
138
        svn_stringbuf_appendbytes(mb->curr_path, cdata, nlen);
137
139
      break;
138
140
 
139
141
    case ELEM_mergeinfo_info:
211
213
  svn_stringbuf_appendcstr(request_body, minfo_report_tail);
212
214
 
213
215
  mb.pool = pool;
214
 
  mb.curr_path = NULL;
 
216
  mb.curr_path = svn_stringbuf_create("", pool);
215
217
  mb.curr_info = svn_stringbuf_create("", pool);
216
218
  mb.catalog = apr_hash_make(pool);
217
219
  mb.err = SVN_NO_ERROR;