summaryrefslogtreecommitdiff
path: root/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch')
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch
new file mode 100644
index 000000000000..e99d6f5941d6
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p18-musl.patch
@@ -0,0 +1,68 @@
+grobian@gentoo.org
+
+auto-flush on stdio is really a glibc feature AFAICT, so in order for
+musl to get prompts (and make the tool more bearable) just flush right
+after writing half a line
+
+--- mac-fdisk-0.1.orig/io.c 2022-06-01 19:37:08.000000000 +0200
++++ mac-fdisk-0.1.orig/io.c 2022-06-01 20:32:12.000000000 +0200
+@@ -151,7 +151,8 @@
+ int c;
+
+ flush_to_newline(0);
+- printf(prompt);
++ printf("%s", prompt);
++ fflush(NULL);
+
+ for (;;) {
+ c = getch();
+@@ -169,7 +170,8 @@
+ return 0;
+ } else {
+ flush_to_newline(0);
+- printf(prompt);
++ printf("%s", prompt);
++ fflush(NULL);
+ }
+ }
+ return -1;
+@@ -182,7 +184,8 @@
+ int c;
+
+ if (promptBeforeGet) {
+- printf(prompt);
++ printf("%s", prompt);
++ fflush(NULL);
+ }
+ for (;;) {
+ c = getch();
+@@ -192,7 +195,8 @@
+ } else if (c == ' ' || c == '\t') {
+ // skip blanks and tabs
+ } else if (c == '\n') {
+- printf(prompt);
++ printf("%s", prompt);
++ fflush(NULL);
+ } else {
+ *command = c;
+ return 1;
+@@ -217,7 +220,8 @@
+ // skip blanks and tabs
+ } else if (c == '\n') {
+ if (default_value < 0) {
+- printf(prompt);
++ printf("%s", prompt);
++ fflush(NULL);
+ } else {
+ ungetch(c);
+ *number = default_value;
+@@ -295,7 +307,8 @@
+ // skip blanks and tabs
+ } else if (c == '\n') {
+ if (reprompt) {
+- printf(prompt);
++ printf("%s", prompt);
++ fflush(NULL);
+ } else {
+ ungetch(c);
+ *string = NULL;