~mcf/sbase

f1c3fd4e4498e4cc67ef04fdd5a4be533245b5a0 — Michael Forney 5 months ago fdb9084
Remove unnecessary initializers of recursor members
7 files changed, 7 insertions(+), 14 deletions(-)

M chgrp.c
M chmod.c
M chown.c
M du.c
M mv.c
M rm.c
M tar.c
M chgrp.c => chgrp.c +1 -2
@@ 38,8 38,7 @@ int
main(int argc, char *argv[])
{
	struct group *gr;
	struct recursor r = { .fn = chgrp, .hist = NULL, .depth = 0, .maxdepth = 1,
	                      .follow = 'P', .flags = 0 };
	struct recursor r = { .fn = chgrp, .maxdepth = 1, .follow = 'P' };

	ARGBEGIN {
	case 'h':

M chmod.c => chmod.c +1 -2
@@ 32,8 32,7 @@ usage(void)
int
main(int argc, char *argv[])
{
	struct recursor r = { .fn = chmodr, .hist = NULL, .depth = 0, .maxdepth = 1,
	                      .follow = 'H', .flags = DIRFIRST };
	struct recursor r = { .fn = chmodr, .maxdepth = 1, .follow = 'H', .flags = DIRFIRST };
	size_t i;

	argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;

M chown.c => chown.c +1 -2
@@ 45,8 45,7 @@ main(int argc, char *argv[])
{
	struct group *gr;
	struct passwd *pw;
	struct recursor r = { .fn = chownpwgr, .hist = NULL, .depth = 0, .maxdepth = 1,
	                      .follow = 'P', .flags = 0 };
	struct recursor r = { .fn = chownpwgr, .maxdepth = 1, .follow = 'P' };
	char *owner, *group;

	ARGBEGIN {

M du.c => du.c +1 -2
@@ 60,8 60,7 @@ usage(void)
int
main(int argc, char *argv[])
{
	struct recursor r = { .fn = du, .hist = NULL, .depth = 0, .maxdepth = 0,
	                      .follow = 'P', .flags = 0 };
	struct recursor r = { .fn = du, .follow = 'P' };
	off_t n = 0;
	int kflag = 0, dflag = 0;
	char *bsize;

M mv.c => mv.c +1 -2
@@ 13,8 13,7 @@ static int mv_status = 0;
static int
mv(const char *s1, const char *s2, int depth)
{
	struct recursor r = { .fn = rm, .hist = NULL, .depth = 0, .maxdepth = 0,
	                      .follow = 'P', .flags = 0 };
	struct recursor r = { .fn = rm, .follow = 'P' };

	if (!rename(s1, s2))
		return (mv_status = 0);

M rm.c => rm.c +1 -2
@@ 13,8 13,7 @@ usage(void)
int
main(int argc, char *argv[])
{
	struct recursor r = { .fn = rm, .hist = NULL, .depth = 0, .maxdepth = 1,
	                      .follow = 'P', .flags = 0 };
	struct recursor r = { .fn = rm, .maxdepth = 1, .follow = 'P' };

	ARGBEGIN {
	case 'f':

M tar.c => tar.c +1 -2
@@ 514,8 514,7 @@ usage(void)
int
main(int argc, char *argv[])
{
	struct recursor r = { .fn = c, .hist = NULL, .depth = 0, .maxdepth = 0,
	                      .follow = 'P', .flags = DIRFIRST };
	struct recursor r = { .fn = c, .follow = 'P', .flags = DIRFIRST };
	struct stat st;
	char *file = NULL, *dir = ".", mode = '\0';
	int fd;