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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
* Compiled with -Wall, fixed some gcc warnings.
Index: pdksh-5.2.14/c_ksh.c
===================================================================
--- pdksh-5.2.14.orig/c_ksh.c 2008-04-15 20:49:47.000000000 +0200
+++ pdksh-5.2.14/c_ksh.c 2008-04-15 20:51:49.000000000 +0200
@@ -1110,13 +1110,14 @@
return 1;
}
wp += builtin_opt.optind;
- if (!*wp)
+ if (!*wp) {
if (j_jobs((char *) 0, flag, nflag))
rv = 1;
- else
+ } else {
for (; *wp; wp++)
if (j_jobs(*wp, flag, nflag))
rv = 1;
+ }
return rv;
}
Index: pdksh-5.2.14/io.c
===================================================================
--- pdksh-5.2.14.orig/io.c 2008-04-15 20:49:47.000000000 +0200
+++ pdksh-5.2.14/io.c 2008-04-15 20:51:49.000000000 +0200
@@ -297,11 +297,12 @@
if (fd < FDBASE) {
nfd = ksh_dupbase(fd, FDBASE);
- if (nfd < 0)
+ if (nfd < 0) {
if (errno == EBADF)
return -1;
else
errorf("too many files open in shell");
+ }
if (!noclose)
close(fd);
} else
Index: pdksh-5.2.14/jobs.c
===================================================================
--- pdksh-5.2.14.orig/jobs.c 2008-04-15 20:49:47.000000000 +0200
+++ pdksh-5.2.14/jobs.c 2008-04-15 20:51:49.000000000 +0200
@@ -1566,11 +1566,12 @@
break;
}
- if (how != JP_SHORT)
+ if (how != JP_SHORT) {
if (p == j->proc_list)
shf_fprintf(shf, "[%d] %c ", j->job, jobchar);
else
shf_fprintf(shf, "%s", filler);
+ }
if (how == JP_LONG)
shf_fprintf(shf, "%5d ", p->pid);
Index: pdksh-5.2.14/lex.c
===================================================================
--- pdksh-5.2.14.orig/lex.c 2008-04-15 20:49:47.000000000 +0200
+++ pdksh-5.2.14/lex.c 2008-04-15 20:51:49.000000000 +0200
@@ -645,11 +645,12 @@
if (c == c2 || (c == '<' && c2 == '>')) {
iop->flag = c == c2 ?
(c == '>' ? IOCAT : IOHERE) : IORDWR;
- if (iop->flag == IOHERE)
+ if (iop->flag == IOHERE) {
if ((c2 = getsc()) == '-')
iop->flag |= IOSKIP;
else
ungetsc(c2);
+ }
} else if (c2 == '&')
iop->flag = IODUP | (c == '<' ? IORDUP : 0);
else {
Index: pdksh-5.2.14/main.c
===================================================================
--- pdksh-5.2.14.orig/main.c 2008-04-15 20:49:47.000000000 +0200
+++ pdksh-5.2.14/main.c 2008-04-15 20:51:49.000000000 +0200
@@ -593,11 +593,12 @@
if (trap)
runtraps(0);
- if (s->next == NULL)
+ if (s->next == NULL) {
if (Flag(FVERBOSE))
s->flags |= SF_ECHO;
else
s->flags &= ~SF_ECHO;
+ }
if (interactive) {
j_notify();
Index: pdksh-5.2.14/table.c
===================================================================
--- pdksh-5.2.14.orig/table.c 2008-04-15 20:46:56.000000000 +0200
+++ pdksh-5.2.14/table.c 2008-04-15 20:51:49.000000000 +0200
@@ -53,7 +53,7 @@
if (otblp == NULL)
return;
for (i = 0; i < osize; i++)
- if ((tblp = otblp[i]) != NULL)
+ if ((tblp = otblp[i]) != NULL) {
if ((tblp->flag&DEFINED)) {
for (p = &ntblp[hash(tblp->name)
& (tp->size-1)];
@@ -65,6 +65,7 @@
} else if (!(tblp->flag & FINUSE)) {
afree((void*)tblp, tp->areap);
}
+ }
afree((void*)otblp, tp->areap);
}
Index: pdksh-5.2.14/var.c
===================================================================
--- pdksh-5.2.14.orig/var.c 2008-04-15 20:48:46.000000000 +0200
+++ pdksh-5.2.14/var.c 2008-04-15 20:51:49.000000000 +0200
@@ -63,11 +63,12 @@
e->loc = l->next; /* pop block */
for (i = l->vars.size; --i >= 0; )
- if ((vp = *vpp++) != NULL && (vp->flag&SPECIAL))
+ if ((vp = *vpp++) != NULL && (vp->flag&SPECIAL)) {
if ((vq = global(vp->name))->flag & ISSET)
setspec(vq);
else
unsetspec(vq);
+ }
if (l->flags & BF_DOGETOPTS)
user_opt = l->getopts_state;
afreeall(&l->area);
@@ -217,11 +218,12 @@
}
for (l = e->loc; ; l = l->next) {
vp = tsearch(&l->vars, n, h);
- if (vp != NULL)
+ if (vp != NULL) {
if (array)
return arraysearch(vp, val);
else
return vp;
+ }
if (l->next == NULL)
break;
}
|