From 78409a2251e345249316f3fcccb31d7b8ba97ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 10 Feb 2019 18:55:06 +0100 Subject: Merge strbuf copy functions. --- parse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index 33dfde30..9605a163 100644 --- a/parse.c +++ b/parse.c @@ -68,7 +68,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { exit (2); } - strbuf_copy(cline.vals.cur->value, &ctx.str); + DEEP_COPY(strbuf)(cline.vals.cur->value, &ctx.str); strbuf_cap(cline.vals.cur->value); strbuf_soft_reset(&ctx.str); @@ -85,7 +85,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { * Border between param {key, value} */ } else if (p_ctx == p_param_name && c == '=') { - strbuf_copy(&kv.key, &ctx.str); + DEEP_COPY(strbuf)(&kv.key, &ctx.str); strbuf_cap(&kv.key); strbuf_soft_reset(&ctx.str); @@ -103,7 +103,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { if (p_ctx == p_key) dest = &cline.key; else if (p_ctx == p_param_value) dest = &kv.val; - strbuf_copy(dest, &ctx.str); + DEEP_COPY(strbuf)(dest, &ctx.str); strbuf_cap(dest); strbuf_soft_reset(&ctx.str); @@ -132,7 +132,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) { * the end here. */ - strbuf_copy(cline.vals.cur->value, &ctx.str); + DEEP_COPY(strbuf)(cline.vals.cur->value, &ctx.str); strbuf_cap(cline.vals.cur->value); handle_kv(&cline, &ctx); @@ -163,7 +163,7 @@ int handle_kv ( */ NEW(strbuf, s); - strbuf_copy(s, cline->vals.cur->value); + DEEP_COPY(strbuf)(s, cline->vals.cur->value); PUSH(LLIST(strbuf))(&ctx->key_stack, s); NEW(vcomponent, e, -- cgit v1.2.3