summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-01-23 21:17:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-01-23 21:17:02 (GMT)
commit7d0fcc8ac4010c70dc7aa22cd9f183a50f362626 (patch)
tree827d267066cbaa8ddfa91edf3d89b7061d950bfd
parentaeb5c0bbbc58961750c494fd869dfa44bc2a4369 (diff)
downloadtcl-7d0fcc8ac4010c70dc7aa22cd9f183a50f362626.zip
tcl-7d0fcc8ac4010c70dc7aa22cd9f183a50f362626.tar.gz
tcl-7d0fcc8ac4010c70dc7aa22cd9f183a50f362626.tar.bz2
Simplify the logic of setting the TCL_REG_NOTBOL flag.
-rw-r--r--generic/tclCmdMZ.c7
1 files 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;