From 5a5bf314e81c24f22f122777c5fffb34561b912e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 25 Mar 2012 02:21:08 -0700 Subject: Replace \0 by found text in regular expressions search --- src/Document.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index fae97856a..0c73024d5 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2194,7 +2194,7 @@ const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text, unsigned int lenResult = 0; for (int i = 0; i < *length; i++) { if (text[i] == '\\') { - if (text[i + 1] >= '1' && text[i + 1] <= '9') { + if (text[i + 1] >= '0' && text[i + 1] <= '9') { unsigned int patNum = text[i + 1] - '0'; lenResult += search.eopat[patNum] - search.bopat[patNum]; i++; @@ -2220,7 +2220,7 @@ const char *BuiltinRegex::SubstituteByPosition(Document *doc, const char *text, char *o = substituted; for (int j = 0; j < *length; j++) { if (text[j] == '\\') { - if (text[j + 1] >= '1' && text[j + 1] <= '9') { + if (text[j + 1] >= '0' && text[j + 1] <= '9') { unsigned int patNum = text[j + 1] - '0'; unsigned int len = search.eopat[patNum] - search.bopat[patNum]; if (search.pat[patNum]) // Will be null if try for a match that did not occur -- cgit v1.2.3