From 8e76bda8c43c6aa4b6b93bd8593142c9aa9bc1e0 Mon Sep 17 00:00:00 2001
From: silvioprog <silvioprog@gmail.com>
Date: Mon, 18 Apr 2016 12:07:47 -0300
Subject: [PATCH 1/1] Fix maskutils problem.

---
 packages/fcl-base/src/maskutils.pp | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/packages/fcl-base/src/maskutils.pp b/packages/fcl-base/src/maskutils.pp
index db63d6d..0207e01 100644
--- a/packages/fcl-base/src/maskutils.pp
+++ b/packages/fcl-base/src/maskutils.pp
@@ -335,19 +335,15 @@ begin
   DebugLn(['DoArbitrary',',Position=',Position]);
  {$endif}
   Include(State,stArbitrary);
-  if Required then
-    begin
-      if Position > Length(SourceVal) then  RaiseError;
-    end
+  if SourcePosition <= Length(SourceVal) then
+    EvaluateExit
   else
-    begin
-      if Position > Length(SourceVal) then  EvaluateMissing
-      else
-        EvaluateExit;
-    end;
+    if Required then
+      RaiseError
+    else
+      EvaluateMissing;
 end;
 
-
 procedure TMaskUtils.DoNumeric(Required : Boolean);
 begin
  {$ifdef DebugMaskUtils}
@@ -386,7 +382,7 @@ begin
  {$ifdef DebugMaskUtils}
   DebugLn(['DoTime',',Position=',Position]);
  {$endif}
-  ExitVal := ExitVal + TimeSeparator;
+  ExitVal := ExitVal + DefaultFormatSettings.TimeSeparator;
 end;
 
 
@@ -396,7 +392,7 @@ begin
  {$ifdef DebugMaskUtils}
   DebugLn(['DoDate',',Position=',Position]);
  {$endif}
-  ExitVal := ExitVal + DateSeparator;
+  ExitVal := ExitVal + DefaultFormatSettings.DateSeparator;
 end;
 
 function TMaskUtils.GetInputMask: string;
-- 
1.9.5.msysgit.0

