diff options
author | nijtmans <nijtmans> | 2010-05-19 08:23:09 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-05-19 08:23:09 (GMT) |
commit | 2bdf96f5608d4e27a76ad4080398df6885a6209a (patch) | |
tree | 31dbdbc468a888b7db0ce1c24b08964fe129d83b /generic/tclFileName.c | |
parent | 0f67d4faac5372c251720b6f818d319392f0b868 (diff) | |
download | tcl-2bdf96f5608d4e27a76ad4080398df6885a6209a.zip tcl-2bdf96f5608d4e27a76ad4080398df6885a6209a.tar.gz tcl-2bdf96f5608d4e27a76ad4080398df6885a6209a.tar.bz2 |
Don't use arrays of length 1, just use a single element then, it makes code more readable.
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 28c0ab8..7c4a360 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.102 2010/03/05 14:34:04 dkf Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.103 2010/05/19 08:23:09 nijtmans Exp $ */ #include "tclInt.h" @@ -1983,19 +1983,19 @@ TclGlob( for (i = 0; i< objc; i++) { int len; const char *oldStr = Tcl_GetStringFromObj(objv[i], &len); - Tcl_Obj *elems[1]; + Tcl_Obj *elem; if (len == prefixLen) { if ((pattern[0] == '\0') || (strchr(separators, pattern[0]) == NULL)) { - TclNewLiteralStringObj(elems[0], "."); + TclNewLiteralStringObj(elem, "."); } else { - TclNewLiteralStringObj(elems[0], "/"); + TclNewLiteralStringObj(elem, "/"); } } else { - elems[0] = Tcl_NewStringObj(oldStr+prefixLen, len-prefixLen); + elem = Tcl_NewStringObj(oldStr+prefixLen, len-prefixLen); } - Tcl_ListObjReplace(interp, filenamesObj, i, 1, 1, elems); + Tcl_ListObjReplace(interp, filenamesObj, i, 1, 1, &elem); } } |