summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2008-08-13 17:59:01 (GMT)
committerdgp <dgp@noemail.net>2008-08-13 17:59:01 (GMT)
commit95e5be08a92c12d025300bdf8e896636cc7961d7 (patch)
tree1d81445c8930c478ad91f18c9ff88f8b3806019f /generic/tclFileName.c
parentd1f1796ca325690bfd9b04eab533fb91ada2eb10 (diff)
downloadtcl-95e5be08a92c12d025300bdf8e896636cc7961d7.zip
tcl-95e5be08a92c12d025300bdf8e896636cc7961d7.tar.gz
tcl-95e5be08a92c12d025300bdf8e896636cc7961d7.tar.bz2
* generic/tclFileName.c: Fix for errors handling -types {}
* tests/fileName.test: option to [glob]. [Bug 1750300] Thanks to Matthias Kraft and George Peter Staplin. FossilOrigin-Name: cc8e0dda9a9461f727ddbdd62d7813607c50b8d6
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 12a50e5..15c04d8 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclFileName.c,v 1.40.2.15 2006/10/03 18:20:33 dgp Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.40.2.16 2008/08/13 17:59:06 dgp Exp $
*/
#include "tclInt.h"
@@ -1774,6 +1774,9 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv)
* on an incompatible platform.
*/
Tcl_ListObjLength(interp, typePtr, &length);
+ if (length <= 0) {
+ goto skipTypes;
+ }
globTypes = (Tcl_GlobTypeData*) ckalloc(sizeof(Tcl_GlobTypeData));
globTypes->type = 0;
globTypes->perm = 0;
@@ -1879,6 +1882,7 @@ Tcl_GlobObjCmd(dummy, interp, objc, objv)
}
}
+ skipTypes:
/*
* Now we perform the actual glob below. This may involve joining
* together the pattern arguments, dealing with particular file types