Fix for failing exit command causes inginite loop

Added upstream patch: tcsh-6.21.00-000-failing-exit-command-causes-infinite-loop.patch
This commit is contained in:
Jan Macku 2019-10-25 14:57:36 +02:00
parent 2563b0440b
commit 0e2d31e279
2 changed files with 47 additions and 2 deletions

View File

@ -0,0 +1,42 @@
diff --git a/sh.c b/sh.c
index 4b5c624..dd87172 100644
--- a/sh.c
+++ b/sh.c
@@ -237,6 +237,7 @@ main(int argc, char **argv)
int nofile = 0;
volatile int nverbose = 0;
volatile int rdirs = 0;
+ volatile int exitcode = 0;
int quitit = 0;
Char *cp;
#ifdef AUTOLOGOUT
@@ -1390,6 +1391,12 @@ main(int argc, char **argv)
if (targinp) {
+ /* If this -c command caused an error before, skip processing */
+ if (reenter && arginp) {
+ exitcode = 1;
+ goto done;
+ }
+
arginp = SAVE(targinp);
/*
* we put the command into a variable
@@ -1422,6 +1429,7 @@ main(int argc, char **argv)
*/
process(setintr);
+done:
/*
* Mop-up.
*/
@@ -1443,7 +1451,7 @@ main(int argc, char **argv)
}
record();
exitstat();
- return (0);
+ return exitcode;
}
void

View File

@ -13,7 +13,7 @@
Name: tcsh
Summary: An enhanced version of csh, the C shell
Version: 6.21.00
Release: 2%{?dist}
Release: 3%{?dist}
License: BSD
URL: http://www.tcsh.org/
@ -42,7 +42,7 @@ BuildRequires: ncurses-devel
# Upstream patches -- official upstream patches released by upstream since the
# ---------------- last rebase that are necessary for any reason:
Patch000: tcsh-6.21.00-000-failing-exit-command-causes-infinite-loop.patch
# Downstream patches -- these should be always included when doing rebase:
# ------------------
@ -176,6 +176,9 @@ fi
# =============================================================================
%changelog
* Fri Oct 25 2019 Jan Macku <jamacku@redhat.com> - 6.21.00-3
- Added upstream patch to fix infinite loop caused by exit command
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.21.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild