@@ -13,6 +13,9 @@ | |||
cms_page* cms_page_create() | |||
{ | |||
cms_page* page = malloc(sizeof(cms_page)); | |||
page->_str = NULL; | |||
page->title = NULL; | |||
page->slug = NULL; | |||
page->numposts = 0; | |||
page->numsubs = 0; | |||
page->posts = NULL; |
@@ -10,6 +10,10 @@ | |||
cms_post* cms_post_create() | |||
{ | |||
cms_post* post = malloc(sizeof(cms_post)); | |||
post->_str = NULL; | |||
post->title = NULL; | |||
post->slug = NULL; | |||
post->html = NULL; | |||
return post; | |||
} | |||
@@ -110,7 +110,7 @@ cms_err* cms_util_dir_copy_recursive(char* dir1, char* dir2) | |||
if (st == NULL) | |||
return cms_err_create(CMS_ERR_ALLOC, NULL); | |||
while (ep = readdir(dp)) | |||
while ((ep = readdir(dp)) != NULL) | |||
{ | |||
if (ep->d_name[0] == '.') | |||
continue; |
@@ -11,12 +11,14 @@ | |||
//Temporary, for testing purposes | |||
static void print_page_tree(cms_page* page) | |||
{ | |||
printf("Page: %s\n", page->title); | |||
if (page->title) | |||
printf("Page: %s\n", page->title); | |||
//Loop over posts | |||
size_t i; | |||
for (i = 0; i < page->numposts; ++i) | |||
{ | |||
printf("printing post\n"); | |||
printf("\tPost: %s\n", (page->posts[i]).title); | |||
} | |||