summaryrefslogtreecommitdiff
path: root/packages/regexpr
diff options
context:
space:
mode:
authormichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-02-15 13:18:23 +0000
committermichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-02-15 13:18:23 +0000
commitc379df494e4aafbf35175e75a127b9d71147e9b1 (patch)
tree1120e8f4e4a07116b9abb5cdb66ca47ac77c134c /packages/regexpr
parenta2700769d4b9848c23856f8a4bd801ed814cf878 (diff)
downloadfpc-c379df494e4aafbf35175e75a127b9d71147e9b1.tar.gz
* Fix bug ID 36603
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@44179 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/regexpr')
-rw-r--r--packages/regexpr/src/regexpr.pas14
1 files changed, 10 insertions, 4 deletions
diff --git a/packages/regexpr/src/regexpr.pas b/packages/regexpr/src/regexpr.pas
index a5dd6425fe..0a8f33f538 100644
--- a/packages/regexpr/src/regexpr.pas
+++ b/packages/regexpr/src/regexpr.pas
@@ -280,7 +280,8 @@ type
{$IFDEF UnicodeWordDetection}
FUseUnicodeWordDetection: boolean;
{$ENDIF}
-
+ FEmptyImputRaisesError : Boolean;
+
CharCheckers: TRegExprCharCheckerArray;
CharCheckerInfos: TRegExprCharCheckerInfos;
CheckerIndex_Word: byte;
@@ -616,6 +617,9 @@ type
property UseOsLineEndOnReplace: boolean read FUseOsLineEndOnReplace write SetUseOsLineEndOnReplace;
property SlowChecksSizeMax: integer read fSlowChecksSizeMax write fSlowChecksSizeMax;
+
+ // Raise error when input string is empty
+ Property EmptyImputRaisesError : Boolean Read FEmptyImputRaisesError Write FEmptyImputRaisesError;
end;
type
@@ -4176,7 +4180,8 @@ begin
// Check InputString presence
if fInputString = '' then
begin
- Error(reeNoInputStringSpecified);
+ if EmptyImputRaisesError then
+ Error(reeNoInputStringSpecified);
Exit;
end;
@@ -4288,7 +4293,7 @@ begin
end;
end; { of procedure TRegExpr.SetLineSeparators
-------------------------------------------------------------- }
-
+
procedure TRegExpr.SetLinePairedSeparator(const AStr: RegExprString);
begin
if Length(AStr) = 2 then
@@ -4389,7 +4394,8 @@ begin
Exit;
if fInputString = '' then
begin
- Error(reeNoInputStringSpecified);
+ if EmptyImputRaisesError then
+ Error(reeNoInputStringSpecified);
Exit;
end;
// Prepare for working