summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-09-28 15:10:23 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-09-28 15:10:23 (GMT)
commit023f68bcd4d6661b4a1ac20e9c90cc212f1901cc (patch)
tree7ba3ca2b54f62d5618b9bdd28c00b12b4dcc47f0
parent542215ff7f7979ba967987a746cfa8dd723425c6 (diff)
downloadtcl-023f68bcd4d6661b4a1ac20e9c90cc212f1901cc.zip
tcl-023f68bcd4d6661b4a1ac20e9c90cc212f1901cc.tar.gz
tcl-023f68bcd4d6661b4a1ac20e9c90cc212f1901cc.tar.bz2
* generic/tclPkg.c (CompareVersion): Flatten strcmp() results to
{-1, 0, 1} to match expectations of CompareVersion() callers.
-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;