aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-10 01:05:32 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-02-10 01:05:32 +0100
commit25e92d39e7c5f3c4bd6dc0aeeb9b5a6861c79995 (patch)
treeda3b4d6a2c7ea62a0de9bdebef9f935e47285e8c
parentMinor general cleanup. (diff)
downloadcalp-25e92d39e7c5f3c4bd6dc0aeeb9b5a6861c79995.tar.gz
calp-25e92d39e7c5f3c4bd6dc0aeeb9b5a6861c79995.tar.xz
Add push_strbuf function.
-rw-r--r--parse.c26
-rw-r--r--parse.h2
2 files changed, 28 insertions, 0 deletions
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 */