Mail Archives: djgpp/2002/01/05/04:36:07
> Date: Fri, 4 Jan 2002 14:05:58 -0500 (EST)
> From: wkennedy AT softintegration DOT com (Walter Kennedy)
>
> If I set MANPATH=C:/program files/fsf/man, the man.exe will fail
> to recognize the MANPATH.
Thank you for your report.
Actually, such values of MANPATH _are_ recognized, but when `man' runs
the Less program to display the man page, it doesn't quote the file
names, so files with embedded whitepace don't work.
Please try the patch below, which should fix that:
--- man.c~0 Sat Feb 19 12:57:44 2000
+++ man.c Sat Jan 5 11:23:30 2002
@@ -33,7 +33,7 @@
Ported to Borland C, 16 bit DOS, 10 feb 2000
by Erwin Waterlander, waterlan AT xs4all DOT nl or erwin DOT waterlander AT philips DOT com
- Last updated: February 19, 2000
+ Last updated: January 5, 2002
-----------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
@@ -83,7 +83,7 @@
# define MATCHFLAGS 0
#endif /* TURBOC */
-static const char *version = "1.3";
+static const char *version = "1.4";
/* Defaults: the pager, directories to look for man pages, groff, etc. */
#ifdef MSDOS
@@ -250,9 +250,10 @@ display_page (const char *file, const ch
if (formatter)
{
/* "groff -man -Tascii /usr/man/foo.1 | less -c" */
- sprintf (cmd, "%s %s%s%s", formatter, file,
- direct_output ? "" : " | ",
- direct_output ? "" : pager);
+ sprintf (cmd, "%s \"%s\"%s%s%s", formatter, file,
+ direct_output ? "" : " | \"",
+ direct_output ? "" : pager,
+ direct_output ? "" : "\"");
#ifdef MSDOS
/* A kludge to prevent the message below from showing when `man'
@@ -267,8 +268,8 @@ display_page (const char *file, const ch
Don't require `cat' unless we really need it. Pagers usually
disable all screen effects when stdout is not a terminal, so
their pager could serve as `cat' also. */
- sprintf (cmd, "%s %s", !direct_output || !isatty (fileno (stdout))
- ? pager : "cat", file);
+ sprintf (cmd, "\"%s\" \"%s\"", !direct_output || !isatty (fileno (stdout))
+ ? pager : "cat", file);
if (debugging_output)
fprintf (stderr, "Running `%s'\n", cmd);
- Raw text -