summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 53b2021..eac35be 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclParse.c,v 1.43 2005/07/21 14:38:50 dkf Exp $
+ * RCS: @(#) $Id: tclParse.c,v 1.44 2005/10/04 23:49:45 hobbs Exp $
*/
#include "tclInt.h"
@@ -374,20 +374,28 @@ Tcl_ParseCommand(interp, start, numBytes, nested, parsePtr)
*/
expPtr = &parsePtr->tokenPtr[expIdx];
- if ((expPfxLen == (size_t) expPtr->size)
- /* Same length as prefix */
- && (0 == expandWord)
- /* Haven't seen prefix already */
- && (1 == parsePtr->numTokens - expIdx)
- /* Only one token */
- && (0 == strncmp(expPfx,expPtr->start,expPfxLen))
- /* Is the prefix */
- && (numBytes > 0)
- && (TclParseWhiteSpace(termPtr, numBytes, parsePtr, &type)
- == 0)
- && (type != TYPE_COMMAND_END)
- /* Non-whitespace follows */
- ) {
+ if (
+ (0 == expandWord)
+ /* Haven't seen prefix already */
+ && (1 == parsePtr->numTokens - expIdx)
+ /* Only one token */
+ && (((expPfxLen == (size_t) expPtr->size)
+ /* Same length as prefix */
+ && (0 == strncmp(expPfx,expPtr->start,expPfxLen)))
+#ifdef ALLOW_EMPTY_EXPAND
+ /*
+ * Allow {} in addition to {expand}
+ */
+ || (0 == (size_t) expPtr->size)
+#endif
+ )
+ /* Is the prefix */
+ && (numBytes > 0)
+ && (TclParseWhiteSpace(termPtr, numBytes, parsePtr,
+ &type) == 0)
+ && (type != TYPE_COMMAND_END)
+ /* Non-whitespace follows */
+ ) {
expandWord = 1;
parsePtr->numTokens--;
goto parseWord;