diff options
author | stanton <stanton> | 1998-08-05 19:57:47 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-08-05 19:57:47 (GMT) |
commit | 7935ba9d7992f9b1ad2123bf0c377aee209231f7 (patch) | |
tree | 540ae2679f1186f525694afdfc4d8d2934dafbf4 /win/tclWinInit.c | |
parent | 4d15525a97df44cb8b8392d8d5deac99e14af2c8 (diff) | |
download | tcl-7935ba9d7992f9b1ad2123bf0c377aee209231f7.zip tcl-7935ba9d7992f9b1ad2123bf0c377aee209231f7.tar.gz tcl-7935ba9d7992f9b1ad2123bf0c377aee209231f7.tar.bz2 |
fixed bad registry code
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 1efc416..cb78d5f 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -183,22 +183,29 @@ TclPlatformInit(interp) RegQueryValueEx(key, "PkgPath", NULL, NULL, (LPBYTE)Tcl_DStringValue(&ds), &size); argc = 0; - for (p = Tcl_DStringValue(&ds); *p || *(p+1); - p += strlen(p) + 1) { - argc++; - } + p = Tcl_DStringValue(&ds); + do { + if (*p) { + argc++; + } + p += strlen(p) + 1; + } while (*p); argv = (char **) ckalloc((sizeof(char *) * argc) + 1); argc = 0; - for (p = Tcl_DStringValue(&ds); *p || *(p+1); p++) { - argv[argc++] = p; - while (*p) { - if (*p == '\\') { - *p = '/'; + p = Tcl_DStringValue(&ds); + do { + if (*p) { + argv[argc++] = p; + while (*p) { + if (*p == '\\') { + *p = '/'; + } + p++; } - p++; } - } + p++; + } while (*p); p = Tcl_Merge(argc, argv); Tcl_SetVar(interp, "tcl_pkgPath", p, TCL_GLOBAL_ONLY); |