Apache OpenOffice (AOO) Bugzilla – Issue 27319
environment parsing foo
Last modified: 2004-04-26 18:15:40 UTC
cygwin likes to export bogus environment variables eg. '!EXITCODE' which screw up dmake beyond belief - since it parses the whole environment line by line. This patch fixes this; diff -u -p -u -r1.3 getinp.c --- dmake/getinp.c 11 Oct 2002 13:42:43 -0000 1.3 +++ dmake/getinp.c 1 Apr 2004 16:19:25 -0000 @@ -85,8 +85,9 @@ FILE *fil; while( (p = Rule_tab[ rule_ind++ ]) != NIL(char) ) /* The last test in this if *p != '~', handles the environment * passing conventions used by MKS to pass arguments. We want to - * skip those environment entries. */ - if( !Readenv || (Readenv && (strchr(p,'=') != NIL(char)) && *p!='~')){ + * skip those environment entries. Also CYGWIN likes to export '!' + * prefixed environment variables that cause severe pain, axe them too */ + if( !Readenv || (Readenv && (strchr(p,'=') != NIL(char)) && *p!='~' && *p!='!')){ strcpy( buf, p ); DB_PRINT( "io", ("Returning [%s]", buf) ); A typical warning would be: Error in startup.mk line 26
committed to cws_src680_ooo20040329
apparently that cws is shut; hmm.
Hi Michael! Please try this workaround and report back. Enter in Start->Run: C:\cygwin\bin\rxvt.exe -sl 1000 -e /usr/bin/bash --login -i This should do. (The -sl 1000 gives you a thousand lines scrollbuffer, it's not needed, but convenient.) Another solution is installing sshd and logging into your Windows machine and working in a ssh shell. (This is what I always do, therefore I didn't get the problem.) The actual problem comes from cygwin being a bit to clever, in its source code, file environ.cc it says: /* Current directory information is recorded as variables of the form "=X:=X:\foo\bar; these must be changed into something legal (we could just ignore them but maybe an application will eventually want to use them). */ Unfortunately !SOMETHING is also not legal :-( I deduct from this and the existence of !EXITCODE that Windows sometimes has a variable named =EXITCODE. When using one of the two methods mentioned above to start bash/tcsh there should be no !X:=X:\foo\bar set.
I have another one: Start your tcsh in your cygwin shell with: $ env `set | sed -ne '/\!/{s/=.*$//; s/^/-u / p}'` tcsh Sorry, couldn't resist ;-)
Ahh, well I forgot, patch approved!
closing
.