чување cfbedcdab0c203c38ad7d7c954a9740ac71d343b
родитељ 202dfcf0e49a02d13d50ee79b135ed4178d17885
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sat, 10 Jun 2023 22:22:09 +0200
Remove debug output and permalink output code in incdir
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
| M | slw2gmi.c | | | 54 | ++++++++++++------------------------------------------ |
измењених датотека: 1, додавања: 12(+), брисања: 42(-)
diff --git a/slw2gmi.c b/slw2gmi.c
@@ -1590,28 +1590,11 @@ process_incdir_subdir(FILE* output, const char* subdirname,
u8* date = get_value(vars, vars_count, (u8*)"date");
u8* title = get_value(vars, vars_count, (u8*)"title");
- fprintf(stderr, "DBG:title={%s},date={%s}\n",
- title ? (char*)title : "(NULL)",
- date ? (char*)date : "(NULL)");
- if (title && date)
- process_timestamp(output, link_prefix, link,
- NULL, date, title);
- state = saved_state;
-
- if (footer_permalink_text && incdir_only_summary)
- {
- char* link = strip_ext(filename);
-
- if (ext_in_permalink)
- strcat(link, timestamp_output_ext);
-
- print_output(output, "=> %s %s\n",
- permalink_url ? permalink_url : link,
- footer_permalink_text);
+ process_timestamp(output, link_prefix, link,
+ NULL, date, title);
- free(link);
- }
+ state = saved_state;
fflush(output);
slweb_cleanup();
@@ -1764,8 +1747,6 @@ process_timestamp(FILE* output, const u8* link_prefix, const char* link,
day = (u8*)strtok_r(NULL, "T", (char**)&ptr);
if (!day)
goto process_timestamp_cleanup;
- fprintf(stderr, "DBG:process_timestamp(%s): ymd passed\n",
- title ? (char*)title : "(NULL)");
ptimestamp_format = timestamp_format;
while (*ptimestamp_format)
{
@@ -1781,29 +1762,18 @@ process_timestamp(FILE* output, const u8* link_prefix, const char* link,
ptimestamp_format++;
}
- if (title)
- print_output(output, "=> %s%s%s.gmi\t%s %s\n",
- url_is_local(link) && global_link_prefix
- ? (const char*)global_link_prefix
- : "",
- url_is_local(link) && link_prefix
- ? (const char*)link_prefix
- : "",
- link, formatted_date, title);
- else
- print_output(output, "=> %s%s%s.gmi\t%s\n",
- url_is_local(link) && global_link_prefix
- ? (const char*)global_link_prefix
- : "",
- url_is_local(link) && link_prefix
- ? (const char*)link_prefix
- : "",
- link, formatted_date);
+ print_output(output, "=> %s%s%s%s\t%s %s\n",
+ url_is_local(link) && global_link_prefix
+ ? (const char*)global_link_prefix
+ : "",
+ url_is_local(link) && link_prefix
+ ? (const char*)link_prefix
+ : "",
+ link, timestamp_output_ext,
+ formatted_date, title ? (const char*)title : "");
output_firstcol = 1;
process_timestamp_cleanup:
- fprintf(stderr, "DBG:process_timestamp(%s): cleanup\n",
- title ? (char*)title : "(NULL)");
free(formatted_date);
free(in_line);
free(in_filename);