summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/ixhelp.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 21:26:53 +0200
commitdf247efec654e512242e4f4f1b0212034f9e01fe (patch)
tree25c02e16957f3aa613af30c140fd8e8a3d52fda6 /app/wlib/gtklib/ixhelp.c
parentd0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff)
parenta5ade52caa489cf0a713e0f02b764000d203140e (diff)
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterHEADdebian/1%5.2.0Beta2.1-1master
Diffstat (limited to 'app/wlib/gtklib/ixhelp.c')
-rw-r--r--app/wlib/gtklib/ixhelp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/wlib/gtklib/ixhelp.c b/app/wlib/gtklib/ixhelp.c
index f1e3983..5079f61 100644
--- a/app/wlib/gtklib/ixhelp.c
+++ b/app/wlib/gtklib/ixhelp.c
@@ -404,6 +404,13 @@ void wHelp(const char * topic)
{
char *htmlFile;
+ //Take off any topic characters after a '-'
+
+ if (!topic || !topic[0]) return;
+
+
+ if (!CheckHelpTopicExists(topic)) return;
+
if (!wHelpWindow) {
directory = malloc(BUFSIZ);
assert(directory != NULL);
@@ -417,6 +424,7 @@ void wHelp(const char * topic)
/* need space for the 'html' extension plus dot plus \0 */
htmlFile = malloc(strlen(topic) + 6);
+
assert(htmlFile != NULL);
sprintf(htmlFile, "%s.html", topic);
@@ -424,4 +432,6 @@ void wHelp(const char * topic)
load_into_view(htmlFile, MAIN_VIEW);
gtk_widget_show_all(wHelpWindow);
gtk_window_present(GTK_WINDOW(wHelpWindow));
+
+ free(htmlFile);
}