diff --git a/config.def.h b/config.def.h index 8c53976..44a76fa 100644 --- a/config.def.h +++ b/config.def.h @@ -34,3 +34,6 @@ static const int logLevel = 3; // Set the maximum amount of redirects curl will follow. // Use 0 to disable redirects, and -1 for no limit. static const int maxRedirs = 10; + +// File extension used for each article. +static const char fileExt[] = ".html"; diff --git a/minrss.c b/minrss.c index 653111a..0ed0227 100644 --- a/minrss.c +++ b/minrss.c @@ -22,7 +22,9 @@ itemAction(itemStruct *item, const char *folder) if (fileName[0]) filePath = ecalloc( - strlen(folder) + strlen(fileName) + 2, + strlen(folder) + + strlen(fileName) + 2 + + strlen(fileExt), sizeof(char)); else { logMsg(1, "Invalid article title.\n"); @@ -42,6 +44,8 @@ itemAction(itemStruct *item, const char *folder) strcat(filePath, fileName); free(fileName); + strcat(filePath, fileExt); + FILE *itemFile = fopen(filePath, "a"); free(filePath); @@ -49,9 +53,9 @@ itemAction(itemStruct *item, const char *folder) if (!ftell(itemFile)) { newItems++; - fprintf(itemFile, "%s\n\n", cur->title); - fprintf(itemFile, "%s\n", san(cur->description, 0)); - fprintf(itemFile, "%s\n", san(cur->link, 0)); + fprintf(itemFile, "

%s


\n", cur->title); + fprintf(itemFile, "Link
\n", san(cur->link, 0)); + fprintf(itemFile, "%s", san(cur->description, 0)); } fclose(itemFile);