summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index b765a0f..07b497b 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3977,6 +3977,46 @@ TclIndexInvalidError (
}
/*
+ *------------------------------------------------------------------------
+ *
+ * TclCommandWordLimitErrpr --
+ *
+ * Generates an error message limit on number of command words exceeded.
+ *
+ * Results:
+ * Always return TCL_ERROR.
+ *
+ * Side effects:
+ * If interp is not-NULL, an error message is stored in it.
+ *
+ *------------------------------------------------------------------------
+ */
+int
+TclCommandWordLimitError (
+ Tcl_Interp *interp, /* May be NULL */
+ Tcl_Size count) /* If <= 0, "unknown" */
+{
+ if (interp) {
+ if (count > 0) {
+ Tcl_SetObjResult(
+ interp,
+ Tcl_ObjPrintf("Number of words (%" TCL_SIZE_MODIFIER
+ "d) in command exceeds limit %" TCL_SIZE_MODIFIER
+ "d.",
+ count,
+ (Tcl_Size)INT_MAX));
+ }
+ else {
+ Tcl_SetObjResult(interp,
+ Tcl_ObjPrintf("Number of words in command exceeds "
+ "limit %" TCL_SIZE_MODIFIER "d.",
+ (Tcl_Size)INT_MAX));
+ }
+ }
+ return TCL_ERROR; /* Always */
+}
+
+/*
*----------------------------------------------------------------------
*
* ClearHash --