From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/wlib/gtklib/ixhelp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/wlib/gtklib/ixhelp.c') 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); } -- cgit v1.2.3