diff --git a/meson.build b/meson.build index 593b686..ae81e5e 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,8 @@ project('rcms', 'c', version : '0.1', default_options : ['warning_level=3']) +add_project_arguments('-Wfatal-errors', language : 'c') + exe = executable('rcms', 'src/main.c', 'src/rcms.c', diff --git a/src/rcms.c b/src/rcms.c index b361052..0d81f6e 100644 --- a/src/rcms.c +++ b/src/rcms.c @@ -193,7 +193,7 @@ void output_blogfile_rss(Rss*rss,char*fn) } // Read blog file, store in Rss fields - for(int i=0;i<4;++i) + for(int i=0;i<3;++i) { uint32_t sl=0; @@ -203,6 +203,17 @@ void output_blogfile_rss(Rss*rss,char*fn) rss->strings[i][sl-1]=0; } + fgets(rss->strings[3],1024,f); + while(strlen(rss->strings[3])<1024) + { + char ch[8]={fgetc(f),0}; + + if(*ch=='\n') + strcat(rss->strings[3],"
"); + else + strcat(rss->strings[3],ch); + } + fclose(f); printf("

%s

",rss->strings[0]); diff --git a/test/blog/welcome.txt b/test/blog/welcome.txt index 1084516..22bcc12 100644 --- a/test/blog/welcome.txt +++ b/test/blog/welcome.txt @@ -2,3 +2,5 @@ Welcome to my website! https://example.com/welcome.txt https://example.com/welcome.txt This is a test of my content management system, rcms. I hope that this will be rendered correctly and we will get a good blog/news entry as well as an RSS entry. We shall see. +This is line 2 of the blog. +This is line 3 of the blog.