[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#987032: cqrlog: Importing ADIF-logs results in 0 byte logs



Control: tag -1 patch

Attached patch to go in d/patches.

Patch to fix Debian#987032: cqrlog: Importing ADIF-logs results in 0 byte logs - https://bugs.debian.org/987032
Applies upstream commits:
    42d1ad402affd0af0f3087562c101fc34940ffc5
    Original_Author: Petr Hlozek <petr@ok2cqr.com>
    Date:   Sun Feb 7 07:19:57 2021 +0100

    fix: workaround for 'TRegExpr exec: empty input string' error in fpc compiler
Author: donfede@casagrau.org
diff --git a/src/fAdifImport.pas b/src/fAdifImport.pas
index 2481086..934b158 100644
--- a/src/fAdifImport.pas
+++ b/src/fAdifImport.pas
@@ -420,8 +420,12 @@ begin
     d.IOTA  := UpperCase(d.IOTA);
     d.NAME  := Copy(d.NAME, 1 ,40);
     d.QTH   := Copy(d.QTH, 1, 60);
-    d.DARC_DOK := ReplaceRegExpr('Ø', d.DARC_DOK, '0', True);
-    d.DARC_DOK := LeftStr(Uppercase(ReplaceRegExpr('[^a-zA-Z0-9]',d.DARC_DOK, '', True)), 12);
+    //workaround for 'TRegExpr exec: empty input string' error in fpc compiler
+    if (trim(d.DARC_DOK) <> '') then
+    begin
+      d.DARC_DOK := ReplaceRegExpr('Ø', d.DARC_DOK, '0', True);
+      d.DARC_DOK := LeftStr(Uppercase(ReplaceRegExpr('[^a-zA-Z0-9]',d.DARC_DOK, '', True)), 12);
+    end;
 
     d.QSL_VIA := UpperCase(d.QSL_VIA);
     if Pos('QSL VIA',d.QSL_VIA) > 0 then

Attachment: signature.asc
Description: PGP signature


Reply to: