summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 471560d..d1174ab 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.160 2008/10/07 17:57:43 msofer Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.161 2008/10/14 19:26:59 dgp Exp $
*/
#include "tclInt.h"
@@ -2446,7 +2446,6 @@ Tcl_LrepeatObjCmd(
{
int elementCount, i, totalElems;
Tcl_Obj *listPtr, **dataArray;
- List *listRepPtr;
/*
* Check arguments for legality:
@@ -2496,9 +2495,11 @@ Tcl_LrepeatObjCmd(
*/
listPtr = Tcl_NewListObj(totalElems, NULL);
- listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
- listRepPtr->elemCount = elementCount*objc;
- dataArray = &listRepPtr->elements;
+ if (totalElems) {
+ List *listRepPtr = listPtr->internalRep.twoPtrValue.ptr1;
+ listRepPtr->elemCount = elementCount*objc;
+ dataArray = &listRepPtr->elements;
+ }
/*
* Set the elements. Note that we handle the common degenerate case of a