COMSPEC environment variable missing

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

COMSPEC environment variable missing

Ingo Brueckl
Hi.

I'm using the 20051227-snapshot of cygwin1.dll. This is my Windows 98SE
environment as told by the 'set' command:

  TMP=C:\WINDOWS\TEMP
  TEMP=C:\WINDOWS\TEMP
  PROMPT=$p$g
  winbootdir=C:\WINDOWS
  PATH=C:\WINDOWS;C:\WINDOWS\COMMAND
  COMSPEC=C:\WINDOWS\COMMAND.COM
  DIRCMD=/o:gne
  windir=C:\WINDOWS
  BLASTER=A220 I5 D1 H5 P330 T6
  CMDLINE=myset

In a cygwin program, there is no COMSPEC environment variable. I get NULL
when using getenv().

In order to check my cygwin environment, I wrote the following program:

  #include <stdio.h>
  #include <unistd.h>

  int main()
  {
    int i;

    for(i = 0;; i++)
      if (environ[i]) puts(environ[i]);
      else break;

    return 0;
  }

which returns:

  !C:=C:\WINDOWS\TEMP
  TMP=/tmp
  TEMP=/tmp
  PROMPT=$p$g
  WINBOOTDIR=C:\WINDOWS
  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND
  DIRCMD=/o:gne
  WINDIR=C:\WINDOWS
  BLASTER=A220 I5 D1 H5 P330 T6
  CMDLINE=myset
  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND
  TERM=cygwin
  HOME=/home/ib

Indeed, COMSPEC is missing, and PATH is twice.

A bug?

Ingo

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: COMSPEC environment variable missing

Christopher Faylor-2
On Thu, Dec 29, 2005 at 03:11:00AM +0100, Ingo Brueckl wrote:

>Hi.
>
>I'm using the 20051227-snapshot of cygwin1.dll. This is my Windows 98SE
>environment as told by the 'set' command:
>
>  TMP=C:\WINDOWS\TEMP
>  TEMP=C:\WINDOWS\TEMP
>  PROMPT=$p$g
>  winbootdir=C:\WINDOWS
>  PATH=C:\WINDOWS;C:\WINDOWS\COMMAND
>  COMSPEC=C:\WINDOWS\COMMAND.COM
>  DIRCMD=/o:gne
>  windir=C:\WINDOWS
>  BLASTER=A220 I5 D1 H5 P330 T6
>  CMDLINE=myset
>
>In a cygwin program, there is no COMSPEC environment variable. I get NULL
>when using getenv().
>
>In order to check my cygwin environment, I wrote the following program:
>
>  #include <stdio.h>
>  #include <unistd.h>
>
>  int main()
>  {
>    int i;
>
>    for(i = 0;; i++)
>      if (environ[i]) puts(environ[i]);
>      else break;
>
>    return 0;
>  }
>
>which returns:
>
>  !C:=C:\WINDOWS\TEMP
>  TMP=/tmp
>  TEMP=/tmp
>  PROMPT=$p$g
>  WINBOOTDIR=C:\WINDOWS
>  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND
>  DIRCMD=/o:gne
>  WINDIR=C:\WINDOWS
>  BLASTER=A220 I5 D1 H5 P330 T6
>  CMDLINE=myset
>  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND
>  TERM=cygwin
>  HOME=/home/ib
>
>Indeed, COMSPEC is missing, and PATH is twice.

PATH twice is a bug (but not a regression).  I couldn't duplicate the
missing COMSPEC.  I only have WinME to try this on, though.

cgf


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: COMSPEC environment variable missing

Ingo Brueckl
In reply to this post by Ingo Brueckl
An observation which should help.

See http://www.cygwin.com/ml/cygwin/2005-12/msg01037.html for the problem. As
said, COMSPEC is set:

  TMP=C:\WINDOWS\TEMP
  TEMP=C:\WINDOWS\TEMP
  PROMPT=$p$g
  winbootdir=C:\WINDOWS
  PATH=C:\WINDOWS;C:\WINDOWS\COMMAND
  COMSPEC=C:\WINDOWS\COMMAND.COM
  DIRCMD=/o:gne
  windir=C:\WINDOWS
  BLASTER=A220 I5 D1 H5 P330 T6

but missing in cygwin environment:

  !C:=C:\daten\c\cygwin
  TMP=/tmp
  TEMP=/tmp
  PROMPT=$p$g
  WINBOOTDIR=C:\WINDOWS
  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND
  DIRCMD=/o:gne
  WINDIR=C:\WINDOWS
  BLASTER=A220 I5 D1 H5 P330 T6
  CMDLINE=myset
  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND
  TERM=cygwin
  HOME=/home/ib

But now something odd! If I do:

  set PATH=%PATH%;DOES_NOT_MATTER

I suddenly get:

  !C:=C:\daten\c\cygwin
  TMP=/tmp
  TEMP=/tmp
  PROMPT=$p$g
  WINBOOTDIR=C:\WINDOWS
  COMSPEC=C:\WINDOWS\COMMAND.COM
  DIRCMD=/o:gne
  WINDIR=C:\WINDOWS
  BLASTER=A220 I5 D1 H5 P330 T6
  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND:DOES_NOT_MATTER
  PATH=/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND:DOES_NOT_MATTER
  TERM=cygwin
  HOME=/home/ib

and COMSPEC reappers!

This only works, if setting PATH, no other environment variable change (or
setting of a new one) will cause COMSPEC to reappear.

Strange, but should help to track down this bug.

Ingo


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: COMSPEC environment variable missing

Ingo Brueckl
In reply to this post by Ingo Brueckl
Just tried the 20060104 snapshot. Bug is fixed.

Thanks a lot.

Ingo


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/