(anything *)0 -> NULL
This commit is contained in:
40
exec.c
40
exec.c
@ -1,4 +1,4 @@
|
||||
/** $MirBSD: src/bin/ksh/exec.c,v 2.5 2004/12/18 19:17:10 tg Exp $ */
|
||||
/** $MirBSD: src/bin/ksh/exec.c,v 2.6 2004/12/18 19:22:29 tg Exp $ */
|
||||
/* $OpenBSD: exec.c,v 1.31 2003/12/15 05:25:52 otto Exp $ */
|
||||
|
||||
/*
|
||||
@ -10,7 +10,7 @@
|
||||
#include <ctype.h>
|
||||
#include "ksh_stat.h"
|
||||
|
||||
__RCSID("$MirBSD: src/bin/ksh/exec.c,v 2.5 2004/12/18 19:17:10 tg Exp $");
|
||||
__RCSID("$MirBSD: src/bin/ksh/exec.c,v 2.6 2004/12/18 19:22:29 tg Exp $");
|
||||
|
||||
static int comexec(struct op *t, struct tbl *volatile tp, char **ap,
|
||||
int volatile flags);
|
||||
@ -199,7 +199,7 @@ execute(struct op *volatile t, volatile int flags)
|
||||
e->type = E_ERRH;
|
||||
i = ksh_sigsetjmp(e->jbuf, 0);
|
||||
if (i) {
|
||||
sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
|
||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||
quitenv(NULL);
|
||||
unwind(i);
|
||||
/*NOTREACHED*/
|
||||
@ -222,7 +222,7 @@ execute(struct op *volatile t, volatile int flags)
|
||||
close(pv[0]);
|
||||
}
|
||||
coproc.write = pv[1];
|
||||
coproc.job = (void *) 0;
|
||||
coproc.job = NULL;
|
||||
|
||||
if (coproc.readw >= 0)
|
||||
ksh_dup2(coproc.readw, 1, FALSE);
|
||||
@ -236,7 +236,7 @@ execute(struct op *volatile t, volatile int flags)
|
||||
++coproc.id;
|
||||
}
|
||||
# ifdef JOB_SIGS
|
||||
sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
|
||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||
e->type = E_EXEC; /* no more need for error handler */
|
||||
# endif /* JOB_SIGS */
|
||||
|
||||
@ -584,7 +584,7 @@ comexec(struct op *t, struct tbl *volatile tp, char **ap, volatile int flags)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (include(tp->u.fpath, 0, (char **) 0, 0) < 0) {
|
||||
if (include(tp->u.fpath, 0, NULL, 0) < 0) {
|
||||
warningf(TRUE,
|
||||
"%s: can't open function definition file %s - %s",
|
||||
cp, tp->u.fpath, strerror(errno));
|
||||
@ -727,7 +727,7 @@ scriptexec(struct op *tp, char **ap)
|
||||
|
||||
shell = str_val(global(EXECSHELL_STR));
|
||||
if (shell && *shell)
|
||||
shell = search(shell, path, X_OK, (int *) 0);
|
||||
shell = search(shell, path, X_OK, NULL);
|
||||
if (!shell || !*shell)
|
||||
shell = EXECSHELL;
|
||||
|
||||
@ -749,7 +749,7 @@ scriptexec(struct op *tp, char **ap)
|
||||
while (*cp && (*cp == ' ' || *cp == '\t'))
|
||||
cp++;
|
||||
if (*cp && *cp != '\n') {
|
||||
char *a0 = cp, *a1 = (char *) 0;
|
||||
char *a0 = cp, *a1 = NULL;
|
||||
|
||||
while (*cp && *cp != '\n' && *cp != ' '
|
||||
&& *cp != '\t')
|
||||
@ -803,7 +803,7 @@ struct tbl *
|
||||
findfunc(const char *name, unsigned int h, int create)
|
||||
{
|
||||
struct block *l;
|
||||
struct tbl *tp = (struct tbl *) 0;
|
||||
struct tbl *tp = NULL;
|
||||
|
||||
for (l = e->loc; l; l = l->next) {
|
||||
tp = tsearch(&l->funs, name, h);
|
||||
@ -813,7 +813,7 @@ findfunc(const char *name, unsigned int h, int create)
|
||||
tp = tenter(&l->funs, name, h);
|
||||
tp->flag = DEFINED;
|
||||
tp->type = CFUNC;
|
||||
tp->val.t = (struct op *) 0;
|
||||
tp->val.t = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -923,7 +923,7 @@ findcom(const char *name, int flags)
|
||||
tp = findfunc(name, h, FALSE);
|
||||
if (tp && !(tp->flag & ISSET)) {
|
||||
if ((fpath = str_val(global("FPATH"))) == null) {
|
||||
tp->u.fpath = (char *) 0;
|
||||
tp->u.fpath = NULL;
|
||||
tp->u2.errno_ = 0;
|
||||
} else
|
||||
tp->u.fpath = search(name, fpath, R_OK,
|
||||
@ -975,7 +975,7 @@ findcom(const char *name, int flags)
|
||||
} else if ((flags & FC_FUNC)
|
||||
&& (fpath = str_val(global("FPATH"))) != null
|
||||
&& (npath = search(name, fpath, R_OK,
|
||||
&tp->u2.errno_)) != (char *) 0)
|
||||
&tp->u2.errno_)) != NULL)
|
||||
{
|
||||
/* An undocumented feature of at&t ksh is that it
|
||||
* searches FPATH if a command is not found, even
|
||||
@ -1102,7 +1102,7 @@ call_builtin(struct tbl *tp, char **wp)
|
||||
shf_flush(shl_stdout);
|
||||
shl_stdout_ok = 0;
|
||||
builtin_flag = 0;
|
||||
builtin_argv0 = (char *) 0;
|
||||
builtin_argv0 = NULL;
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -1124,13 +1124,13 @@ iosetup(struct ioword *iop, struct tbl *tp)
|
||||
|
||||
/* Used for tracing and error messages to print expanded cp */
|
||||
iotmp = *iop;
|
||||
iotmp.name = (iotype == IOHERE) ? (char *) 0 : cp;
|
||||
iotmp.name = (iotype == IOHERE) ? NULL : cp;
|
||||
iotmp.flag |= IONAMEXP;
|
||||
|
||||
if (Flag(FXTRACE))
|
||||
shellf("%s%s\n",
|
||||
substitute(str_val(global("PS4")), 0),
|
||||
snptreef((char *) 0, 32, "%R", &iotmp));
|
||||
snptreef(NULL, 32, "%R", &iotmp));
|
||||
|
||||
switch (iotype) {
|
||||
case IOREAD:
|
||||
@ -1175,7 +1175,7 @@ iosetup(struct ioword *iop, struct tbl *tp)
|
||||
&emsg)) < 0)
|
||||
{
|
||||
warningf(TRUE, "%s: %s",
|
||||
snptreef((char *) 0, 32, "%R", &iotmp), emsg);
|
||||
snptreef(NULL, 32, "%R", &iotmp), emsg);
|
||||
return -1;
|
||||
}
|
||||
if (u == iop->unit)
|
||||
@ -1220,7 +1220,7 @@ iosetup(struct ioword *iop, struct tbl *tp)
|
||||
if (ksh_dup2(u, iop->unit, TRUE) < 0) {
|
||||
warningf(TRUE,
|
||||
"could not finish (dup) redirection %s: %s",
|
||||
snptreef((char *) 0, 32, "%R", &iotmp),
|
||||
snptreef(NULL, 32, "%R", &iotmp),
|
||||
strerror(errno));
|
||||
if (iotype != IODUP)
|
||||
close(u);
|
||||
@ -1257,7 +1257,7 @@ herein(const char *content, int sub)
|
||||
int i;
|
||||
|
||||
/* ksh -c 'cat << EOF' can cause this... */
|
||||
if (content == (char *) 0) {
|
||||
if (content == NULL) {
|
||||
warningf(TRUE, "here document missing");
|
||||
return -2; /* special to iosetup(): don't print error */
|
||||
}
|
||||
@ -1332,7 +1332,7 @@ do_selectargs(char **ap, bool_t print_menu)
|
||||
pr_menu(ap);
|
||||
shellf("%s", str_val(global("PS3")));
|
||||
if (call_builtin(findcom("read", FC_BI), (char **) read_args))
|
||||
return (char *) 0;
|
||||
return NULL;
|
||||
s = str_val(global("REPLY"));
|
||||
if (*s) {
|
||||
i = atoi(s);
|
||||
@ -1486,7 +1486,7 @@ dbteste_getopnd(Test_env *te, Test_op op, int do_eval)
|
||||
char *s = *te->pos.wp;
|
||||
|
||||
if (!s)
|
||||
return (char *) 0;
|
||||
return NULL;
|
||||
|
||||
te->pos.wp++;
|
||||
|
||||
|
Reference in New Issue
Block a user