Re: [PATCH] Normalise directory names when pushing to some WebDAV servers
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Nov 19, 2010, 05:10 UTC
- Message-ID
- <20101119051047.GA4201@burratino>
- In-Reply-To
- <AANLkTikM8mNv+GiVyDWEJxsf0o3FYaaJj+jdYyiuXnov@mail.gmail.com>
Tay Ray Chuan wrote:
Show 16 quoted lines
> --- 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