summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-08-13 17:59:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-08-13 17:59:02 (GMT)
commit7740c0fd63a6952846fab475fb23429ffbc85292 (patch)
tree1d81445c8930c478ad91f18c9ff88f8b3806019f /generic/tclFileName.c
parent8db6611c4c31932335de5a0c12de2a48830859b4 (diff)
downloadtcl-7740c0fd63a6952846fab475fb23429ffbc85292.zip
tcl-7740c0fd63a6952846fab475fb23429ffbc85292.tar.gz
tcl-7740c0fd63a6952846fab475fb23429ffbc85292.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.
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