-/* $OpenBSD: csh.c,v 1.43 2017/12/16 10:27:21 anton Exp $ */
+/* $OpenBSD: csh.c,v 1.44 2018/09/08 01:28:39 miko Exp $ */
/* $NetBSD: csh.c,v 1.14 1995/04/29 23:21:28 mycroft Exp $ */
/*-
void
pintr1(bool wantnl)
{
- Char **v;
sigset_t sigset, osigset;
sigemptyset(&sigset);
if (gointr) {
gotolab(gointr);
timflg = 0;
- if ((v = pargv) != NULL)
- pargv = 0, blkfree(v);
- if ((v = gargv) != NULL)
- gargv = 0, blkfree(v);
+ blkfree(pargv);
+ pargv = NULL;
+ blkfree(gargv);
+ gargv = NULL;
reset();
}
else if (intty && wantnl) {
-/* $OpenBSD: dol.c,v 1.21 2017/12/16 10:27:21 anton Exp $ */
+/* $OpenBSD: dol.c,v 1.22 2018/09/08 01:28:39 miko Exp $ */
/* $NetBSD: dol.c,v 1.8 1995/09/27 00:38:38 jtc Exp $ */
/*-
ocnt = BUFSIZ;
}
}
- if (pargv)
- blkfree(pargv), pargv = 0;
+ blkfree(pargv);
+ pargv = NULL;
}
}
-/* $OpenBSD: error.c,v 1.13 2017/12/16 10:27:21 anton Exp $ */
+/* $OpenBSD: error.c,v 1.14 2018/09/08 01:28:39 miko Exp $ */
/* $NetBSD: err.c,v 1.6 1995/03/21 09:02:47 cgd Exp $ */
/*-
stderror(int id, ...)
{
va_list va;
- Char **v;
int flags = id & ERR_FLAGS;
id &= ~ERR_FLAGS;
free(seterr);
seterr = NULL;
- if ((v = pargv) != NULL)
- pargv = 0, blkfree(v);
- if ((v = gargv) != NULL)
- gargv = 0, blkfree(v);
+ blkfree(pargv);
+ pargv = NULL;
+ blkfree(gargv);
+ gargv = NULL;
(void) fflush(cshout);
(void) fflush(csherr);
-/* $OpenBSD: func.c,v 1.37 2017/12/18 19:12:24 anton Exp $ */
+/* $OpenBSD: func.c,v 1.38 2018/09/08 01:28:39 miko Exp $ */
/* $NetBSD: func.c,v 1.11 1996/02/09 02:28:29 christos Exp $ */
/*-
}
}
- if (wp->w_fe0)
- blkfree(wp->w_fe0);
+ blkfree(wp->w_fe0);
free(wp->w_fename);
free(wp);
}
(void) fflush(cshout);
if (setintr)
sigprocmask(SIG_BLOCK, &sigset, NULL);
- if (gargv)
- blkfree(gargv), gargv = 0;
+ blkfree(gargv);
+ gargv = NULL;
}
void
SHIN = dmove(saveIN, oSHIN);
SHOUT = dmove(saveOUT, oSHOUT);
SHERR = dmove(saveERR, oSHERR);
- if (gv)
- blkfree(gv), gv = NULL;
+ blkfree(gv);
+ gv = NULL;
resexit(osetexit);
gv = savegv;
if (my_reenter)
-/* $OpenBSD: glob.c,v 1.22 2015/12/26 13:48:38 mestre Exp $ */
+/* $OpenBSD: glob.c,v 1.23 2018/09/08 01:28:39 miko Exp $ */
/* $NetBSD: glob.c,v 1.10 1995/03/21 09:03:01 cgd Exp $ */
/*-
Char *lp, *rp;
Char *ep, word[PATH_MAX];
- if (pargv) {
- blkfree(pargv);
- }
+ blkfree(pargv);
pargsiz = GLOBSPACE;
pargv = xreallocarray(NULL, pargsiz, sizeof(Char *));
pargv[0] = NULL;
-/* $OpenBSD: proc.c,v 1.31 2017/07/22 09:37:21 anton Exp $ */
+/* $OpenBSD: proc.c,v 1.32 2018/09/08 01:28:39 miko Exp $ */
/* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */
/*-
cont:
v++;
}
- if (gargv)
- blkfree(gargv), gargv = 0;
+ blkfree(gargv);
+ gargv = NULL;
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
if (err1)
stderror(ERR_SILENT);