Allow printing credits buffer larger than 4k
authorOndřej Surý <ondrej@sury.org>
Sat, 3 Apr 2021 14:12:43 +0000 (16:12 +0200)
committerOndřej Surý <ondrej@debian.org>
Mon, 2 Dec 2024 07:33:26 +0000 (08:33 +0100)
Gbp-Pq: Name 0039-Allow-printing-credits-buffer-larger-than-4k.patch

ext/standard/credits.c

index 98dfe93928e7ab0d90f1f4b5261ed7960a5c27b1..8ea0f5b9a3d70ee75de69d49aefa07e9ffc7e5f4 100644 (file)
@@ -233,7 +233,14 @@ PHPAPI void php_print_packaging_credits(int flag, int top) /* {{{ */
 
                                if (bytes > 0) {
                                        PUTS(" and is made available exclusively for ");
-                                       PUTS(buf);
+                                       do {
+                                               PUTS(buf);
+
+                                               bytes = read(fd, buf, sizeof(buf) - 1);
+                                               if (bytes > 0) {
+                                                       buf[bytes] = '\0';
+                                               }
+                                       } while (bytes > 0);
                                } else {
                                        PUTS(". This service is run together with Ondřej Surý, "
                                                 "that's why a small subset of the PHP LTS packages "
@@ -248,7 +255,14 @@ PHPAPI void php_print_packaging_credits(int flag, int top) /* {{{ */
                                        );
                                if (bytes > 0) {
                                        PUTS(" and is made available exclusively for ");
-                                       PUTS(buf);
+                                       do {
+                                               PUTS(buf);
+
+                                               bytes = read(fd, buf, sizeof(buf) - 1);
+                                               if (bytes > 0) {
+                                                       buf[bytes] = '\0';
+                                               }
+                                       } while (bytes > 0);
                                } else {
                                        PUTS(". This service is run together with Ondřej Surý, "
                                                 "that's why a small subset of the PHP LTS packages "