|
|
abc3f0e |
From 75ccc1197d63d015348b9113ed8d9f7abace567e Mon Sep 17 00:00:00 2001
|
|
|
abc3f0e |
From: christos <christos>
|
|
|
abc3f0e |
Date: Mon, 28 Nov 2016 17:14:20 +0000
|
|
|
abc3f0e |
Subject: [PATCH] Fix type of read in prompt confirmation (eg. rmstar) (David
|
|
|
abc3f0e |
Kaspar)
|
|
|
abc3f0e |
|
|
|
abc3f0e |
---
|
|
|
abc3f0e |
Fixes | 1 +
|
|
|
abc3f0e |
sh.func.c | 8 +++++---
|
|
|
abc3f0e |
2 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
abc3f0e |
|
|
|
abc3f0e |
diff --git a/Fixes b/Fixes
|
|
|
abc3f0e |
index c79dc38..1c2e183 100644
|
|
|
abc3f0e |
--- a/Fixes
|
|
|
abc3f0e |
+++ b/Fixes
|
|
|
abc3f0e |
@@ -1,3 +1,4 @@
|
|
|
abc3f0e |
+ 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar)
|
|
|
abc3f0e |
21. PR/471: Delay arginp parsing
|
|
|
abc3f0e |
20. V6.20.00 - 20161124
|
|
|
abc3f0e |
19. Don't resize the screen if it did not change size.
|
|
|
abc3f0e |
diff --git a/sh.func.c b/sh.func.c
|
|
|
abc3f0e |
index a866076..2118399 100644
|
|
|
abc3f0e |
--- a/sh.func.c
|
|
|
abc3f0e |
+++ b/sh.func.c
|
|
|
abc3f0e |
@@ -2734,16 +2734,18 @@ nlsclose(void)
|
|
|
abc3f0e |
int
|
|
|
abc3f0e |
getYN(const char *prompt)
|
|
|
abc3f0e |
{
|
|
|
abc3f0e |
- int doit, c;
|
|
|
abc3f0e |
+ int doit;
|
|
|
abc3f0e |
+ char c;
|
|
|
abc3f0e |
+
|
|
|
abc3f0e |
xprintf("%s", prompt);
|
|
|
abc3f0e |
flush();
|
|
|
abc3f0e |
- (void) force_read(SHIN, &c, 1);
|
|
|
abc3f0e |
+ (void) force_read(SHIN, &c, sizeof(c));
|
|
|
abc3f0e |
/*
|
|
|
abc3f0e |
* Perhaps we should use the yesexpr from the
|
|
|
abc3f0e |
* actual locale
|
|
|
abc3f0e |
*/
|
|
|
abc3f0e |
doit = (strchr(CGETS(22, 14, "Yy"), c) != NULL);
|
|
|
abc3f0e |
- while (c != '\n' && force_read(SHIN, &c, 1) == 1)
|
|
|
abc3f0e |
+ while (c != '\n' && force_read(SHIN, &c, sizeof(c)) == sizeof(c))
|
|
|
abc3f0e |
continue;
|
|
|
abc3f0e |
return doit;
|
|
|
abc3f0e |
}
|
|
|
abc3f0e |
--
|
|
|
abc3f0e |
2.7.4
|
|
|
abc3f0e |
|