From abc3f0ef2843a8bd1abfcf7a8d062b9eeda1d01b Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Tue, 29 Nov 2016 10:30:05 +0100 Subject: [PATCH] tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch added 'rm *' with 'rmstar' set should now work properly. Resolves: #1386129 --- ...0-002-type-of-read-in-prompt-confirm.patch | 49 +++++++++++++++++++ tcsh.spec | 2 + 2 files changed, 51 insertions(+) create mode 100644 tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch diff --git a/tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch b/tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch new file mode 100644 index 0000000..954bb6a --- /dev/null +++ b/tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch @@ -0,0 +1,49 @@ +From 75ccc1197d63d015348b9113ed8d9f7abace567e Mon Sep 17 00:00:00 2001 +From: 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 + diff --git a/tcsh.spec b/tcsh.spec index f5add48..70245f7 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -44,6 +44,7 @@ BuildRequires: ncurses-devel # ---------------- last rebase that are necessary for any reason: Patch000: tcsh-6.20.00-000-add-all-flags-for-gethost-build.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: @@ -174,6 +175,7 @@ fi - Added multiple upstream patches: 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-002-type-of-read-in-prompt-confirm.patch (bug #1386129) * Mon Nov 28 2016 David Kaspar [Dee'Kej] - 6.20.00-1 - Rebase to tcsh-6.20.00