[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MiNT 1.09 - setenv patch



MiNT up to 1.09 can't handle setenv properly (IMHO) from the mint.cnf
file...  if you have:

setenv BLAH a b c

$BLAH will be a; the rest of the line is ignored.  Using:

setenv BLAH "a b c"

is no good, because $BLAH will be "a b c"... it includes the quotes.  I
told Eric about this a while ago on GEnie (just before he started work
at Atari! :-), but it looks like it was lost in the shuffle.

The following patch to main.c fixes the mint.cnf setenv command... it
will go to the end of the line to allow:

setenv BLAH a b c

to work properly.  An example of when you'd want this is the options
environment variable for the POV-Ray ray-tracer, or the $RNINIT
environment variable for 'rn' (I like to use "} " as my quote line in
rn).

The patch is relative to the "plain" 1.09 sources; if you've been
following all of the 1.09 patches, it'll miss the patch by about three
lines... it's fairly trivial to apply it by hand.

Does anyone know if 1.10 is going to happen soon, or is Eric too busy
with Jaguar stuff?

---------- 8< ----------
*** main.ori	Fri Aug  6 08:58:20 1993
--- main.c	Fri Dec  3 21:44:40 1993
***************
*** 1349,1355 ****
  	}
  
  	arg2 = line;
! 	while (*line && *line != ' ') line++;
  	if (*line) {
  		*line = 0;
  	}
--- 1349,1359 ----
  	}
  
  	arg2 = line;
! 	/* This next line must be changed for sane parsing of environment */
! 	/* vars with spaces...  POV-Ray's is an example.                  */
! 	/* cherborth@semprini.waterloo-rdp.on.ca                          */
! 	/* while (*line && *line != ' ') line++;        <-- original line */
! 	while (*line && *line != '\r' && *line != '\n') line++;
  	if (*line) {
  		*line = 0;
  	}
---------- 8< ----------
-- 
-------------------========================================-------------------
                                         cherborth@semprini.waterloo-rdp.on.ca
                                                                Chris Herborth