delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/15/07:26:18

Date: Wed, 15 Oct 1997 13:26:00 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Allegro 2.2
In-Reply-To: <61uljn$fcp$1@news.ox.ac.uk>
Message-ID: <Pine.SUN.3.91.971015132414.17868N-100000@is>
MIME-Version: 1.0

On 14 Oct 1997, George Foot wrote:

> : Both styles of slashes should work the same.  The code which loads
> : DJGPP.ENV at program startup converts the backslashes into forward
> : slashes (unless DJGPP.ENV was incorrectly edited).
> 
> <pedantic>
> I hesitate to disbelieve you, Eli

Don't hesitate.  I haven't promised not to make errors, even stupid
ones, nor will I ever promise that.  I also have been caught actually 
doing it.

> but surely that (in parentheses) 
> cannot be true since at this stage the program hasn't yet opened
> DJGPP.ENV?

It's not the value of the DJGPP environment variable itself that is
converted.  That variable is only used to open DJGPP.ENV, and any
style of slashes, even mixed, is good for that, as always in DJGPP.
(Actually, it's DOS that can grok both styles alike.)

However, when the startup code reads DJGPP.ENV, the first meaningful
line it sees is this:

	DJDIR=%:/>DJGPP%

The forward slash on this line means ``convert all backslashes to
forward slashes'' (see "info know hidden djgpp" for more details).  If
somebody hacks this line so as to disable this conversion, the DJDIR
environment variable passed to the program will be with backslashes
(if the original DJGPP variable had backslashes).  Other sections on
DJGPP.ENV use DJDIR's value to set environment variables for many
DJGPP programs, and some of those programs might not like
backslashes.  (One of such programs is Info.)

So if you have the combination of (a) hacked DJGPP.ENV and (b) a
program that doesn't like backslashes in some of its environment
variables--then and only then do slashes in DJGPP variable matter.

> Or do you mean that with suitable modification of DJGPP.ENV the
> linker, when creating the user program, will disable the conversion, so
> then the user program would not perform it? 

DJGPP doesn't have any such elaborate scheme.  The linker cannot do
anything to enable or disable parts of the startup code; in fact, no
information from DJGPP.ENV at link time should be recorded in the
binary.

- Raw text -


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