Index: generic/nsf.c =================================================================== diff -u -r9ae451a203a43950611411ccb52efed5263a4031 -r1d4a1e2678a648801a024ff9b4d7a3dec6f58e35 --- generic/nsf.c (.../nsf.c) (revision 9ae451a203a43950611411ccb52efed5263a4031) +++ generic/nsf.c (.../nsf.c) (revision 1d4a1e2678a648801a024ff9b4d7a3dec6f58e35) @@ -12766,10 +12766,11 @@ if (valueInArgument) { int equalOffset = valueInArgument - argument; /* - * parameter like -flag=1 + * Handle parameter like -flag=1 + * + * Just iterate over flags without arguments here. */ for (nppPtr = pPtr; nppPtr->name && *nppPtr->name == '-'; nppPtr ++) { - /* just process flags without arguments here */ if (nppPtr->nrArgs > 0) continue; if (ch1 == nppPtr->name[1] && strncmp(argument, nppPtr->name, equalOffset) == 0 @@ -12806,10 +12807,16 @@ */ if (nppPtr->nrArgs == 0) { /* - * No argument exprected. Take value either from flag or + * No argument expected. Take value either from flag or * use constant ONE. - */ - valueObj = valueInArgument ? Tcl_NewStringObj(valueInArgument+1,-1) : NsfGlobalObjs[NSF_ONE]; + */ + if (valueInArgument) { + valueObj = Tcl_NewStringObj(valueInArgument+1,-1); + INCR_REF_COUNT(valueObj); + pcPtr->flags[j] |= NSF_PC_MUST_DECR; + } else { + valueObj = NsfGlobalObjs[NSF_ONE]; + } } else { /* * We expect one argument (currently, it has to be