diff options
| -rw-r--r-- | generic/tclNamesp.c | 32 | ||||
| -rwxr-xr-x | unix/configure | 14 | ||||
| -rw-r--r-- | unix/tcl.m4 | 11 | ||||
| -rw-r--r-- | win/tclWinThrd.c | 4 |
4 files changed, 32 insertions, 29 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index db79017..6b57e6c 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -2234,7 +2234,7 @@ TclGetNamespaceForQualName( * TCL_FIND_ONLY_NS was specified. */ { Interp *iPtr = (Interp *) interp; - Namespace *nsPtr = cxtNsPtr; + Namespace *nsPtr = cxtNsPtr, *lastNsPtr = NULL, *lastAltNsPtr = NULL; Namespace *altNsPtr; Namespace *globalNsPtr = iPtr->globalNsPtr; const char *start, *end; @@ -2375,17 +2375,12 @@ TclGetNamespaceForQualName( if (nsPtr == NULL) { Tcl_Panic("Could not create namespace '%s'", nsName); } - } else { /* Namespace not found and was not - * created. */ - if (flags & TCL_FIND_IF_NOT_SIMPLE) { - /* - * return last found NS and not simple name relative it, - * e. g. ::A::B::C::D -> ::A::B and C::D, if - * namespace C cannot be found in ::A::B - */ - *simpleNamePtr = start; - goto done; - } + } else { + /* + * Namespace not found and was not created. + * Remember last found namespace for TCL_FIND_IF_NOT_SIMPLE. + */ + lastNsPtr = nsPtr; nsPtr = NULL; } } @@ -2407,6 +2402,8 @@ TclGetNamespaceForQualName( if (entryPtr != NULL) { altNsPtr = (Namespace *)Tcl_GetHashValue(entryPtr); } else { + /* Remember last found in alternate path */ + lastAltNsPtr = altNsPtr; altNsPtr = NULL; } } @@ -2416,6 +2413,17 @@ TclGetNamespaceForQualName( */ if ((nsPtr == NULL) && (altNsPtr == NULL)) { + if (flags & TCL_FIND_IF_NOT_SIMPLE) { + /* + * return last found NS, regardless simple name or not, + * e. g. ::A::B::C::D -> ::A::B and C::D, if namespace C + * cannot be found in ::A::B + */ + nsPtr = lastNsPtr; + altNsPtr = lastAltNsPtr; + *simpleNamePtr = start; + goto done; + } *simpleNamePtr = NULL; goto done; } diff --git a/unix/configure b/unix/configure index fe3be30..c8e5bdc 100755 --- a/unix/configure +++ b/unix/configure @@ -6402,16 +6402,12 @@ fi case $system in DragonFly-*|FreeBSD-*) - if test "${TCL_THREADS}" = "1" -then : - - # The -pthread needs to go in the LDFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS" -fi + # The -pthread needs to go in the LDFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LDFLAGS="$LDFLAGS $PTHREAD_LIBS" ;; - esac + esac if test $doRpath = yes then : diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 4a9fe40..7b84923 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1276,13 +1276,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ case $system in DragonFly-*|FreeBSD-*) - AS_IF([test "${TCL_THREADS}" = "1"], [ - # The -pthread needs to go in the LDFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS"]) + # The -pthread needs to go in the LDFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LDFLAGS="$LDFLAGS $PTHREAD_LIBS" ;; - esac + esac AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index 37e0841..84a0eca 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -38,7 +38,7 @@ static CRITICAL_SECTION initLock; /* * allocLock is used by Tcl's version of malloc for synchronization. For - * obvious reasons, cannot use any dyamically allocated storage. + * obvious reasons, cannot use any dynamically allocated storage. */ #if TCL_THREADS @@ -458,7 +458,7 @@ TclpGlobalUnlock(void) * Tcl_GetAllocMutex * * This procedure returns a pointer to a statically initialized mutex for - * use by the memory allocator. The alloctor must use this lock, because + * use by the memory allocator. The allocator must use this lock, because * all other locks are allocated... * * Results: |
