diff options
Diffstat (limited to 'generic/tclPkg.c')
-rw-r--r-- | generic/tclPkg.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 5cb1818..11211d9 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPkg.c,v 1.4 1999/04/16 00:46:51 stanton Exp $ + * RCS: @(#) $Id: tclPkg.c,v 1.5 1999/09/21 04:20:40 hobbs Exp $ */ #include "tclInt.h" @@ -871,16 +871,19 @@ CheckVersion(interp, string) * by dots. */ { char *p = string; - + char prevChar; + if (!isdigit(UCHAR(*p))) { /* INTL: digit */ goto error; } - for (p++; *p != 0; p++) { - if (!isdigit(UCHAR(*p)) && (*p != '.')) { /* INTL: digit */ + for (prevChar = *p, p++; *p != 0; p++) { + if (!isdigit(UCHAR(*p)) && + ((*p != '.') || (prevChar == '.'))) { /* INTL: digit */ goto error; } + prevChar = *p; } - if (p[-1] != '.') { + if (prevChar != '.') { return TCL_OK; } |