diff options
author | Arik Devens <arik@src.gnome.org> | 2001-02-24 16:03:40 +0000 |
---|---|---|
committer | Arik Devens <arik@src.gnome.org> | 2001-02-24 16:03:40 +0000 |
commit | 726ff2b6b30aac9aaab55548a986100d44e8947b (patch) | |
tree | 9def81f65a28fb63edf5e3e049a3f68a71512f37 | |
parent | 4ab88ac6ebc7e501971256c7e7000ec14f3f1b09 (diff) | |
download | yelp-726ff2b6b30aac9aaab55548a986100d44e8947b.tar.gz |
Added default text to be displayed when either a man or info page cannot be found on the system. Fixes bug 3112 and partially fixes bug 939. Will finish after sleep.NAUTILUS_0_8_2
-rw-r--r-- | src/info2html/main.c | 15 | ||||
-rw-r--r-- | src/man2html/yelp-man2html.c | 10 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/info2html/main.c b/src/info2html/main.c index 7f5a1d7a..ddbc2501 100644 --- a/src/info2html/main.c +++ b/src/info2html/main.c @@ -33,6 +33,9 @@ static int file_exists(const char *fn) { struct stat sbuf; + + fprintf (stderr, "%s", fn); + return (stat(fn, &sbuf) == 0); } @@ -92,11 +95,16 @@ main(int argc, char **argv) break; ext = ".gz"; sprintf(buf, "%s/%s.info.gz", dirs[i], args[0]); + if(file_exists(buf)) break; } - if(i >= ndirs) - return 2; + if(i >= ndirs) { + printf ("<HTML><HEAD><TITLE>Document not found</TITLE>\n" + "</HEAD><BODY>The document \"%s/%s.info\" couldn't be found. It may have been removed from your system.\n" + "</BODY></HTML>\n", dirs[0], args[0]); + return 2; + } n = i; @@ -106,6 +114,7 @@ main(int argc, char **argv) sprintf(buf, "%s/%s.info-%d%s", dirs[n], args[0], i, ext); else sprintf(buf, "%s/%s.info%s", dirs[n], args[0], ext); + if(!file_exists(buf)) { fixup_args[i] = NULL; @@ -116,7 +125,7 @@ main(int argc, char **argv) } args = (const char **)fixup_args; } - + if(requested_nodename) { char *s, *t; diff --git a/src/man2html/yelp-man2html.c b/src/man2html/yelp-man2html.c index ed811b78..665d7340 100644 --- a/src/man2html/yelp-man2html.c +++ b/src/man2html/yelp-man2html.c @@ -3711,10 +3711,16 @@ main(int argc, char **argv) if(output[0]) infh = gzopen(output, "r"); + } } - if(!infh) - return 3; + if(!infh) { + printf("<HTML><HEAD><TITLE>Document not found</TITLE>\n" + "</HEAD><BODY>The document \"%s\" couldn't be found. It may have been removed from your system.\n" + "</BODY></HTML>\n", infile); + + return 3; + } buf=read_man_page(); if (!buf) { |