www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/01/00:57:21

Message-Id: <199711010554.SAA29051@atlantis.actrix.gen.nz>
Subject: Re: Some comments and questions
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Sat, 1 Nov 1997 18:54:50 +1300 (NZDT)
From: "Kris Heidenstrom" <kheidens AT actrix DOT gen DOT nz>
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.971027111156.19645C-100000@is> from "Eli Zaretskii" at Oct 27, 97 11:14:35 am
MIME-Version: 1.0

Eli Zaretskii wrote:

>>>   DJGPP=C:/S/DJGPP/DJGPP.ENV
>> 
>> It behaves the same either way.

[...]

> It must be something in your configuration.  
> 
> Hmm... I wonder: if you can make it work after unsetting DJGPP, then how 
> does it find its files?  Is INFOPATH defined in the environment, besides 
> the DJGPP.ENV file?  If not, can you figure out how does Info find its 
> files on your system?  Maybe this will unlock the problem.

No, it doesn't "work" if I unset DJGPP; it just doesn't hang for 15
seconds.  It immediately reports ENOENT and terminates.

But, info seems to do some weird things.  Here is what I have tried:

First, if there is a program 'man', there is no problem.  When I enter
'info no_such_subject', info starts up immediately and displays 'no
manual entry for no_such_subject' (this message comes from man and is
displayed in the main window).

If there is no 'man' program, then I get the symptoms that I described
earlier - the message 'Bad command or file name' is displayed, then the
machine appears to hang (but can be broken with Ctrl-C) for 15 seconds
(this is on a Pentium 75), then starts up with a beep, with the message
'there is no menu item no_such_subject in this node'.

So the question is, why was it hanging for 15 seconds.

I thought maybe it was a TSR problem, so I tried booting from a floppy
(in this case, DR-DOS 6.0), then setting PATH and DJGPP, so that the
DOS environment variables were:

	PROMPT=$P$G
	COMSPEC=A:\COMMAND.COM
	DJGPP=C:\S\DJGPP\DJGPP.ENV
	PATH=C:\S\DJGPP\BIN

I tried 'info no_such_subject' - the message 'Bad command or file name'
was displayed, but there was almost no delay before info started up.
So it seemed to work alright under DR-DOS 6.0 booted from floppy disk.

So I tried renaming my CONFIG.SYS and AUTOEXEC.BAT files and booting
from the hard disk, then manually setting the environment variables as
listed above.  The delay came back.

Just for a laugh, I tried booting MS-DOS 6.2 from the original floppies
and setting the environment variables.	The delay was still there.

So from this I deduced that there is some difference between DR-DOS 6.0
and MS-DOS 6.2 that is causing this behaviour.

Because the delay occurred after the 'Bad command or file name' message,
which is issued by COMMAND.COM, I investigated the command that was being
passed to COMMAND.COM.	To do this, I changed my COMSPEC environment
variable so that it pointed to a small program which dumps its program
segment prefix (including the command tail) and exits.	This showed me
that the command interpreter was being called up with a command line of:

	c:/s/djgpp/tmp/dj300000

Its output was redirected to a file, or piped, so that info displays
the output of the command.  The parameter turned out to be a temporary
file which was created by info, which contained the text

	man no_such_subject

There are three problems here.	First, COMMAND.COM usually treats
forward-slashes as options, and isn't guaranteed to accept them in
pathnames, especially if the switchar is '/' (as it is by default).

Second, COMMAND.COM is not supposed to be used like this - it doesn't
accept 'scripts' unless they are batch files, in which case I believe
they must have a .BAT extension.  In that case it should include a
leading '@' in the batch file, otherwise COMMAND.COM will echo the
'man no_such_subject' line to the output.

Third, invoking COMMAND.COM from the command line and passing it a
filename like this (even if the filename contains a valid command)
causes it to report

	Specified COMMAND search directory bad
	Bad command or file name

This is because, to invoke a command via COMMAND.COM, you need to use
the /c parameter, for example

	command /cman no_such_subject

Simply invoking the command interpreter and passing it the filename
of a 'batch' file is not meant to work (at least, AFAIK).

Info appears to create the temporary file and invoke the command
interpreter with this inappropriate option, only if it doesn't
find the 'man' command itself.  If 'man' is present in djgpp/bin,
info invokes man directly (changing COMSPEC to my dumper program
doesn't have any effect).

I've grepped the info source code for system( and spawn*( but found
nothing.  Perhaps you can tell me where to look.

If not, don't worry - it's not a serious problem.

Regards

Kris
-- 
Kris Heidenstrom   kheidens AT actrix DOT gen DOT nz   Wellington, New Zealand
               Electronic designer and programmer
       "Good sense is the most valuable good on the market"

- Raw text -


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