summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclPkg.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 645e262..043edd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-27 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclPkg.c (CompareVersion): Flatten strcmp() results to
+ {-1, 0, 1} to match expectations of CompareVersion() callers.
+
2006-09-27 Miguel Sofer <msofer@users.sf.net>
* generic/regc_color.c (singleton):
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index ab4c397..25c044c 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.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: tclPkg.c,v 1.17 2006/09/27 20:22:40 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclPkg.c,v 1.18 2006/09/28 15:10:25 dgp Exp $
*
* TIP #268.
* Heavily rewritten to handle the extend version numbers, and extended
@@ -1391,6 +1391,7 @@ CompareVersions(
o2 = *e2 ; *e2 = '\0';
res = strcmp (s1, s2);
+ res = (res < 0) ? -1 : (res ? 1 : 0);
*e1 = o1;
*e2 = o2;