summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
authorstanton <stanton>1998-09-24 23:58:14 (GMT)
committerstanton <stanton>1998-09-24 23:58:14 (GMT)
commit9995355714bc90faf7c2e345b3d6a1d041447097 (patch)
tree2ad97c5b1994495118cef4df947cf16b55e326f2 /win/tclWinInit.c
parente13392595faf8e8d0d1c3c514ce160cfadc3d372 (diff)
downloadtcl-9995355714bc90faf7c2e345b3d6a1d041447097.zip
tcl-9995355714bc90faf7c2e345b3d6a1d041447097.tar.gz
tcl-9995355714bc90faf7c2e345b3d6a1d041447097.tar.bz2
merging changes from 8.0.3 into 8.1a2
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 98eda3f..ec0acea 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * SCCS: @(#) tclWinInit.c 1.48 98/02/17 17:17:19
+ * RCS: @(#) $Id: tclWinInit.c,v 1.1.2.2 1998/09/24 23:59:52 stanton Exp $
*/
#include "tclWinInt.h"
@@ -17,6 +17,15 @@
#include <winbase.h>
/*
+ * The following macro can be defined at compile time to specify
+ * the root of the Tcl registry keys.
+ */
+
+#ifndef TCL_REGISTRY_KEY
+#define TCL_REGISTRY_KEY "Software\\Scriptics\\Tcl\\" TCL_VERSION
+#endif
+
+/*
* The following declaration is a workaround for some Microsoft brain damage.
* The SYSTEM_INFO structure is different in various releases, even though the
* layout is the same. So we overlay our own structure on top of it so we
@@ -68,8 +77,8 @@ static char* processors[NUMPROCESSORS] = {
* The Init script (common to Windows and Unix platforms) is
* defined in tkInitScript.h
*/
-#include "tclInitScript.h"
+#include "tclInitScript.h"
static void AppendEnvironment(Tcl_Obj *listPtr, CONST char *lib);
static void AppendPath(Tcl_Obj *listPtr, HMODULE hModule,
@@ -329,13 +338,10 @@ AppendRegistry(
if (TclWinGetPlatformId() == VER_PLATFORM_WIN32s) {
key = HKEY_CLASSES_ROOT;
- subKey = "";
} else {
key = HKEY_LOCAL_MACHINE;
- subKey = "Root";
}
- result = RegOpenKeyExA(key, "Software\\Sun\\Tcl\\" TCL_VERSION, 0,
- KEY_QUERY_VALUE, &key);
+ result = RegOpenKeyExA(key, TCL_REGISTRY_KEY, 0, KEY_QUERY_VALUE, &key);
if (result != ERROR_SUCCESS) {
return;
}
@@ -349,13 +355,13 @@ AppendRegistry(
len = MAX_PATH;
if (TclWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- MultiByteToWideChar(CP_ACP, 0, subKey, -1, wBuf, MAX_PATH);
+ MultiByteToWideChar(CP_ACP, 0, "", -1, wBuf, MAX_PATH);
result = RegQueryValueExW(key, wBuf, NULL, NULL, (LPBYTE) wBuf, &len);
if (result == ERROR_SUCCESS) {
len = ToUtf(wBuf, buf);
}
} else {
- result = RegQueryValueExA(key, subKey, NULL, NULL, (LPBYTE) buf, &len);
+ result = RegQueryValueExA(key, "", NULL, NULL, (LPBYTE) buf, &len);
}
if (result == ERROR_SUCCESS) {
if (buf[len - 1] != '\\') {