diff options
author | hobbs <hobbs@noemail.net> | 2000-03-30 04:36:09 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2000-03-30 04:36:09 (GMT) |
commit | 79acf4143b91b7505f32e41e84c3664e4b14a2d6 (patch) | |
tree | 6b5f76b81d605204fdd5800eab13e5da6f72abeb /generic/tclClock.c | |
parent | e57d523765ab57b3ede9686e23085a6e4fcbfe52 (diff) | |
download | tcl-79acf4143b91b7505f32e41e84c3664e4b14a2d6.zip tcl-79acf4143b91b7505f32e41e84c3664e4b14a2d6.tar.gz tcl-79acf4143b91b7505f32e41e84c3664e4b14a2d6.tar.bz2 |
* generic/tclCompile.c (TclCleanupByteCode): made ByteCode cleanup
more aware of TCL_BYTECODE_PRECOMPILED flagged structs (gen'd by
tbcload), to correctly clean them up.
* generic/tclClock.c (FormatClock): moved check for empty format
earlier, commented 0 result return value
FossilOrigin-Name: 95a7cc28319fc286bba482496238fd3fd67c0ca2
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r-- | generic/tclClock.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index b155b4d..8b2bc53 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -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: tclClock.c,v 1.8 2000/01/26 03:37:40 hobbs Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.9 2000/03/30 04:36:11 hobbs Exp $ */ #include "tcl.h" @@ -282,6 +282,13 @@ FormatClock(interp, clockVal, useGMT, format) Tcl_MutexUnlock(&clockMutex); #endif + /* + * If the user gave us -format "", just return now + */ + if (*format == '\0') { + return TCL_OK; + } + #ifndef HAVE_TM_ZONE /* * This is a kludge for systems not having the timezone string in @@ -340,7 +347,14 @@ FormatClock(interp, clockVal, useGMT, format) tzset(); } #endif - if ((result == 0) && (*format != '\0')) { + + if (result == 0) { + /* + * A zero return is the error case (can also mean the strftime + * didn't get enough space to write into). We know it doesn't + * mean that we wrote zero chars because the check for an empty + * format string is above. + */ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "bad format string \"", format, "\"", (char *) NULL); return TCL_ERROR; |