aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2009-03-02 12:06:13 +0000
committernyamatongwe <unknown>2009-03-02 12:06:13 +0000
commitbec2a01c474e70f13576dc77cc703115bef87dc3 (patch)
tree3a88ed9a37068656cbe2bd02b644f751ccb1718b
parent3b9d55b49a68f86b39edaa5b551a5e772cfaaa25 (diff)
downloadscintilla-mirror-bec2a01c474e70f13576dc77cc703115bef87dc3.tar.gz
Bug #2648342 Bug in LexPerl string comparison fixed.
-rw-r--r--src/LexPerl.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx
index 4b7c9878a..4853460bf 100644
--- a/src/LexPerl.cxx
+++ b/src/LexPerl.cxx
@@ -247,8 +247,9 @@ static bool styleCheckSubPrototype(Accessor &styler, unsigned int bk)
static bool isMatch(const char *sref, char *s)
{
// match per-line delimiter - must kill trailing CR if CRLF
- if (s[strlen(s) - 1] == '\r')
- s[strlen(s) - 1] = '\0';
+ int i = strlen(s);
+ if (i != 0 && s[i - 1] == '\r')
+ s[i - 1] = '\0';
return (strcmp(sref, s) == 0);
}