On 27/09/13 09:54 +0100, john ffitch wrote: > There is a ticket asking to change the way in which environments are > handled. At present it uses ; as the separator like Windows, but the > modification now allows : (as used in Un*x) or ; and also writes the > separator native to the computer. > > My trouble is that I do not have a test program. If you have such > could you either test the GIT code or send me a csd/whatever so I can > test? The current patch seems to work fine using Csound's --env flags, but when actually picking up the variable from the environment there is an off-by-one error. When I make the following change I'm able to use ':' or ';' as the separator on Unix and all paths are searched as expected. ash$ git diff diff --git a/Engine/envvar.c b/Engine/envvar.c index dc7de95..8d34e82 100644 --- a/Engine/envvar.c +++ b/Engine/envvar.c @@ -252,8 +252,8 @@ int csoundAppendEnv(CSOUND *csound, const char *name, const char *valu /* append to old value */ strcpy(newval, oldval); /* These are safe as space calculated above */ // should be a better way - newval[strlen(oldval)+1]= ENVSEP; - newval[strlen(oldval)+2]= '\0'; + newval[strlen(oldval)]= ENVSEP; + newval[strlen(oldval)+1]= '\0'; strcat(newval, value); /* set variable */ retval = csoundSetEnv(csound, name, newval); You can use the following CSD to test for yourself. ; To set up: ; mkdir /tmp/dir1 /tmp/dir2 ; Put a two-channel "someaudio.wav" file in /tmp/dir2 ; Use one of the following mutually exclusive option strings. ; To test Csound's --env += flag functionality use the following line. ;-odac --env:SSDIR+=/tmp/dir1:/tmp/dir2 ; To test Csound's --env = flag functionality use the following line. ;-odac --env:SSDIR=/tmp/dir1:/tmp/dir2 ; To test actually picking up a value from the environment, first set the ; environment. In a POSIX shell on Unix, you can do with with the command... ; export SSDIR=/tmp/dir1:/tmp/dir2 ; To unset envrionment variable use the command... ; unset SSDIR ; ...and use the following line. -odac sr = 44100 ksmps = 32 nchnls = 2 0dbfs = 1 instr 1 a1, a2 diskin2 "someaudio.wav", 1, 0, 1, 0, 32 outs a1, a2 endin i 1 0 15 e