From 25e92d39e7c5f3c4bd6dc0aeeb9b5a6861c79995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 10 Feb 2019 01:05:32 +0100 Subject: Add push_strbuf function. --- parse.c | 26 ++++++++++++++++++++++++++ parse.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/parse.c b/parse.c index e10e8b23..18e45a04 100644 --- a/parse.c +++ b/parse.c @@ -215,3 +215,29 @@ INIT_F(parse_ctx, char* filename) { strcpy(this->filename, filename); return 0; } + +int push_strbuf(strbuf* target, strbuf* src) { +#if 0 + if (src->ptr + 1 > keylen) { + keylen = str->ptr + 1; + /* + * Allow for key's longer than 100 octets. It + * currently is of no use, since key's can't be + * folded. + * TODO check if everything should be unfolded at 75 + * octets, or if that is only for values. + * + * TODO earlier there was a bug here. Test if that is + * fixed and reenable this line. + */ + // strbuf_realloc(&cline.key, keylen); + } +#endif + + strbuf_copy(target, src); + strbuf_cap(target); + strbuf_soft_reset(src); + + // continue; + return 0; +} diff --git a/parse.h b/parse.h index c02c07c8..d46a5ad8 100644 --- a/parse.h +++ b/parse.h @@ -42,4 +42,6 @@ int handle_kv( int parse_file(char* filename, FILE* f, vcomponent* cal); +int push_strbuf(strbuf* target, strbuf* src); + #endif /* PARSE_H */ -- cgit v1.2.3