-static const char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/allParam/tcl/tclParam.c,v 1.26 2003-02-05 16:54:46 hadaq Exp $";
+static const char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/allParam/tcl/tclParam.c,v 1.27 2003-02-06 13:07:00 hadaq Exp $";
#define _POSIX_C_SOURCE 199509L
#if HAVE_CONFIG_H
int conParam(Param *my)
{
int retVal = 0;
+ char *p;
char *paramFile;
char *storageFile;
int code;
my->setup = NULL;
my->specParam = malloc(sizeof(TclParam));
- paramFile = getenv("DAQSLOW_PARAM_FILE");
- if (paramFile == NULL) {
- paramFile = "param.tcl";
+ p = getenv("DAQSLOW_PARAM_FILE");
+ if (p == NULL) {
+ p = "param.tcl";
}
- storageFile = getenv("DAQSLOW_STORAGE_FILE");
- if (storageFile == NULL) {
- storageFile = "storage.tcl";
+ paramFile = malloc(strlen(p) + 1);
+ strcpy(paramFile, p);
+
+ p = getenv("DAQSLOW_STORAGE_FILE");
+ if (p == NULL) {
+ p = "storage.tcl";
}
+ storageFile = malloc(strlen(p) + 1);
+ strcpy(storageFile, p);
((TclParam *) (my->specParam))->interp = Tcl_CreateInterp();
code = Tcl_EvalFile(((TclParam *) (my->specParam))->interp, paramFile);
my->basedir = NULL;
}
+ free(paramFile);
+ free(storageFile);
+
return retVal;
}