summaryrefslogtreecommitdiffstats
path: root/package/busybox/busybox-1.13.3-ash.patch
blob: 761af28d51d4ef065a7e86200519798be31ecd67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- busybox-1.13.3/shell/ash.c	Thu Feb 26 12:46:55 2009
+++ busybox-1.13.3-ash/shell/ash.c	Thu Mar 19 04:34:01 2009
@@ -376,7 +376,6 @@
 onsig(int signo)
 {
 	gotsig[signo - 1] = 1;
-	pendingsig = signo;
 
 	if (/* exsig || */ (signo == SIGINT && !trap[SIGINT])) {
 		if (!suppressint) {
@@ -384,6 +383,8 @@
 			raise_interrupt(); /* does not return */
 		}
 		intpending = 1;
+	} else {
+		pendingsig = signo;
 	}
 }
 
@@ -13692,15 +13693,20 @@
 	}
  state3:
 	state = 4;
-	if (minusc)
+	if (minusc) {
+		/* evalstring pushes parsefile stack.
+		 * Ensure we don't falsely claim that 0 (stdin)
+		 * is one of stacked source fds */
+		if (!sflag)
+			g_parsefile->fd = -1;
 		evalstring(minusc, 0);
+	}
 
 	if (sflag || minusc == NULL) {
 #if ENABLE_FEATURE_EDITING_SAVEHISTORY
 		if (iflag) {
 			const char *hp = lookupvar("HISTFILE");
-
-			if (hp != NULL)
+			if (hp)
 				line_input_state->hist_file = hp;
 		}
 #endif