cosmo: update unbourne patch

This commit is contained in:
Connor Olding 2022-10-10 13:07:41 -07:00
parent ccc5b88168
commit 2f50833941

View file

@ -1406,12 +1406,10 @@
}
static void dupredirect(union node *redir, int f) {
@@ -9148,13 +9204,13 @@
int i;
@@ -9149,12 +9205,12 @@
INTOFF;
rp = redirlist;
- for (i = 0; i < 10; i++) {
+ for (i = 0 ; i < 10 ; i++) {
for (i = 0; i < 10; i++) {
+ int closed;
+ if (rp->renamed[i] == EMPTY) continue;
+ closed = drop ? 1 : update_closed_redirs(i, rp->renamed[i]);
@ -1545,7 +1543,7 @@
{
char **envp;
static char ppid[32] = "PPID=";
@@ -10543,12 +10583,14 @@
@@ -10543,12 +10583,13 @@
static void exitreset() {
/* from eval.c: */
{
@ -1553,8 +1551,7 @@
- loopnest = 0;
if (savestatus >= 0) {
- exitstatus = savestatus;
+ if (exception == EXEXIT || evalskip == SKIPFUNCDEF)
+ exitstatus = savestatus;
+ if (exception == EXEXIT || evalskip == SKIPFUNCDEF) exitstatus = savestatus;
savestatus = -1;
}
+ evalskip = 0;
@ -1563,7 +1560,7 @@
}
/* from expand.c: */
{ ifsfree(); }
@@ -10561,6 +10603,43 @@
@@ -10561,6 +10602,42 @@
}
}
@ -1595,8 +1592,7 @@
+ if (*tp && **tp) { /* trap not NULL or SIG_IGN */
+ ckfree(*tp);
+ *tp = NULL;
+ if (tp != &trap[0])
+ setsignal(tp - trap);
+ if (tp != &trap[0]) setsignal(tp - trap);
+ }
+ }
+ trapcnt = 0;
@ -1607,7 +1603,7 @@
/*
* This routine is called when an error or an interrupt occurs in an
* interactive shell and control is returned to the main command loop.
@@ -10570,10 +10649,10 @@
@@ -10570,10 +10647,10 @@
{
/* clear input buffer */
basepf.lleft = basepf.nleft = 0;
@ -1620,16 +1616,13 @@
{
unwindlocalvars(0);
}
@@ -10815,11 +10894,17 @@
@@ -10815,11 +10892,14 @@
if (n == NEOF) {
if (!top || numeof >= 50) break;
if (!stoppedjobs()) {
- if (!Iflag) break;
+ if (!Iflag) {
+ if (iflag) {
+ outcslow('\n', out2);
+ flushout(out2);
+ }
+ if (iflag) outcslow('\n', out2);
+ break;
+ }
outstr("\nUse \"exit\" to leave shell.\n", out2);
@ -1640,7 +1633,7 @@
int i;
job_warning = (job_warning == 2) ? 1 : 0;
numeof = 0;
@@ -10899,17 +10984,16 @@
@@ -10899,17 +10979,16 @@
int main(int argc, char **argv) {
char *shinit;
volatile int state;
@ -1660,7 +1653,7 @@
reset();
if (e == EXINT) {
outcslow('\n', out2);
@@ -10926,7 +11010,7 @@
@@ -10926,7 +11005,7 @@
goto state4;
}
}