1 --- dmake/getinp.c.orig 2009-07-03 10:24:03.000000000 +0200
2 +++ dmake/getinp.c 2009-07-03 10:28:16.000000000 +0200
3 @@ -88,17 +88,23 @@ FILE *fil;
4 /* Reading the internal rule table. Set rule_ind to zero after the
5 * last entry so that ReadEnvironment() works as expected every time. */
7 - while( (p = Rule_tab[ rule_ind++ ]) != NIL(char) )
8 + while( (p = Rule_tab[ rule_ind++ ]) != NIL(char) ) {
9 /* The last test in this if *p != '~', handles the environment
10 * passing conventions used by MKS to pass arguments. We want to
11 * skip those environment entries. Also CYGWIN likes to export '!'
12 - * prefixed environment variables that cause severe pain, axe them too */
13 - if( !Readenv || (Readenv && (strchr(p,'=') != NIL(char)) && *p!='~' && *p!='!')){
14 + * prefixed environment variables that cause severe pain, axe them too.
15 + * And finally it is possible to do "env 'GGG HHH'='some value' bash"
16 + * which causes that there are env variables with spaces in the name
17 + * defined which causes dmake to malfunction too */
18 + char *equal = strchr(p,'=');
19 + char *space = strchr(p,' ');
20 + if( !Readenv || (Readenv && (equal != NIL(char)) && (space == NIL(char) || space > equal) && *p!='~' && *p!='!')){
23 DB_PRINT( "io", ("Returning [%s]", buf) );