tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch added

'rm *' with 'rmstar' set should now work properly.

  Resolves: #1386129
This commit is contained in:
David Kaspar [Dee'Kej] 2016-11-29 10:30:05 +01:00
parent 4ed56412b9
commit abc3f0ef28
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,49 @@
From 75ccc1197d63d015348b9113ed8d9f7abace567e Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Mon, 28 Nov 2016 17:14:20 +0000
Subject: [PATCH] Fix type of read in prompt confirmation (eg. rmstar) (David
Kaspar)
---
Fixes | 1 +
sh.func.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Fixes b/Fixes
index c79dc38..1c2e183 100644
--- a/Fixes
+++ b/Fixes
@@ -1,3 +1,4 @@
+ 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar)
21. PR/471: Delay arginp parsing
20. V6.20.00 - 20161124
19. Don't resize the screen if it did not change size.
diff --git a/sh.func.c b/sh.func.c
index a866076..2118399 100644
--- a/sh.func.c
+++ b/sh.func.c
@@ -2734,16 +2734,18 @@ 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)) == sizeof(c))
continue;
return doit;
}
--
2.7.4

View File

@ -44,6 +44,7 @@ BuildRequires: ncurses-devel
# ---------------- last rebase that are necessary for any reason: # ---------------- last rebase that are necessary for any reason:
Patch000: tcsh-6.20.00-000-add-all-flags-for-gethost-build.patch Patch000: tcsh-6.20.00-000-add-all-flags-for-gethost-build.patch
Patch001: tcsh-6.20.00-001-delay-arginp-interpreting.patch Patch001: tcsh-6.20.00-001-delay-arginp-interpreting.patch
Patch002: tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch
# Downstream patches -- these should be always included when doing rebase: # Downstream patches -- these should be always included when doing rebase:
@ -174,6 +175,7 @@ fi
- Added multiple upstream patches: - Added multiple upstream patches:
tcsh-6.20.00-000-add-all-flags-for-gethost-build.patch tcsh-6.20.00-000-add-all-flags-for-gethost-build.patch
tcsh-6.20.00-001-delay-arginp-interpreting.patch tcsh-6.20.00-001-delay-arginp-interpreting.patch
tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch (bug #1386129)
* Mon Nov 28 2016 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 6.20.00-1 * Mon Nov 28 2016 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 6.20.00-1
- Rebase to tcsh-6.20.00 - Rebase to tcsh-6.20.00