From: Jonathan Nieder Date: Fri, 19 Nov 2010 05:10:47 GMT Subject: Re: [PATCH] Normalise directory names when pushing to some WebDAV servers Message-ID: <20101119051047.GA4201@burratino> In-Reply-To: Tay Ray Chuan wrote: > --- a/http-push.c > +++ b/http-push.c > @@ -1086,10 +1086,15 @@ static void process_ls_ref(struct remote_ls_ctx *ls) > static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed) > { > struct remote_ls_ctx *ls = (struct remote_ls_ctx *)ctx->userData; > + struct strbuf buf = STRBUF_INIT; > > if (tag_closed) { > if (!strcmp(ctx->name, DAV_PROPFIND_RESP) && ls->dentry_name) { > if (ls->dentry_flags & IS_DIR) { > + end_url_with_slash(&buf, ls->dentry_name); > + free(ls->dentry_name); > + ls->dentry_name = strbuf_detach(&buf, NULL); > + > if (ls->flags & PROCESS_DIRS) { Nit: might make sense to narrow the scope of buf, to avoid tempting people to reuse or release it. Thanks, Jonathan