delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/07/10/09:36:57

X-Authentication-Warning: new-smtp2.ihug.com.au: Host p192-tnt4.syd.ihug.com.au [203.173.134.192] claimed to be acceleron
Message-ID: <000c01c10944$9ad2fff0$0a02a8c0@acceleron>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: <djgpp-workers AT delorie DOT com>
Subject: DJDIR Windows 2000 investigation results #1
Date: Tue, 10 Jul 2001 23:31:18 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Reply-To: djgpp-workers AT delorie DOT com

This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C10998.6BA307D0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

I checked out the code as Eli suggested and traced a quirk (I do not =
know enough about the LFN API to call it a bug) using Ralph Browns =
Interrupt List 6.1. I have attached the app that I used for the =
investigation (only the final version). Sorry for including such a large =
code snippet, but I thought that this would help, let me know what I =
should do in the future so as not to cause any problems.

The quirk I found was that if I remove the "| 0x1000" in the code as =
commented then the DJDIR environment variable is inserted into the app's =
environment on Windows 2000. It made no difference on the WIN 98SE box =
that I used to compile the app on if it was included or not.=20

What does the 0x1000 bit do? It is unused in Ralph's list as indicated =
in the following table (interrupt.h file):
Bitfields for Windows95 file access/sharing modes:
Bit(s)  Description     (Table 01782)
 2-0    file access mode
        000 read-only
        001 write-only
        010 read-write
        100 read-only, do not modify file's last-access time
 6-4    file sharing modes
 7      no-inherit flag
 8      do not buffer data (requires that all reads/writes be exact =
physical
          sectors)
 9      do not compress file even if volume normally compresses files
 10     use alias hint in DI as numeric tail for short-name alias
 12-11  unused??? (0)
 13     return error code instead of generating INT 24h if critical =
error
          while opening file
 14     commit file after every write operation


The output from Windows 2000 is=20
TEST 1: This app is i:/dj204/contrib/test/main.exe
djgpp_var  D:/DJGPP/DJGPP.ENV
main.c 46
main.c 90 D:/DJGPP/DJGPP.ENV
djgpp_env  5
112 116 122 177 210 210 210 241 putenv  DJDIR=3Dd:/djgpp
177 186 putenv  USER=3Ddosuser
177 186 putenv  GROUP=3Droot
177 186 241 putenv  TMPDIR=3Dd:/djgpp/tmp
177 186 241 putenv  EMU387=3Dd:/djgpp/bin/emu387.dxe
177 186 177 186 241 putenv  TEXMFMAIN=3Dd:/djgpp/share/texmf
177 186 241 putenv  GO32STUB=3Dd:/djgpp/bin/stubify.exe
TEST 2: This app is i:/dj204/contrib/test/main.exe
djgpp_var  D:/DJGPP/DJGPP.ENV
main.c 46
87 D:/DJGPP/DJGPP.ENV, error no (register AX) =3D 0x57djgpp_env  -1

Any ideas on what I should do next? Is it worth performing a test and =
remove all of the " | 0x1000" from the LFN functions and re-compile the =
DJGPP CVS 2.04 tarball and test again?

If you need to send me an email then remove then remove the .oz from the =
email address.

Thanks,
Andrew


-------------------------------------------------- CODE START =
-----------------
#include <stdlib.h>
#include <unistd.h>
#include <crt0.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stubinfo.h>
#include <dir.h>
#include <limits.h>
#include <dpmi.h>
#include <errno.h>
#include <libc/dosio.h>
#include <sys/fsext.h>
#include <go32.h>
#include <libc/stubs.h>
#include <string.h>
#include <fcntl.h>
#include <io.h>
#include <dos.h>


#define acprintf(A,B) printf("%s %d " A " \n", __FILE__,__LINE__,B)
#define acdebug printf("%s %d \n",__FILE__,__LINE__);
#define acdebugnl printf("%d ",__LINE__);

