aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc/source-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2017-02-15 23:27:00 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2017-02-15 23:27:00 +0100
commit1d790b8c78a2925a788e7167ed8d9d52d8e23906 (patch)
tree23d71719ef39dcf0257cdaa2be51898a31749217 /src/blogc/source-parser.c
parentbc23293bb178b6abcafa0f67d432cbff6ac3c861 (diff)
downloadblogc-1d790b8c78a2925a788e7167ed8d9d52d8e23906.tar.gz
blogc-1d790b8c78a2925a788e7167ed8d9d52d8e23906.tar.bz2
blogc-1d790b8c78a2925a788e7167ed8d9d52d8e23906.zip
content-parser: source-parser: rename TITLE to FIRST_HEADER
Diffstat (limited to 'src/blogc/source-parser.c')
-rw-r--r--src/blogc/source-parser.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/blogc/source-parser.c b/src/blogc/source-parser.c
index f6f3471..eb0a975 100644
--- a/src/blogc/source-parser.c
+++ b/src/blogc/source-parser.c
@@ -150,19 +150,19 @@ blogc_source_parse(const char *src, size_t src_len, bc_error_t **err)
if (current == (src_len - 1)) {
tmp = bc_strndup(src + start, src_len - start);
bc_trie_insert(rv, "RAW_CONTENT", tmp);
- char *title = NULL;
+ char *first_header = NULL;
char *description = NULL;
- content = blogc_content_parse(tmp, &end_excerpt, &title,
- &description);
- if (title != NULL) {
- // do not override source-provided title.
- if (NULL == bc_trie_lookup(rv, "TITLE")) {
+ content = blogc_content_parse(tmp, &end_excerpt,
+ &first_header, &description);
+ if (first_header != NULL) {
+ // do not override source-provided first_header.
+ if (NULL == bc_trie_lookup(rv, "FIRST_HEADER")) {
// no need to free, because we are transfering memory
// ownership to the trie.
- bc_trie_insert(rv, "TITLE", title);
+ bc_trie_insert(rv, "FIRST_HEADER", first_header);
}
else {
- free(title);
+ free(first_header);
}
}
if (description != NULL) {