summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index b64b6cc..43b074c 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -19,7 +19,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.16 2000/01/26 21:36:35 ericm Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.17 2000/03/27 22:18:56 hobbs Exp $
*/
#include "tclInt.h"
@@ -956,6 +956,20 @@ Tcl_Export(interp, namespacePtr, pattern, resetListFirst)
}
/*
+ * Make sure that we don't already have the pattern in the array
+ */
+ if (nsPtr->exportArrayPtr != NULL) {
+ for (i = 0; i < nsPtr->numExportPatterns; i++) {
+ if (strcmp(pattern, nsPtr->exportArrayPtr[i]) == 0) {
+ /*
+ * The pattern already exists in the list
+ */
+ return TCL_OK;
+ }
+ }
+ }
+
+ /*
* Make sure there is room in the namespace's pattern array for the
* new pattern.
*/