diff options
author | dgp <dgp@users.sourceforge.net> | 2012-01-23 21:21:51 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-01-23 21:21:51 (GMT) |
commit | 8df49a02756833a2aefa9dcba660412037e4f1c4 (patch) | |
tree | b7e1589d52846e09886eafba855aba2e9e9b3156 | |
parent | 9934f6610852f9acc2459f7303a77ef04bbfb02e (diff) | |
parent | 7fa090fbeed5a9719ed0b2d2d09d3447e2b3406e (diff) | |
download | tcl-8df49a02756833a2aefa9dcba660412037e4f1c4.zip tcl-8df49a02756833a2aefa9dcba660412037e4f1c4.tar.gz tcl-8df49a02756833a2aefa9dcba660412037e4f1c4.tar.bz2 |
Simplify the logic of setting the TCL_REG_NOTBOL flag.
-rw-r--r-- | generic/tclCmdMZ.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index e159f67..1ef6fa8 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -282,8 +282,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; |