int ac_open (const char *filename, int oflag, int use_fat32)
{
  __dpmi_regs r;
  int rv;
  int use_lfn =3D _USE_LFN;

  if (filename =3D=3D 0)
    {
      acdebug errno =3D EINVAL;
      return -1;
    }

  if (__FSEXT_call_open_handlers (__FSEXT_open, &rv, &filename))
    {
      acdebug return rv;
    }

  if (use_lfn)
    {
      acdebug
      r.x.ax =3D 0x716c;
#if 1
      r.x.bx =3D (oflag & 0xff) | use_fat32; /* 0x1000 is FAT32 extended =
size. */
#else
ORIGINAL LINE --      r.x.bx =3D (oflag & 0xff) | 0x1000; /* 0x1000 is =
FAT32 extended size. */
      r.x.bx =3D (oflag & 0xff) ; /* 0x1000 is FAT32 extended size. */
#endif
      r.x.dx =3D 1;  /* Open existing file */
      r.x.si =3D __tb_offset;
    }
  else
    {
      acdebug
      if (7 <=3D _osmajor && _osmajor < 10)
 {
   acdebug
          r.x.ax =3D 0x6c00;
   r.x.bx =3D (oflag & 0xff) | 0x1000; /* 0x1000 is FAT32 extended size. =
*/
   /* FAT32 extended size flag doesn't help on WINDOZE 4.1 (98). It

      seems it has a bug which only lets you create these big files
      if LFN is enabled. */
   r.x.dx =3D 1;  /* Open existing file */
   r.x.si =3D __tb_offset;
 }
      else
 {
   acdebug
          r.h.ah =3D 0x3d;
   r.h.al =3D oflag;
   r.x.dx =3D __tb_offset;
 }
    }
  r.x.cx =3D 0;
  r.x.ds =3D __tb_segment;
  _put_path (filename);
  __dpmi_int (0x21, &r);
  if (r.x.flags & 1)
  {
      errno =3D __doserr_to_errno (r.x.ax);
      printf("%d %s, error no (register AX) =3D 0x%X",__LINE__, =
filename, r.x.ax);
      return -1;
  }
  acprintf("%s",filename);
  __file_handle_set (r.x.ax, O_BINARY);
  return r.x.ax;
}

