From 5c0214c73798a11ba96d24efe804423740478842 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 24 Jan 2018 11:39:27 +1000 Subject: [PATCH] disable genurls if www_server is not enabled --- src/files.c | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/files.c b/src/files.c index 9babbd1..d62b7fb 100644 --- a/src/files.c +++ b/src/files.c @@ -803,31 +803,37 @@ void genurls() { #if defined(ENABLE_WWW) int i; char *url; - for (i=0;idir, tagged_files[i]->sub, tagged_files[i]->fid); + url = www_create_link(tagged_files[i]->dir, tagged_files[i]->sub, tagged_files[i]->fid); - if (url != NULL) { - s_printf(get_string(255), basename(tagged_files[i]->filename)); - s_printf(get_string(256), url); - free(url); - } else { - s_printf(get_string(257)); + if (url != NULL) { + s_printf(get_string(255), basename(tagged_files[i]->filename)); + s_printf(get_string(256), url); + free(url); + } else { + s_printf(get_string(257)); + } } + for (i=0;ifilename); + free(tagged_files[i]); + } + free(tagged_files); + tagged_count = 0; + s_printf(get_string(6)); + s_getc(); + } else { + s_printf(get_string(258)); + s_printf(get_string(6)); + s_getc(); } - for (i=0;ifilename); - free(tagged_files[i]); - } - free(tagged_files); - tagged_count = 0; - s_printf(get_string(6)); - s_getc(); #else s_printf(get_string(258)); s_printf(get_string(6));