summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYogeesh MB <yogeeshappa.mathighatta@wipro.com>2002-05-13 12:27:33 +0000
committerAnders Carlsson <andersca@src.gnome.org>2002-05-13 12:27:33 +0000
commit2608c18f99bea3e1d039cf1dee046e2b04f56a52 (patch)
treeecddd5557ea9653332f950d14a41942a3c007818
parentdd734b2c9b0ba01d9c36469b3e4b10b68d200470 (diff)
downloadyelp-2608c18f99bea3e1d039cf1dee046e2b04f56a52.tar.gz
fixes Bug#76331LIBGNOME_1_117_0
2002-05-13 Yogeesh MB <yogeeshappa.mathighatta@wipro.com> * libgnome/configure.in, libgnome/acconfig.h, libgnome/help_conveters/man/gnome-man2html.c: fixes Bug#76331
-rw-r--r--src/man2html/yelp-man2html.c39
1 files 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("<HTML><HEAD><TITLE>Document not found</TITLE>\n"
+ "</HEAD><BODY>"
+ "I don't know how to find the document \"%s\" "
+ "on your system.\n"
+ "</BODY></HTML>\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("<HTML><HEAD><TITLE>Document not found</TITLE>\n"
+ "</HEAD><BODY>"
+ "I don't know how to find the document \"%s\" "
+ "on your system.\n"
+ "</BODY></HTML>\n", infile);
+
+ return 4;
+ }
+#endif
fh = popen(cmdline, "r");
fgets(output, sizeof(output), fh);
pclose(fh);