From 7935ba9d7992f9b1ad2123bf0c377aee209231f7 Mon Sep 17 00:00:00 2001 From: stanton Date: Wed, 5 Aug 1998 19:57:47 +0000 Subject: fixed bad registry code --- win/tclWinInit.c | 29 ++++++++++++++++++----------- 1 file 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); -- cgit v0.12