From 023f68bcd4d6661b4a1ac20e9c90cc212f1901cc Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Sep 2006 15:10:23 +0000 Subject: * generic/tclPkg.c (CompareVersion): Flatten strcmp() results to {-1, 0, 1} to match expectations of CompareVersion() callers. --- ChangeLog | 5 +++++ generic/tclPkg.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 645e262..043edd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-09-27 Don Porter + + * generic/tclPkg.c (CompareVersion): Flatten strcmp() results to + {-1, 0, 1} to match expectations of CompareVersion() callers. + 2006-09-27 Miguel Sofer * 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; -- cgit v0.12