Navigation Menu

Skip to content

Commit

Permalink
Copy body
Browse files Browse the repository at this point in the history
Because XML transform replaces body inplace. :<
  • Loading branch information
kou committed Jan 7, 2015
1 parent a456cd1 commit 4a86a28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/groonga.c
Expand Up @@ -311,7 +311,7 @@ s_output_typed(grn_ctx *ctx, int flags, FILE *stream)
grn_obj body;
grn_obj *command;

GRN_TEXT_INIT(&body, GRN_OBJ_DO_SHALLOW_COPY);
GRN_TEXT_INIT(&body, 0);
grn_ctx_recv(ctx, &chunk, &chunk_size, &recv_flags);
GRN_TEXT_SET(ctx, &body, chunk, chunk_size);

Expand All @@ -328,6 +328,8 @@ s_output_typed(grn_ctx *ctx, int flags, FILE *stream)
GRN_OBJ_FIN(ctx, &head);
GRN_OBJ_FIN(ctx, &foot);
}
GRN_OBJ_FIN(ctx, &body);

command = GRN_CTX_USER_DATA(ctx)->ptr;
GRN_BULK_REWIND(command);
}
Expand Down Expand Up @@ -896,7 +898,7 @@ h_output_typed(grn_ctx *ctx, int flags, ht_context *hc)

GRN_TEXT_INIT(&header, 0);
GRN_TEXT_INIT(&head, 0);
GRN_TEXT_INIT(&body, GRN_OBJ_DO_SHALLOW_COPY);
GRN_TEXT_INIT(&body, 0);
GRN_TEXT_INIT(&foot, 0);

grn_ctx_recv(ctx, &chunk, &chunk_size, &recv_flags);
Expand Down

0 comments on commit 4a86a28

Please sign in to comment.