summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacob berkman <jacob@ximian.com>2002-05-21 23:32:48 +0000
committerJacob Berkman <jberkman@src.gnome.org>2002-05-21 23:32:48 +0000
commitb5ee5f856c41b35a7e31fcd37b703aab858a3384 (patch)
tree2b5fd6b7facfac6f2a061d935e164374b79d7cc1
parent11b020e29c647d1c881bd1c3e06e6468f8a43dfc (diff)
downloadyelp-b5ee5f856c41b35a7e31fcd37b703aab858a3384.tar.gz
modified patch from Jim Bowen <jim_bowen@alum.mit.edu> to work with
2002-05-21 jacob berkman <jacob@ximian.com> * help-converters/man/gnome-man2html.c (main): modified patch from Jim Bowen <jim_bowen@alum.mit.edu> to work with caching man fixes bug #81129
-rw-r--r--src/man2html/yelp-man2html.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/man2html/yelp-man2html.c b/src/man2html/yelp-man2html.c
index f73ab891..7bbf5379 100644
--- a/src/man2html/yelp-man2html.c
+++ b/src/man2html/yelp-man2html.c
@@ -3671,7 +3671,7 @@ int
main(int argc, char **argv)
{
char *t=NULL;
- int i;
+ int i,len;
char *buf;
char *h = '\0';
STRDEF *stdf;
@@ -3763,10 +3763,35 @@ main(int argc, char **argv)
fh = popen(cmdline, "r");
fgets(output, sizeof(output), fh);
pclose(fh);
-
+
+ /*
+ * If man page has been cached 'man -w cmdname' will
+ * return both the location of the manpage and the
+ * location of the cached cat version separated by one
+ * or more spaces. Need to trim second entry and/or
+ * any trailing spaces after first entry.
+ *
+ * However man pages can theoretically have spaces in
+ * them. we would use man -W, but that seems to not
+ * be portable.
+ *
+ * So, look for ' /' which is probably going to work
+ * right.
+ */
+
+ len = strlen(output);
+ for(i = 0; i < len; i++)
+ {
+ if (isspace((unsigned char)output[i] && output[i+1] == '/'))
+ output[i] = '\0';
+ }
+
+ /*
i = strlen(output) - 1;
while(isspace((unsigned char)output[i])) output[i--] = '\0';
-
+ */
+
+
if (output[0]) {
#ifdef HAVE_LIBBZ2
if(strstr(output,".bz2"))