rem: if (parse && status == TCL_OK && adPtr->output.length > frame.length) {  Tcl_SetResult(interp, adPtr->output.string + frame.length, TCL_VOLATILE);
add: if (parse && adPtr->output.length > frame.length) { if (status == TCL_OK) { Tcl_SetResult(interp, adPtr->output.string + frame.length, TCL_VOLATILE); }
context: NsTclIncludeCmd(ClientData parse, Tcl_Interp *interp, int argc,		char **argv){    struct stat st;    Ns_DString file, *dsPtr;    AdpData *adPtr;    Frame frame;    Page *pagePtr;    Ns_Entry *ePtr;    int new, status;    char *p, *key;    Ns_Cache *cachePtr;        if (argc < 2) {	Tcl_AppendResult(interp, "wrong # args: should be \"",	    argv[0], " file ?args ...?\"", NULL);	return TCL_ERROR;    }    pagePtr = NULL;    status = TCL_ERROR;    dsPtr = Ns_DStringPop();    Ns_DStringInit(&file);    adPtr = NsAdpGetData();        /*     * Construct the full, normalized path to the ADP file.     */    if (Ns_PathIsAbsolute(argv[1])) {	Ns_NormalizePath(&file, argv[1]);    } else {	Ns_MakePath(dsPtr, adPtr->cwd, argv[1], NULL);	Ns_NormalizePath(&file, dsPtr->string);	Ns_DStringTrunc(dsPtr, 0);    }    /*     * Check for TclPro debugging.     */    if (adPtr->debugLevel > 0) {	++adPtr->debugLevel;    } else if (nsconf.adp.enabledebug != NS_FALSE &&	adPtr->debugFile != NULL &&	(p = strrchr(file.string, '/')) != NULL &&	Tcl_StringMatch(p+1, adPtr->debugFile)) {	Ns_Conn *conn;	Ns_Set *hdrs;	char *host, *port, *procs;        conn = Ns_TclGetConn(interp);	hdrs = Ns_ConnGetQuery(conn);	host = Ns_SetIGet(hdrs, "dhost");	port = Ns_SetIGet(hdrs, "dport");	procs = Ns_SetIGet(hdrs, "dprocs");	if (DebugInit(interp, host, port, procs) != TCL_OK) {	    Ns_ConnReturnNotice(conn, 200, "Debug Init Failed",				interp->result);	    adPtr->exception = ADP_ABORT;	    goto done;	}    }    /*     * Determine the cache to use (if any).     */         if (adPtr->debugLevel > 0) {	cachePtr = NULL;    } else if (!nsconf.adp.threadcache) {    	cachePtr = sharedCachePtr;    } else {	if (adPtr->cachePtr == NULL) {	    char name[30];    	    sprintf(name, "adpObj.%d", Ns_ThreadId());    	    adPtr->cachePtr = Ns_CacheCreateSz(name, CACHE_KEYS, nsconf.adp.cachesize,				(Ns_Callback *) NsAdpFreePrivate);	}    	cachePtr = adPtr->cachePtr;    }    /*     * Verify the file is an existing, ordinary file and then either     * parse directly or fetch through the cache.     */    if (stat(file.string, &st) != 0) {	Tcl_AppendResult(interp, "could not stat \"",	    file.string, "\": ", Tcl_PosixError(interp), NULL);    } else if (S_ISREG(st.st_mode) == 0) {    	Tcl_AppendResult(interp, "not an ordinary file: ", file.string,			 NULL);    } else if (cachePtr == NULL) {        	/*	 * Parse directly from file.	 */	     	status = ParseFile(interp, file.string, st.st_size, dsPtr);    } else {#ifdef WIN32	key = file.string;#else    	Key ukey;	ukey.dev = st.st_dev;	ukey.ino = st.st_ino;	key = (char *) &ukey;#endif	if (cachePtr != sharedCachePtr) {    	    /*	     * Fetch from private, free-threaded cache.	     */            ePtr = Ns_CacheCreateEntry(cachePtr, key, &new);            if (!new) {    		pagePtr = Ns_CacheGetValue(ePtr);    		if (pagePtr->mtime != st.st_mtime || pagePtr->size != st.st_size) {		    Ns_CacheUnsetValue(ePtr);		    new = 1;		} else {		    status = TCL_OK;		}	    }	    if (new) {		status = ParseFile(interp, file.string, st.st_size, dsPtr);		if (status != TCL_OK) {                    Ns_CacheDeleteEntry(ePtr);		} else {		    pagePtr = NsAdpCopyPrivate(dsPtr, &st);                    Ns_CacheSetValueSz(ePtr, pagePtr, pagePtr->size);		}	    }	} else {    	    /*	     * Fetch from shared, interlocked cache.	     */            Ns_CacheLock(cachePtr);            ePtr = Ns_CacheCreateEntry(cachePtr, key, &new);            if (!new) {		while (ePtr != NULL && (pagePtr = Ns_CacheGetValue(ePtr)) == NULL) {		    Ns_CacheWait(cachePtr);		    ePtr = Ns_CacheFindEntry(cachePtr, key);		}		if (pagePtr == NULL) {		    Tcl_AppendResult(interp, "wait failed for file: ", file.string, NULL);		} else if (pagePtr->mtime != st.st_mtime || pagePtr->size != st.st_size) {		    Ns_CacheUnsetValue(ePtr);		    new = 1;		} else {		    Ns_DStringNAppend(dsPtr, pagePtr->chunks, pagePtr->length);		    status = TCL_OK;		}	    }	    if (new) {		Ns_CacheUnlock(cachePtr);		status = ParseFile(interp, file.string, st.st_size, dsPtr);		Ns_CacheLock(cachePtr);		if (status != TCL_OK) {                    Ns_CacheDeleteEntry(ePtr);		} else {		    pagePtr = NsAdpCopyShared(dsPtr, &st);                    Ns_CacheSetValueSz(ePtr, pagePtr, pagePtr->size);        	}		Ns_CacheBroadcast(cachePtr);	    }	    Ns_CacheUnlock(cachePtr);	}    }        /*     * If valid chunks where parsed or copied, push a new call frame, run     * the chunks, and pop the frame.     */             if (status == TCL_OK) {    	PushFrame(&frame, file.string, argc-1, argv+1);        if (cachePtr == NULL || cachePtr == sharedCachePtr) {            status = NsAdpEval(interp, file.string, dsPtr->string);        } else {            status = NsAdpRunPrivate(interp, file.string, pagePtr);        }    	if (parse && status == TCL_OK &&	    adPtr->output.length > frame.length) {	    	    Tcl_SetResult(interp, adPtr->output.string + frame.length,		TCL_VOLATILE);	    Ns_DStringTrunc(&adPtr->output, frame.length);	}    	PopFrame(&frame);	NsAdpFlush(adPtr);    }    if (adPtr->debugLevel > 0) {	--adPtr->debugLevel;    }done:    Ns_DStringFree(&file);    Ns_DStringPush(dsPtr);    return status;}