void test_environment_file (char *app_name, int use_fat32)
{
  int djgpp_env;
  char *djgpp_var =3D getenv ("DJGPP");

  printf ("djgpp_var  %s \n", djgpp_var);
  if (djgpp_var)
    {
      djgpp_env =3D ac_open(djgpp_var, O_RDONLY, use_fat32);
      printf ("djgpp_env  %d \n", djgpp_env);

      if (djgpp_env >=3D 0)
 {
   char *file;
   char base[PATH_MAX], *bp, *a0p, *tb;
   int this_prog =3D 1;
   int fsize =3D lseek (djgpp_env, 0L, SEEK_END);
   acdebugnl
          file =3D (char *) malloc (fsize + 2);
   if (file =3D=3D 0)
     return;
   acdebugnl
          lseek (djgpp_env, 0L, 0);
   _read (djgpp_env, file, fsize);
   _close (djgpp_env);
   if (file[fsize - 1] =3D=3D '\n')
     {
       acdebugnl
              file[fsize] =3D 0;
     }
   else
     {
       acdebugnl
              file[fsize] =3D '\n';
       file[fsize + 1] =3D 0;
     }
   tb =3D file;

   base[0] =3D '[';
   bp =3D app_name;
   for (a0p =3D bp; *a0p; a0p++)
     if (strchr ("\\/:", *a0p))
       bp =3D a0p + 1;
   for (a0p =3D base + 1; *bp && *bp !=3D '.';)
     *a0p++ =3D tolower ((unsigned char) *bp++);
   *a0p++ =3D ']';
   *a0p++ =3D 0;

   bp =3D tb;
   while (1)
     {
       tb =3D bp;
       while (*tb && (*tb =3D=3D '\n' || *tb =3D=3D '\r'))
  tb++;
       bp =3D tb;
       while (*bp && *bp !=3D '\n' && *bp !=3D '\r')
  bp++;
       if (*bp =3D=3D 0)
  break;
       *bp++ =3D 0;
       if (tb[0] =3D=3D 0 || tb[0] =3D=3D '#')
         continue;
       if (tb[0] =3D=3D '[')
  {
    char *p =3D bp - 2;

    /* Some losers leave trailing blanks after "[foo]".  */
    while (p > tb && (*p =3D=3D ' ' || *p =3D=3D '\t'))
      p--;
    *++p =3D 0;
    if (strcmp (tb, base) =3D=3D 0)
      this_prog =3D 1;
    else
      this_prog =3D 0;
  }
       else
  {
    if (this_prog)
      {
        char *buf =3D alloca (fsize);
        char *tb2 =3D buf;
        char *sp =3D tb, *dp =3D tb2;
        acdebugnl while (*sp !=3D '=3D' && *sp !=3D '\n' && *sp)
   *dp++ =3D *sp++;
        if (*sp =3D=3D '\n' || *sp =3D=3D '\0')
   {
     tb =3D sp;
     continue;
   }
        if (*tb2 =3D=3D '+') /* non-overriding */
   {
     acdebugnl * dp =3D 0;
     tb2++;
     if (getenv (tb2))
       continue; /* while scanning bytes */
   }
        *dp++ =3D *sp++; /* copy the '=3D' */
        while (*sp)
   {
     if (*sp =3D=3D '%')
       {
         char *pp;
         if (sp[1] =3D=3D '%')
    {
      *dp++ =3D '%';
      sp +=3D 2;
    }
         else
    {
      char ps, *e, *dirend;
      int dirpart =3D 0, apsemi =3D 0;
      int mapup =3D 0, maplow =3D 0, mapfs =3D
        0, mapbs =3D 0;
      while (strchr (":;/\\<>", sp[1]))
        {
          acdebugnl
                                      switch (sp[1])
     {
     case ':':
       dirpart =3D 1;
       break;
     case ';':
       apsemi =3D 1;
       break;
     case '/':
       mapfs =3D 1;
       break;
     case '\\':
       mapbs =3D 1;
       break;
     case '<':
       mapup =3D 1;
       break;
     case '>':
       maplow =3D 1;
       break;
     }
          sp++;
        }
      for (pp =3D sp + 1; *pp && *pp !=3D '%'; pp++);
      ps =3D *pp;
      *pp =3D 0;
      e =3D getenv (sp + 1);
      dirend =3D dp;
      if (e)
        {
          acdebugnl
                                      while (*e)
     {
       char ec =3D *e++;
       if (strchr ("\\/:", ec))
         dirend =3D dp;
       if (mapup)
         ec =3D toupper ((unsigned char) ec);
       if (maplow)
         ec =3D tolower ((unsigned char) ec);
       if (mapfs && ec =3D=3D '\\')
         ec =3D '/';
       if (mapbs && ec =3D=3D '/')
         ec =3D '\\';
       *dp++ =3D ec;
     }
        }
      if (dirpart)
        dp =3D dirend;
      if (apsemi && e)
        *dp++ =3D ';';
      if (ps =3D=3D 0)
        break;
      sp =3D pp + 1;
    }
       }
     else
       *dp++ =3D *sp++;
   }
        *dp++ =3D 0;
        printf ("putenv  %s \n", tb2);
        putenv (tb2);
      }
  }
     }
   free (file);
 }
    }
}

int main (int argc , char * argv[] )
{
  printf("TEST 1: This app is %s\n", argv[0]);
  test_environment_file(argv[0], 0x0000);
  printf("TEST 2: This app is %s\n", argv[0]);
  test_environment_file(argv[0], 0x1000);
  return 0;
}
-------------------------------------------------- CODE END =
-----------------



