Index: src/main.cpp =================================================================== RCS file: /cvs/cvsnt/src/main.c,v retrieving revision 1.71.2.151.6.54.2.7 diff -c -r1.71.2.151.6.54.2.7 main.cpp *** src/main.cpp 6 Jun 2010 01:03:29 -0000 1.71.2.151.6.54.2.7 --- src/main.cpp 8 Jun 2010 00:55:07 -0000 *************** *** 900,906 **** if ((ccp = CProtocolLibrary::GetEnvironment (TMPDIR_ENV)) != NULL) { ! Tmpdir = ccp; tmpdir_update_env = 0; /* it's already there */ } if ((ccp = CProtocolLibrary::GetEnvironment (EDITOR1_ENV)) != NULL) --- 900,907 ---- if ((ccp = CProtocolLibrary::GetEnvironment (TMPDIR_ENV)) != NULL) { ! Tmpdir = xstrdup (ccp); ! free_Tmpdir = 1; tmpdir_update_env = 0; /* it's already there */ } if ((ccp = CProtocolLibrary::GetEnvironment (EDITOR1_ENV)) != NULL) *************** *** 1494,1500 **** --- 1495,1504 ---- } if (Tmpdir == NULL || Tmpdir[0] == '\0') + { + free_Tmpdir = 0; Tmpdir = "/tmp"; + } #ifdef HAVE_PUTENV if (tmpdir_update_env) Index: src/subr.cpp =================================================================== RCS file: /cvs/cvsnt/src/subr.c,v retrieving revision 1.62.2.81.6.19 diff -c -r1.62.2.81.6.19 subr.cpp *** src/subr.cpp 26 Oct 2009 13:34:50 -0000 1.62.2.81.6.19 --- src/subr.cpp 8 Jun 2010 00:55:07 -0000 *************** *** 1282,1289 **** #if !defined(_WIN32) && defined(HAVE_PUTENV) void cvs_putenv(const char *variable, const char *value) { ! char *tmp = (char*)xmalloc(strlen(variable)+strlen(value)+2); ! sprintf(tmp,"%s=%s",variable,value); putenv(tmp); /* No need to free tmp as it's owned by the putenv function */ } --- 1282,1294 ---- #if !defined(_WIN32) && defined(HAVE_PUTENV) void cvs_putenv(const char *variable, const char *value) { ! // the windows implementation asserts on either varliable or value NULL ! // assert(variable); ! // assert(value); ! size_t tmpsiz=strlen(PATCH_NULL(variable))+strlen(PATCH_NULL(value))+2; ! char *tmp = (char*)xmalloc(sizeof(char)*tmpsiz); ! memset(tmp,0,tmpsiz); ! snprintf(tmp,tmpsiz,"%s=%s",PATCH_NULL(variable),PATCH_NULL(value)); putenv(tmp); /* No need to free tmp as it's owned by the putenv function */ }