mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-29 13:00:32 +01:00
147 lines
3.9 KiB
Diff
147 lines
3.9 KiB
Diff
* 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;
|
|
}
|