On Mon, 9 Jul 2001, Andrew Cottrell wrote:

> 1) On the WIN98 PC the DOS set command does not show an environment
> variable called DJDIR, but it shows up when I display all of the
> environment variables as indicated in the sample app

This is expected behavior: DJDIR is computed and set by the startup code =

of each DJGPP program.  That's why you only see it inside a program, and =

in any shells spawned by a program, but not outside.

> 2) On the WIN 2000 PC the DOS set command does not show an environment
> variable called DJDIR and neither does the sample app show it in the
> environment array.

That is the reason for the problem with RHIDE.

> Any ideas on what I should do next or where to look?

You should look at the startup code, specifically at the code in the =
file=20
src/libc/crt0/c1loadef.c.  This is the code which reads the djgpp.env=20
file and sets DJDIR when it reads this line from djgpp.env:

   DJDIR=3D%:/>DJGPP%

Something is wrong there when the program runs on Windows 2000.  (If you =

need to understand the cryptic syntax of djgpp.env, read the section=20
"DJGPP.ENV" in the Info file kb.info.)

Thanks for working on this.

Btw, you might wish to redirect this discussion to the
djgpp-workers AT delorie DOT com mailing list, where all the DJGPP developers
are subscribed.

------=_NextPart_000_0009_01C10998.6BA307D0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I checked out the code as Eli suggested =
and traced=20
a quirk (I do not know enough about the LFN API to call it a bug) using =
Ralph=20
Browns Interrupt List 6.1. I have attached the app that I used for the=20
investigation (only the final version). Sorry for including such a large =
code=20
snippet, but I thought that this would help, let me know what I should =
do in the=20
future so as not to cause any problems.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The quirk I found was that if I remove =
the "|=20
0x1000" in the code as commented&nbsp;then the DJDIR environment =
variable is=20
inserted into the app's environment on Windows 2000. It made no =
difference on=20
the WIN 98SE box that I used to compile the app on if it was included or =
not.=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What does the 0x1000 bit do? It is =
unused in=20
Ralph's list as indicated in the following table (interrupt.h=20
file):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Bitfields for Windows95 file =
access/sharing=20
modes:<BR>Bit(s)&nbsp; Description&nbsp;&nbsp;&nbsp;&nbsp; (Table=20
01782)<BR>&nbsp;2-0&nbsp;&nbsp;&nbsp; file access=20
mode<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 000=20
read-only<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 001=20
write-only<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 010=20
read-write<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100 read-only, =
do not=20
modify file's last-access time<BR>&nbsp;6-4&nbsp;&nbsp;&nbsp; file =
sharing=20
modes<BR>&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; no-inherit=20
flag<BR>&nbsp;8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do not buffer data =
(requires that=20
all reads/writes be exact=20
physical<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
sectors)<BR>&nbsp;9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do not compress file =
even if=20
volume normally compresses files<BR>&nbsp;10&nbsp;&nbsp;&nbsp;&nbsp; use =
alias=20
hint in DI as numeric tail for short-name alias<BR>&nbsp;12-11&nbsp; =
unused???=20
(0)<BR>&nbsp;13&nbsp;&nbsp;&nbsp;&nbsp; return error code instead of =
generating=20
INT 24h if critical=20
error<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while =
opening=20
file<BR>&nbsp;14&nbsp;&nbsp;&nbsp;&nbsp; commit file after every write=20
operation</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The output from Windows 2000 is =
</DIV></FONT>
<DIV><FONT face=3DArial size=3D2>TEST 1: This app is=20
i:/dj204/contrib/test/main.exe<BR>djgpp_var&nbsp; =
D:/DJGPP/DJGPP.ENV<BR>main.c=20
46<BR>main.c 90 D:/DJGPP/DJGPP.ENV<BR>djgpp_env&nbsp; 5<BR>112 116 122 =
177 210=20
210 210 241 putenv&nbsp; DJDIR=3Dd:/djgpp<BR>177 186 putenv&nbsp;=20
USER=3Ddosuser<BR>177 186 putenv&nbsp; GROUP=3Droot<BR>177 186 241 =
putenv&nbsp;=20
TMPDIR=3Dd:/djgpp/tmp<BR>177 186 241 putenv&nbsp;=20
EMU387=3Dd:/djgpp/bin/emu387.dxe<BR>177 186 177 186 241 putenv&nbsp;=20
TEXMFMAIN=3Dd:/djgpp/share/texmf<BR>177 186 241 putenv&nbsp;=20
GO32STUB=3Dd:/djgpp/bin/stubify.exe<BR>TEST 2: This app is=20
i:/dj204/contrib/test/main.exe<BR>djgpp_var&nbsp; =
D:/DJGPP/DJGPP.ENV<BR>main.c=20
46<BR>87 D:/DJGPP/DJGPP.ENV, error no (register AX) =3D =
0x57djgpp_env&nbsp;=20
-1<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Any ideas on what I should do next? =
</FONT><FONT=20
face=3DArial size=3D2>Is it worth performing a test and remove all of =
the " |=20
0x1000" from the LFN functions and re-compile the DJGPP CVS 2.04 tarball =
and=20
test again?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If you need to send me an email then =
remove then=20
remove the .oz from the email address.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Andrew</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV>-------------------------------------------------- CODE START=20
-----------------</DIV></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>#include &lt;stdlib.h&gt;<BR>#include=20
&lt;unistd.h&gt;<BR>#include &lt;crt0.h&gt;<BR>#include=20
&lt;sys/stat.h&gt;<BR>#include &lt;stdio.h&gt;<BR>#include=20
&lt;stubinfo.h&gt;<BR>#include &lt;dir.h&gt;<BR>#include=20
&lt;limits.h&gt;<BR>#include &lt;dpmi.h&gt;<BR>#include=20
&lt;errno.h&gt;<BR>#include &lt;libc/dosio.h&gt;<BR>#include=20
&lt;sys/fsext.h&gt;<BR>#include &lt;go32.h&gt;<BR>#include=20
&lt;libc/stubs.h&gt;<BR>#include &lt;string.h&gt;<BR>#include=20
&lt;fcntl.h&gt;<BR>#include &lt;io.h&gt;<BR>#include =
&lt;dos.h&gt;</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV><BR>#define acprintf(A,B) printf("%s %d " A " \n",=20
__FILE__,__LINE__,B)<BR>#define acdebug printf("%s %d=20
\n",__FILE__,__LINE__);<BR>#define acdebugnl printf("%d =
",__LINE__);</DIV>
<DIV>&nbsp;</DIV>
<DIV>int ac_open (const char *filename, int oflag, int =
use_fat32)<BR>{<BR>&nbsp;=20
__dpmi_regs r;<BR>&nbsp; int rv;<BR>&nbsp; int use_lfn =3D =
_USE_LFN;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; if (filename =3D=3D 0)<BR>&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acdebug errno =3D=20
EINVAL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return =
-1;<BR>&nbsp;&nbsp;&nbsp;=20
}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; if (__FSEXT_call_open_handlers (__FSEXT_open, &amp;rv,=20
&amp;filename))<BR>&nbsp;&nbsp;&nbsp; =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
acdebug return rv;<BR>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; if (use_lfn)<BR>&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
acdebug<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
r.x.ax =3D 0x716c;<BR>#if 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r.x.bx =3D =
(oflag=20
&amp; 0xff) | use_fat32;&nbsp;/* 0x1000 is FAT32 extended size.=20
*/<BR>#else<BR>ORIGINAL LINE --&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r.x.bx =3D =
(oflag=20
&amp; 0xff) | 0x1000;&nbsp;/* 0x1000 is FAT32 extended size.=20
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r.x.bx =3D (oflag &amp; 0xff) =
;&nbsp;/*=20
0x1000 is FAT32 extended size. =
*/<BR>#endif<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
r.x.dx =3D 1;&nbsp;&nbsp;/* Open existing file=20
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r.x.si =3D =
__tb_offset;<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp; else<BR>&nbsp;&nbsp;&nbsp; =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
acdebug<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (7 &lt;=3D _osmajor =
&amp;&amp;=20
_osmajor &lt; 10)<BR>&nbsp;{<BR>&nbsp;&nbsp;=20
acdebug<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r.x.ax =
=3D=20
0x6c00;<BR>&nbsp;&nbsp; r.x.bx =3D (oflag &amp; 0xff) | 0x1000;&nbsp;/* =
0x1000 is=20
FAT32 extended size. */<BR>&nbsp;&nbsp; /* FAT32 extended size flag =
doesn't help=20
on WINDOZE 4.1 (98). It</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seems it has a bug which only lets =
you=20
create these big files<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if LFN is =
enabled.=20
*/<BR>&nbsp;&nbsp; r.x.dx =3D 1;&nbsp;&nbsp;/* Open existing file=20
*/<BR>&nbsp;&nbsp; r.x.si =3D=20
__tb_offset;<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
else<BR>&nbsp;{<BR>&nbsp;&nbsp;=20
acdebug<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r.h.ah =
=3D=20
0x3d;<BR>&nbsp;&nbsp; r.h.al =3D oflag;<BR>&nbsp;&nbsp; r.x.dx =3D=20
__tb_offset;<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; r.x.cx =3D =
0;<BR>&nbsp;=20
r.x.ds =3D __tb_segment;<BR>&nbsp; _put_path (filename);<BR>&nbsp; =
__dpmi_int=20
(0x21, &amp;r);<BR>&nbsp; if (r.x.flags &amp; 1)<BR>&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; errno =3D __doserr_to_errno=20
(r.x.ax);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("%d %s, error no =
(register=20
AX) =3D 0x%X",__LINE__, filename, =
r.x.ax);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
return -1;<BR>&nbsp; }<BR>&nbsp; acprintf("%s",filename);<BR>&nbsp;=20
__file_handle_set (r.x.ax, O_BINARY);<BR>&nbsp; return =
r.x.ax;<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>void test_environment_file (char *app_name, int =
use_fat32)<BR>{<BR>&nbsp;=20
int djgpp_env;<BR>&nbsp; char *djgpp_var =3D getenv ("DJGPP");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; printf ("djgpp_var&nbsp; %s \n", djgpp_var);<BR>&nbsp; if=20
(djgpp_var)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
djgpp_env=20
=3D ac_open(djgpp_var, O_RDONLY, =
use_fat32);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
printf ("djgpp_env&nbsp; %d \n", djgpp_env);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (djgpp_env &gt;=3D=20
0)<BR>&nbsp;{<BR>&nbsp;&nbsp; char *file;<BR>&nbsp;&nbsp; char =
base[PATH_MAX],=20
*bp, *a0p, *tb;<BR>&nbsp;&nbsp; int this_prog =3D 1;<BR>&nbsp;&nbsp; int =
fsize =3D=20
lseek (djgpp_env, 0L, SEEK_END);<BR>&nbsp;&nbsp;=20
acdebugnl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file =
=3D (char=20
*) malloc (fsize + 2);<BR>&nbsp;&nbsp; if (file =3D=3D=20
0)<BR>&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;&nbsp;=20
acdebugnl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
lseek=20
(djgpp_env, 0L, 0);<BR>&nbsp;&nbsp; _read (djgpp_env, file,=20
fsize);<BR>&nbsp;&nbsp; _close (djgpp_env);<BR>&nbsp;&nbsp; if =
(file[fsize - 1]=20
=3D=3D '\n')<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
acdebugnl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;=20
file[fsize] =3D 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
acdebugnl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;=20
file[fsize] =3D '\n';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file[fsize =
+ 1] =3D=20
0;<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; tb =3D file;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; base[0] =3D '[';<BR>&nbsp;&nbsp; bp =3D =
app_name;<BR>&nbsp;&nbsp;=20
for (a0p =3D bp; *a0p; a0p++)<BR>&nbsp;&nbsp;&nbsp;&nbsp; if (strchr=20
("<A>\\/</A>:", *a0p))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bp =3D =
a0p +=20
1;<BR>&nbsp;&nbsp; for (a0p =3D base + 1; *bp &amp;&amp; *bp !=3D=20
'.';)<BR>&nbsp;&nbsp;&nbsp;&nbsp; *a0p++ =3D tolower ((unsigned char)=20
*bp++);<BR>&nbsp;&nbsp; *a0p++ =3D ']';<BR>&nbsp;&nbsp; *a0p++ =3D =
0;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; bp =3D tb;<BR>&nbsp;&nbsp; while =
(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tb =3D=20
bp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (*tb &amp;&amp; (*tb =
=3D=3D '\n'=20
|| *tb =3D=3D =
'\r'))<BR>&nbsp;&nbsp;tb++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bp=20
=3D tb;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (*bp &amp;&amp; =
*bp !=3D '\n'=20
&amp;&amp; *bp !=3D=20
'\r')<BR>&nbsp;&nbsp;bp++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
(*bp =3D=3D=20
0)<BR>&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *bp++ =
=3D=20
0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (tb[0] =3D=3D 0 || tb[0] =
=3D=3D=20
'#')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
continue;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (tb[0] =3D=3D=20
'[')<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp; char *p =3D bp - 2;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; /* Some losers leave trailing blanks after=20
"[foo]".&nbsp; */<BR>&nbsp;&nbsp;&nbsp; while (p &gt; tb &amp;&amp; (*p =
=3D=3D ' '=20
|| *p =3D=3D '\t'))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
p--;<BR>&nbsp;&nbsp;&nbsp;=20
*++p =3D 0;<BR>&nbsp;&nbsp;&nbsp; if (strcmp (tb, base) =3D=3D=20
0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this_prog =3D =
1;<BR>&nbsp;&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this_prog =3D=20
0;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp; if=20
(this_prog)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *buf =3D alloca=20
(fsize);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *tb2 =3D=20
buf;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *sp =3D tb, *dp =
=3D=20
tb2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acdebugnl while (*sp =
!=3D '=3D'=20
&amp;&amp; *sp !=3D '\n' &amp;&amp; *sp)<BR>&nbsp;&nbsp;&nbsp;*dp++ =3D=20
*sp++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (*sp =3D=3D '\n' =
|| *sp =3D=3D=20
'\0')<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp; tb =3D=20
sp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
continue;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
if (*tb2 =3D=3D '+')&nbsp;/* non-overriding=20
*/<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp; acdebugnl * dp =3D =

0;<BR>&nbsp;&nbsp;&nbsp;&nbsp; tb2++;<BR>&nbsp;&nbsp;&nbsp;&nbsp; if =
(getenv=20
(tb2))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;&nbsp;/* while =
scanning=20
bytes =
*/<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
*dp++ =3D *sp++;&nbsp;/* copy the '=3D'=20
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while=20
(*sp)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp; if (*sp =3D=3D=20
'%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char=20
*pp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (sp[1] =
=3D=3D=20
'%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
*dp++ =3D=20
'%';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sp +=3D=20
2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char =
ps, *e,=20
*dirend;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int dirpart =3D 0, apsemi =3D =

0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int mapup =3D 0, maplow =3D 0, =
mapfs=20
=3D<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, mapbs =3D=20
0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (strchr (":;/\\&lt;&gt;",=20
sp[1]))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
acdebugnl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;=20
switch=20
(sp[1])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;case=20
':':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dirpart =3D=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case=20
';':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; apsemi =3D=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case=20
'/':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapfs =3D=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case=20
'\\':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapbs =3D=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case=20
'&lt;':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mapup =3D=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case=20
'&gt;':<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maplow =3D=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;=20
sp++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (pp =3D sp + 1; *pp &amp;&amp; =
*pp !=3D '%';=20
pp++);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps =3D=20
*pp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *pp =3D=20
0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e =3D getenv (sp +=20
1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dirend =3D=20
dp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if=20
(e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
acdebugnl<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;=20
while=20
(*e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;=20
char ec =3D *e++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (strchr=20
("<A>\\/</A>:", ec))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
dirend=20
=3D dp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if=20
(mapup)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ec =3D =
toupper=20
((unsigned char) ec);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if=20
(maplow)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ec =3D =
tolower=20
((unsigned char) ec);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (mapfs=20
&amp;&amp; ec =3D=3D =
'\\')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ec =3D=20
'/';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (mapbs &amp;&amp; ec =
=3D=3D=20
'/')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ec =3D=20
'\\';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *dp++ =3D=20
ec;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if=20
(dirpart)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dp =3D=20
dirend;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (apsemi &amp;&amp;=20
e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *dp++ =3D=20
';';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ps =3D=3D=20
0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sp =3D pp +=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *dp++=20
=3D =
*sp++;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
*dp++ =3D 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf =
("putenv&nbsp;=20
%s \n", tb2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; putenv=20
(tb2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; free=20
(file);<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp; }<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>int main (int argc , char * argv[] )<BR>{<BR>&nbsp; printf("TEST 1: =
This=20
app is %s\n", argv[0]);<BR>&nbsp; test_environment_file(argv[0],=20
0x0000);<BR>&nbsp; printf("TEST 2: This app is %s\n", =
argv[0]);<BR>&nbsp;=20
test_environment_file(argv[0], 0x1000);<BR>&nbsp; return 0;<BR>}</DIV>
<DIV>
<DIV>-------------------------------------------------- CODE END=20
-----------------</DIV></DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>On Mon, 9 Jul 2001, Andrew Cottrell=20
wrote:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt; 1) On the WIN98 PC the DOS set =
command does=20
not show an environment<BR>&gt; variable called DJDIR, but it shows up =
when I=20
display all of the<BR>&gt; environment variables as indicated in the =
sample=20
app</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This is expected behavior: DJDIR is =
computed and=20
set by the startup code <BR>of each DJGPP program.&nbsp; That's why you =
only see=20
it inside a program, and <BR>in any shells spawned by a program, but not =

outside.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt; 2) On the WIN 2000 PC the DOS set =
command does=20
not show an environment<BR>&gt; variable called DJDIR and neither does =
the=20
sample app show it in the<BR>&gt; environment array.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>That is the reason for the problem with =

RHIDE.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt; Any ideas on what I should do next =
or where to=20
look?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>You should look at the startup code, =
specifically=20
at the code in the file <BR>src/libc/crt0/c1loadef.c.&nbsp; This is the =
code=20
which reads the djgpp.env <BR>file and sets DJDIR when it reads this =
line from=20
djgpp.env:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; =
DJDIR=3D%:/&gt;DJGPP%</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Something is wrong there when the =
program runs on=20
Windows 2000.&nbsp; (If you <BR>need to understand the cryptic syntax of =

djgpp.env, read the section <BR>"DJGPP.ENV" in the Info file=20
kb.info.)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for working on =
this.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Btw, you might wish to redirect this =
discussion to=20
the<BR><A =
href=3D"mailto:djgpp-workers AT delorie DOT com">djgpp-workers AT delorie DOT com</A>=20
mailing list, where all the DJGPP developers<BR>are=20
subscribed.</FONT></DIV></BODY></HTML>

------=_NextPart_000_0009_01C10998.6BA307D0--

- Raw text -


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