summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2007-04-15 18:59:31 (GMT)
committerKevin B Kenny <kennykb@acm.org>2007-04-15 18:59:31 (GMT)
commit9884845dfb273bf59b75b1d7f58b2de7afaf5863 (patch)
treeb0946b34be7ab6aa2fea8e8fc070c3436222dd9d
parent5a6b65068cccb6e5109ddd85bd447bffbbf2f335 (diff)
downloadtcl-9884845dfb273bf59b75b1d7f58b2de7afaf5863.zip
tcl-9884845dfb273bf59b75b1d7f58b2de7afaf5863.tar.gz
tcl-9884845dfb273bf59b75b1d7f58b2de7afaf5863.tar.bz2
* generic/tclCompCmds.c: added a cast to silence a compiler
error on VC2005. * library/clock.tcl: Restored unique-prefix matching of keywords on the [clock] command. [Bug 1690041] * tests/clock.test: Added rudimentary test cases for unique-prefix matching of keywords.
-rw-r--r--ChangeLog9
-rw-r--r--generic/tclCompCmds.c4
-rw-r--r--library/clock.tcl25
-rw-r--r--tests/clock.test10
4 files changed, 33 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 249a03e..451a0b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-04-15 Kevin B. Kenny <kennykb@acm.org>
+
+ * generic/tclCompCmds.c: added a cast to silence a compiler
+ error on VC2005.
+ * library/clock.tcl: Restored unique-prefix matching of keywords
+ on the [clock] command. [Bug 1690041]
+ * tests/clock.test: Added rudimentary test cases for unique-prefix
+ matching of keywords.
+
2007-04-14 Miguel Sofer <msofer@users.sf.net>
* generic/tclExecute.c: removed some code at INSTEXPAND_SKTOP that
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 8852f45..04f6bd5 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.107 2007/04/11 03:18:36 msofer Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.108 2007/04/15 18:59:34 kennykb Exp $
*/
#include "tclInt.h"
@@ -1440,7 +1440,7 @@ TclCompileForeachCmd(
memset(varcList, 0, numLists * sizeof(int));
varvList = (const char ***) TclStackAlloc(interp,
numLists * sizeof(const char **));
- memset(varvList, 0, numLists * sizeof(const char **));
+ memset((char*) varvList, 0, numLists * sizeof(const char **));
/*
* Break up each var list and set the varcList and varvList arrays. Don't
diff --git a/library/clock.tcl b/library/clock.tcl
index da4309c..d678a7c 100644
--- a/library/clock.tcl
+++ b/library/clock.tcl
@@ -13,7 +13,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.tcl,v 1.40 2007/03/09 01:09:00 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.41 2007/04/15 18:59:34 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -689,16 +689,16 @@ proc ::tcl::clock::format { args } {
foreach { flag value } [lreplace $args 0 0] {
set saw($flag) {}
switch -exact -- $flag {
- -format {
+ -f - -fo - -for - -form - -forma - -format {
set format $value
}
- -gmt {
+ -g - -gm - -gmt {
set gmt $value
}
- -locale {
+ -l - -lo - -loc - -loca - -local - -locale {
set locale $value
}
- -timezone {
+ -t - -ti - -tim - -time - -timez - -timezo - -timezon - -timezone {
set timezone $value
}
default {
@@ -1282,19 +1282,19 @@ proc ::tcl::clock::scan { args } {
foreach { flag value } [lreplace $args 0 0] {
set saw($flag) {}
switch -exact -- $flag {
- -base {
+ -b - -ba - -bas - -base {
set base $value
}
- -format {
+ -f - -fo - -for - -form - -forma - -format {
set format $value
}
- -gmt {
+ -g - -gm - -gmt {
set gmt $value
}
- -locale {
+ -l - -lo - -loc - -loca - -local - -locale {
set locale $value
}
- -timezone {
+ -t - -ti - -tim - -time - -timez - -timezo - -timezon - -timezone {
set timezone $value
}
default {
@@ -4404,12 +4404,13 @@ proc ::tcl::clock::add { clockval args } {
switch -exact -- $a {
- -gmt {
+ -g - -gm - -gmt {
set gmt $b
}
- -locale {
+ -l - -lo - -loc - -loca - -local - -locale {
set locale $b
}
+ -t - -ti - -tim - -time - -timez - -timezo - -timezon -
-timezone {
set timezone $b
}
diff --git a/tests/clock.test b/tests/clock.test
index f5f7d47..2006029 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.test,v 1.73 2007/03/09 02:26:05 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.74 2007/04/15 18:59:34 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -284,6 +284,10 @@ test clock-1.6 "clock format - gmt + timezone" {
list [catch {clock format 0 -timezone :GMT -gmt true} msg] $msg $::errorCode
} {1 {cannot use -gmt and -timezone in same call} {CLOCK gmtWithTimezone}}
+test clock-1.7 "clock format - option abbreviations" {
+ clock format 0 -g true -f "%Y-%m-%d"
+} 1970-01-01
+
# BEGIN testcases2
# Test formatting of Gregorian year, month, day, all formats
@@ -36436,6 +36440,10 @@ test clock-56.3 {use of zoneinfo, version 2, Y2038 compliance} {*}{
-result {2040-07-01 00:00:00 PDT}
}
+test clock-57.1 {clock scan - abbreviated options} {
+ clock scan 1970-01-01 -f %Y-%m-%d -g true
+} 0
+
# cleanup
namespace delete ::testClock