From 1c4042062be55823ed8fe5e9d0f86e88d190b88d Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 6 Jun 2000 19:34:52 +0000 Subject: * generic/tclExecute.c (TclExecuteByteCode INST_STR_CMP): added test of iResult return from memcmp, as memcmp isn't required to return only -1,0,1. --- generic/tclExecute.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 88b5299..782ea7d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.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: tclExecute.c,v 1.13 2000/05/26 08:53:42 hobbs Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.14 2000/06/06 19:34:52 hobbs Exp $ */ #include "tclInt.h" @@ -1814,6 +1814,10 @@ TclExecuteByteCode(interp, codePtr) (size_t) ((s1len < s2len) ? s1len : s2len)); if (iResult == 0) { iResult = s1len - s2len; + } else if (iResult < 0) { + iResult = -1; + } else { + iResult = 1; } PUSH_OBJECT(Tcl_NewIntObj(iResult)); -- cgit v0.12