| 240 | } |
| 241 | |
| 242 | const char * |
| 243 | getInterpPWD(Tcl_Interp *interp) |
| 244 | { |
| 245 | static char *pwd = 0; |
| 246 | |
| 247 | if (pwd != 0) |
| 248 | delete[] pwd; |
| 249 | |
| 250 | #ifdef _TCL84 |
| 251 | Tcl_Obj *cwd = Tcl_FSGetCwd(interp); |
| 252 | if (cwd != NULL) { |
| 253 | int length; |
| 254 | const char *objPWD = Tcl_GetStringFromObj(cwd, &length); |
| 255 | pwd = new char[length + 1]; |
| 256 | strcpy(pwd, objPWD); |
| 257 | Tcl_DecrRefCount(cwd); |
| 258 | } |
| 259 | #else |
| 260 | Tcl_DString buf; |
| 261 | const char *objPWD = Tcl_GetCwd(interp, &buf); |
| 262 | |
| 263 | pwd = new char[strlen(objPWD) + 1]; |
| 264 | strcpy(pwd, objPWD); |
| 265 | |
| 266 | Tcl_DStringFree(&buf); |
| 267 | #endif |
| 268 | return pwd; |
| 269 | } |
| 270 | |
| 271 | int |
| 272 | OPS_SourceCmd(ClientData dummy, /* Not used. */ |
no outgoing calls
no test coverage detected