Antwort: Re: 1.3.4: error in inheriting new PATH environment form WIN32executable to cygwin executable

Heiko_Elger@arburg.com Heiko_Elger@arburg.com
Wed Nov 7 23:02:00 GMT 2001


Hello Christopher,

thanks for your info.

I know the  the definition of MAX_PATH but I think it must be an old one - cause
you can set a path longer than MAX_PATH.
> Cygwin expects path spec components will be no more than MAX_PATH in length.
> MAX_PATH == 260.  This is a Microsoft constant.

But I think the problem is not so easy ....
cause sometimes it works and sometimes it works not.
There are different was to set the path

1) If  the path is set in a shell cmd.exe via "set path=........" - all works
fine and in a cygwin program the path is really the same.
2) If set in an non cygwin programe via putenv() and called a cygwin program via
system() the path is reset to null (if its to long)
3) if bot programs are compile with Microsoft all works fine
4) if both programms are compiled with cygwin all works fine too

So if cygwin expects a path not longer than MAX_PATH I think that tahe path has
to be reset every time.
And the same a above, I think that the specifikation tah a PATH has to be not
longer tahn 260 is an old specifikation.


Mit freundlichen Gruessen
best regards

   Heiko Elger



********************

ARBURG GmbH + Co
Heiko Elger
- Softwareentwicklung - / - Research and Development -
Arthur-Hehl-Strasse
D-72290 Lossburg
Tel.: +49 (0) 7446 33-3659
Fax.: +49 (0) 7446 33-3365
mailto:heiko_elger@arburg.com
http://www.arburg.com



                                                                                                                                                
                    Christopher Faylor                                                                                                          
                    <cgf@redhat.com>             An:     cygwin@cygwin.com                                                                      
                    Gesendet von:                Kopie:                                                                                         
                    cygwin-owner@sources.        Thema:  Re: 1.3.4: error in inheriting new PATH environment form WIN32 executable to cygwin    
                    redhat.com                   executable                                                                                     
                                                                                                                                                
                                                                                                                                                
                    07.11.2001 20:09                                                                                                            
                    Bitte antworten an                                                                                                          
                    cygwin                                                                                                                      
                                                                                                                                                
                                                                                                                                                




On Wed, Nov 07, 2001 at 02:33:08PM +0100, Heiko_Elger@arburg.com wrote:
>Hello,
>
>I have the following problem:
>
>If a MS WIN 32 program changes his environment PATH variable to a very long
>value (over 270 characters) and than calling a CYGWIN program per system() call
>the path inside the CYGWIN program is reset to NULL! If it calls a MS WIN 32
>program all works fine.
>
>We have this problem with clearmake in exporting a very long path and the shell
>is the CYGWIN sh.exe.
>
>I tried to reproduce it within a very small test.
>I wrote two small programs (belwo you wil find the sourcecode):
>   changeenv.c --> MS WIN 32 program which change his PATH environment and
calls
>per system() the program "printpath"
>   printpath.c   --> prints the PATH environment to stdout

Cygwin expects path spec components will be no more than MAX_PATH in length.
MAX_PATH == 260.  This is a Microsoft constant.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/







--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list