39 lines
1.1 KiB
Diff
39 lines
1.1 KiB
Diff
|
From 766c095e4c8c57aea196a1325e395f5d6162cdce Mon Sep 17 00:00:00 2001
|
||
|
From: "David Kaspar [Dee'Kej]" <dkaspar@redhat.com>
|
||
|
Date: Mon, 28 Nov 2016 17:48:29 +0100
|
||
|
Subject: [PATCH] Regression of 'rm *' when 'rmstar' is set fixed
|
||
|
|
||
|
This regression was introduced by commit: 858a705a79a5389
|
||
|
|
||
|
Signed-off-by: David Kaspar [Dee'Kej] <dkaspar@redhat.com>
|
||
|
---
|
||
|
sh.func.c | 7 ++++---
|
||
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
||
|
|
||
|
diff --git a/sh.func.c b/sh.func.c
|
||
|
index a866076..b0dfbc9 100644
|
||
|
--- a/sh.func.c
|
||
|
+++ b/sh.func.c
|
||
|
@@ -2734,16 +2734,17 @@ nlsclose(void)
|
||
|
int
|
||
|
getYN(const char *prompt)
|
||
|
{
|
||
|
- int doit, c;
|
||
|
+ int doit;
|
||
|
+ char c;
|
||
|
xprintf("%s", prompt);
|
||
|
flush();
|
||
|
- (void) force_read(SHIN, &c, 1);
|
||
|
+ (void) force_read(SHIN, &c, sizeof(c));
|
||
|
/*
|
||
|
* Perhaps we should use the yesexpr from the
|
||
|
* actual locale
|
||
|
*/
|
||
|
doit = (strchr(CGETS(22, 14, "Yy"), c) != NULL);
|
||
|
- while (c != '\n' && force_read(SHIN, &c, 1) == 1)
|
||
|
+ while (c != '\n' && force_read(SHIN, &c, sizeof(c)) == 1)
|
||
|
continue;
|
||
|
return doit;
|
||
|
}
|
||
|
--
|
||
|
2.7.4
|