diff options
-rw-r--r-- | src/info2html/main.c | 4 | ||||
-rw-r--r-- | src/man2html/yelp-man2html.c | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/info2html/main.c b/src/info2html/main.c index c7841f23..877bd0e9 100644 --- a/src/info2html/main.c +++ b/src/info2html/main.c @@ -44,6 +44,10 @@ static struct poptOption options[] = { static int file_exists(const char *fn) { + if (g_file_test(fn, G_FILE_TEST_IS_DIR)) { + return FALSE; + } + struct stat sbuf; return (stat(fn, &sbuf) == 0); diff --git a/src/man2html/yelp-man2html.c b/src/man2html/yelp-man2html.c index c021fa78..1e2b6162 100644 --- a/src/man2html/yelp-man2html.c +++ b/src/man2html/yelp-man2html.c @@ -3762,6 +3762,16 @@ main(int argc, char **argv) infile = argv[i]; } + if (g_file_test(infile, G_FILE_TEST_IS_DIR)) { + printf("<HTML><HEAD><TITLE>Document not found</TITLE>\n" + "</HEAD><BODY>" + "I don't know how to open the document \"%s\" " + "on your system.\n" + "</BODY></HTML>\n", infile); + + return 4; + } + if(!infile || !strcmp(infile, "-")) infh = gzdopen(0, "r"); else |