Changeset 16910
- Timestamp:
- 2008-08-20T10:32:33+12:00 (16 years ago)
- Location:
- gsdl/trunk/runtime-src/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/recpt/wizardaction.cpp
r16310 r16910 58 58 recpt = NULL; 59 59 disabled = true; 60 gsdlosc = NULL;61 gsdlhomec = NULL;62 pathc = NULL;63 60 64 61 macro_prefix = ""; … … 66 63 67 64 wizardaction::~wizardaction () { 68 if (gsdlosc != NULL) delete []gsdlosc;69 if (gsdlhomec != NULL) delete []gsdlhomec;70 if (pathc != NULL) delete []pathc;71 65 } 72 66 … … 88 82 bool wizardaction::init (ostream & /*logout*/) { 89 83 90 // set up GSDLOS, GSDLHOME and PATH environment variables 91 text_t gsdlos, path; 92 unsigned int path_separator = ':'; 93 #if defined (__WIN32__) 94 gsdlos = "windows"; 95 path_separator = ';'; 96 97 path = filename_cat (gsdlhome, "bin", "windows", "perl", "bin;"); 98 99 #else 100 struct utsname *buf = new struct utsname(); 101 int i = uname (buf); 102 if (i == -1) gsdlos = "linux"; // uname failed 103 else gsdlos.setcstr (buf->sysname); 104 delete buf; 105 lc (gsdlos); 106 #endif 107 108 pathc = getenv ("PATH"); 109 path += filename_cat (gsdlhome, "bin", gsdlos); 110 path.push_back (path_separator); 111 path += filename_cat (gsdlhome, "bin", "script"); 112 if (pathc != NULL) { 113 path.push_back (path_separator); 114 path += pathc; 115 } 116 path = "PATH=" + path; 117 118 gsdlos = "GSDLOS=" + gsdlos; 119 text_t setgsdlhome = "GSDLHOME=" + gsdlhome; 120 121 // these will be cleaned up in the destructor 122 gsdlosc = gsdlos.getcstr(); 123 gsdlhomec = setgsdlhome.getcstr(); 124 pathc = path.getcstr(); 125 126 putenv (gsdlosc); 127 putenv (gsdlhomec); 128 putenv (pathc); 129 130 return true; 84 return set_gsdl_env_vars(gsdlhome); 131 85 } 132 86 -
gsdl/trunk/runtime-src/src/recpt/wizardaction.h
r11998 r16910 58 58 bool disabled; 59 59 receptionist *recpt; 60 char *gsdlosc;61 char *gsdlhomec;62 char *pathc;63 60 64 61 text_t macro_prefix;
Note:
See TracChangeset
for help on using the changeset viewer.