pgbackrest.git / summary / log / commit / refs
commit 507a58460e9c33361baf3f1cbf2b95c9cb0dd5ae
Author: David Steele <david@pgmasters.net>
Date: Sat Feb 29 12:52:54 2020 +0000
Minor adjustments to common prefix code updated in 8ec41efb.
src/common/regExp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/common/regExp.c b/src/common/regExp.c
index 1fe93e66f..4d91b9935 100644
--- a/src/common/regExp.c
+++ b/src/common/regExp.c
@@ -233,17 +233,17 @@ regExpPrefix(const String *expression)
// Will there be any characters in the prefix?
if (expressionIdx > 1)
{
- // Search again and make sure there is not another begin anchor. If so we won't be able to use the prefix
+ // Search the rest of the string for another begin anchor
unsigned int anchorIdx = expressionIdx;
- for (anchorIdx = 1; anchorIdx < expressionSize; anchorIdx++)
+ for (; anchorIdx < expressionSize; anchorIdx++)
{
// [^ and \^ are not begin anchors
if (expressionZ[anchorIdx] == '^' && expressionZ[anchorIdx - 1] != '[' && expressionZ[anchorIdx - 1] != '\\')
break;
}
- // If another begin anchor was not found then return the prefix
+ // If no other begin anchor was found then the prefix is usable
if (anchorIdx == expressionSize)
result = strSubN(expression, 1, expressionIdx - 1);
}
[parent: 8ec41efb04ee]