From 7fa090fbeed5a9719ed0b2d2d09d3447e2b3406e Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 23 Jan 2012 21:17:02 +0000 Subject: Simplify the logic of setting the TCL_REG_NOTBOL flag. --- generic/tclCmdMZ.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index ab673d5..aed0022 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -264,8 +264,11 @@ Tcl_RegexpObjCmd( * start of the string unless the previous character is a newline. */ - if ((offset == 0) || ((offset > 0) && (offset < stringLength) && - (Tcl_GetUniChar(objPtr, offset-1) == (Tcl_UniChar)'\n'))) { + if (offset == 0) { + eflags = 0; + } else if (offset > stringLength) { + eflags = TCL_REG_NOTBOL; + } else if (Tcl_GetUniChar(objPtr, offset-1) == (Tcl_UniChar)'\n') { eflags = 0; } else { eflags = TCL_REG_NOTBOL; -- cgit v0.12