[packages/sap] - zero.patch is not needed - buffer *4 for utf-8 is sufficient

witekfl witekfl at pld-linux.org
Sun Jun 14 14:15:05 CEST 2026


commit 1bc1850a1a7c380d43cc18ee359c6a3fd98f034a
Author: Witold Filipczyk <witekfl at poczta.onet.pl>
Date:   Sun Jun 14 14:12:21 2026 +0200

    - zero.patch is not needed
    - buffer *4 for utf-8 is sufficient

 format.patch   |  2 +-
 sap-utf8.patch |  4 ++--
 sap.spec       |  2 --
 zero.patch     | 21 ---------------------
 4 files changed, 3 insertions(+), 26 deletions(-)
---
diff --git a/sap.spec b/sap.spec
index 2cc9768..6dcae9f 100644
--- a/sap.spec
+++ b/sap.spec
@@ -14,7 +14,6 @@ Patch2:		%{name}-utf8.patch
 Patch3:		format.patch
 Patch4:		rettype.patch
 Patch5:		ctype.patch
-Patch6:		zero.patch
 URL:		http://www.terravista.pt/Mussulo/1345/sap/
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -32,7 +31,6 @@ Słownik polsko-angielski i angielsko-polski.
 %patch -P3 -p1
 %patch -P4 -p1
 %patch -P5 -p1
-%patch -P6 -p1
 
 %build
 cd src
diff --git a/format.patch b/format.patch
index 999f0d8..8a73f47 100644
--- a/format.patch
+++ b/format.patch
@@ -14,7 +14,7 @@ diff -up sap-0.2/src/charfilter.c.old sap-0.2/src/charfilter.c
 +        retcode=fputs(my_tempy2, fd);
  #else
          if (utf8) {
-             char utf8_chars[8192*8];
+             char utf8_chars[8192*4];
 @@ -45,9 +45,9 @@ int alt_fprintf(int asciionly_mode, FILE
              iconv(cd, &buf, &length, &koniec, &length_utf8);
              iconv_close(cd);
diff --git a/sap-utf8.patch b/sap-utf8.patch
index af1bf78..e545e60 100644
--- a/sap-utf8.patch
+++ b/sap-utf8.patch
@@ -21,11 +21,11 @@ diff -Nru sap-0.2/src/charfilter.c sap-0.2.utf8/src/charfilter.c
  #else
 -        retcode=fprintf(fd, my_tempy1);
 +        if (utf8) {
-+            char utf8_chars[8192*8];
++            char utf8_chars[8192*4];
 +            char *koniec=utf8_chars;
 +            char *buf=my_tempy1;
 +            size_t length=strlen(my_tempy1);
-+            size_t length_utf8=8192*8;
++            size_t length_utf8=8192*4;
 +            iconv_t cd=iconv_open("UTF-8", "ISO-8859-2");
 +
 +            iconv(cd, &buf, &length, &koniec, &length_utf8);
diff --git a/zero.patch b/zero.patch
deleted file mode 100644
index 44d94cf..0000000
--- a/zero.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -up sap-0.2/src/charfilter.c.old sap-0.2/src/charfilter.c
---- sap-0.2/src/charfilter.c.old	2026-06-13 18:12:16.743792859 +0200
-+++ sap-0.2/src/charfilter.c	2026-06-13 18:12:56.331456608 +0200
-@@ -35,7 +35,7 @@ int alt_fprintf(int asciionly_mode, FILE
-         retcode=fputs(my_tempy2, fd);
- #else
-         if (utf8) {
--            char utf8_chars[8192*8];
-+            char utf8_chars[8192*8]={0};
-             char *koniec=utf8_chars;
-             char *buf=my_tempy1;
-             size_t length=strlen(my_tempy1);
-@@ -44,7 +44,7 @@ int alt_fprintf(int asciionly_mode, FILE
- 
-             iconv(cd, &buf, &length, &koniec, &length_utf8);
-             iconv_close(cd);
--            *koniec='\0';
-+            //*koniec='\0';
-             retcode=fputs(utf8_chars, fd);
-         } else
-             retcode=fputs(my_tempy1, fd);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/sap.git/commitdiff/1bc1850a1a7c380d43cc18ee359c6a3fd98f034a



More information about the pld-cvs-commit mailing list