-/* $OpenBSD: c_ksh.c,v 1.42 2015/09/22 21:50:40 millert Exp $ */
+/* $OpenBSD: c_ksh.c,v 1.43 2015/10/09 19:36:27 tedu Exp $ */
/*
* built-in Korn commands: c_*
bi_errorf("%s: bad directory", dir);
else
bi_errorf("%s - %s", try, strerror(errno));
- if (fdir)
- afree(fdir, ATEMP);
+ afree(fdir, ATEMP);
return 1;
}
if (printpath || cdnode)
shprintf("%s\n", pwd);
- if (fdir)
- afree(fdir, ATEMP);
+ afree(fdir, ATEMP);
return 0;
}
}
}
shprintf("%s\n", p);
- if (freep)
- afree(freep, ATEMP);
+ afree(freep, ATEMP);
return 0;
}
-/* $OpenBSD: edit.c,v 1.45 2015/09/26 23:49:37 nicm Exp $ */
+/* $OpenBSD: edit.c,v 1.46 2015/10/09 19:36:27 tedu Exp $ */
/*
* Command line editing - common code
int i;
for (i = 0; i < nwords; i++)
- if (words[i])
- afree(words[i], ATEMP);
+ afree(words[i], ATEMP);
afree(words, ATEMP);
}
-/* $OpenBSD: emacs.c,v 1.53 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: emacs.c,v 1.54 2015/10/09 19:36:27 tedu Exp $ */
/*
* Emacs-like command line editing and history
x_push(int nchars)
{
char *cp = str_nsave(xcp, nchars, AEDIT);
- if (killstack[killsp])
- afree(killstack[killsp], AEDIT);
+ afree(killstack[killsp], AEDIT);
killstack[killsp] = cp;
killsp = (killsp + 1) % KILLSIZE;
}
-/* $OpenBSD: history.c,v 1.46 2015/10/08 16:41:26 tedu Exp $ */
+/* $OpenBSD: history.c,v 1.47 2015/10/09 19:36:27 tedu Exp $ */
/*
* command history
if (lno >= s->line-(histptr-history) && lno <= s->line) {
hp = &histptr[lno-s->line];
- if (*hp)
- afree(*hp, APERM);
+ afree(*hp, APERM);
*hp = str_save((char *)line, APERM);
}
}
-/* $OpenBSD: mail.c,v 1.19 2015/09/17 14:21:33 nicm Exp $ */
+/* $OpenBSD: mail.c,v 1.20 2015/10/09 19:36:27 tedu Exp $ */
/*
* Mailbox checking code by Robert J. Gibson, adapted for PD ksh by
{
struct stat stbuf;
- if (mbox.mb_msg)
- afree(mbox.mb_msg, APERM);
- if (mbox.mb_path)
- afree(mbox.mb_path, APERM);
+ afree(mbox.mb_msg, APERM);
+ afree(mbox.mb_path, APERM);
/* Save a copy to protect from export (which munges the string) */
mbox.mb_path = str_save(p, APERM);
mbox.mb_msg = NULL;
-/* $OpenBSD: trap.c,v 1.25 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: trap.c,v 1.26 2015/10/09 19:36:27 tedu Exp $ */
/*
* signal handling
{
sig_t f;
- if (p->trap)
- afree(p->trap, APERM);
+ afree(p->trap, APERM);
p->trap = str_save(s, APERM); /* handles s == 0 */
p->flags |= TF_CHANGED;
f = !s ? SIG_DFL : s[0] ? trapsig : SIG_IGN;
-/* $OpenBSD: tree.c,v 1.24 2015/09/27 05:25:00 guenther Exp $ */
+/* $OpenBSD: tree.c,v 1.25 2015/10/09 19:36:27 tedu Exp $ */
/*
* command tree climbing
if (t == NULL)
return;
- if (t->str != NULL)
- afree(t->str, ap);
+ afree(t->str, ap);
if (t->vars != NULL) {
for (w = t->vars; *w != NULL; w++)
struct ioword *p;
for (iop = iow; (p = *iop++) != NULL; ) {
- if (p->name != NULL)
- afree(p->name, ap);
- if (p->delim != NULL)
- afree(p->delim, ap);
- if (p->heredoc != NULL)
- afree(p->heredoc, ap);
+ afree(p->name, ap);
+ afree(p->delim, ap);
+ afree(p->heredoc, ap);
afree(p, ap);
}
afree(iow, ap);