From 2608c18f99bea3e1d039cf1dee046e2b04f56a52 Mon Sep 17 00:00:00 2001 From: Yogeesh MB Date: Mon, 13 May 2002 12:27:33 +0000 Subject: fixes Bug#76331 2002-05-13 Yogeesh MB * libgnome/configure.in, libgnome/acconfig.h, libgnome/help_conveters/man/gnome-man2html.c: fixes Bug#76331 --- src/man2html/yelp-man2html.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/src/man2html/yelp-man2html.c b/src/man2html/yelp-man2html.c index 41531d4e..f73ab891 100644 --- a/src/man2html/yelp-man2html.c +++ b/src/man2html/yelp-man2html.c @@ -3677,6 +3677,16 @@ main(int argc, char **argv) STRDEF *stdf; char *infile = NULL; +#if defined HAVE_MAN_WHEREIS +#define MAN_CAN_FIND_SOURCE + const char *man_source_locator = "man -w %s"; + const char *man_source_locator_with_section = "man -w %c %s"; +#elif defined HAVE_MAN_DEBUG +#define MAN_CAN_FIND_SOURCE + const char *man_source_locator = "man -d %s | sed -n 's,^[ \t]*unformatted[ \t]*=[ \t]*,,p'"; + const char *man_source_locator_with_section = "man -d -s %c %s | sed -n 's,^[ \t]*unformatted[ \t]*=[ \t]*,,p'"; +#endif + /* see if they gave us a basename for the URL references */ for(i = 1; i < argc; i++) @@ -3722,11 +3732,34 @@ main(int argc, char **argv) *ctmp = '\0'; - g_snprintf(cmdline, sizeof(cmdline), "man -w %c %s", section, infile); +#ifdef MAN_CAN_FIND_SOURCE + g_snprintf(cmdline, sizeof(cmdline), man_source_locator_with_section, section, infile); +#else + { + printf("Document not found\n" + "" + "I don't know how to find the document \"%s\" " + "on your system.\n" + "\n", infile); + + return 4; + } +#endif } else - g_snprintf(cmdline, sizeof(cmdline), "man -w %s", infile); - +#ifdef MAN_CAN_FIND_SOURCE + g_snprintf(cmdline, sizeof(cmdline), man_source_locator, infile); +#else + { + printf("Document not found\n" + "" + "I don't know how to find the document \"%s\" " + "on your system.\n" + "\n", infile); + + return 4; + } +#endif fh = popen(cmdline, "r"); fgets(output, sizeof(output), fh); pclose(fh); -- cgit v1.2.1