Browse Source

DateTimeToString: do not write #0 separators

(cherry picked from commit a55794d80d6f8af398d44f26c94b7abba55a6634)
Ondrej Pokorny 4 years ago
parent
commit
0826cb24f0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rtl/objpas/sysutils/dati.inc

+ 2 - 2
rtl/objpas/sysutils/dati.inc

@@ -1078,8 +1078,8 @@ var
           else
           else
             raise EConvertError.Create('Illegal character in format string');
             raise EConvertError.Create('Illegal character in format string');
         end ;
         end ;
-        '/': StoreStr(@FormatSettings.DateSeparator, 1);
-        ':': StoreStr(@FormatSettings.TimeSeparator, 1);
+        '/': if FormatSettings.DateSeparator<>#0 then StoreStr(@FormatSettings.DateSeparator, 1);
+        ':': if FormatSettings.TimeSeparator<>#0 then StoreStr(@FormatSettings.TimeSeparator, 1);
         '[': if (fdoInterval in Options) then isInterval := true else StoreStr(FormatCurrent, 1);
         '[': if (fdoInterval in Options) then isInterval := true else StoreStr(FormatCurrent, 1);
         ']': if (fdoInterval in Options) then isInterval := false else StoreStr(FormatCurrent, 1);
         ']': if (fdoInterval in Options) then isInterval := false else StoreStr(FormatCurrent, 1);
         ' ', 'C', 'D', 'H', 'M', 'N', 'S', 'T', 'Y', 'Z', 'F' {$IFDEF MSWindows}, 'G', 'E'{$ENDIF MSWindows} :
         ' ', 'C', 'D', 'H', 'M', 'N', 'S', 'T', 'Y', 'Z', 'F' {$IFDEF MSWindows}, 'G', 'E'{$ENDIF MSWindows} :