delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/05/04:36:07

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Sat, 05 Jan 2002 11:29:43 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: wkennedy AT softintegration DOT com (Walter Kennedy)
Message-Id: <7680-Sat05Jan2002112943+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <20020104190558.D2882A74EB@mail.softintegration.com>
(wkennedy AT softintegration DOT com)
Subject: Re: a bug for man.exe in Windows
References: <20020104190558 DOT D2882A74EB AT mail DOT softintegration DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019