From d395d11df023c9112d48803df76b5adb1a84403c Mon Sep 17 00:00:00 2001 From: pooka Date: Wed, 3 Jul 2002 12:45:06 +0000 Subject: [PATCH] Add envp argument support to crunchgen. Even though envp is not the POSIX way of crawling through the environment, this will hopefully save someone from having to scratch their head really hard with a crunched program using envp. from henric@aimnet.com, via OpenBSD --- usr.bin/crunch/crunchgen/crunched_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/crunch/crunchgen/crunched_main.c b/usr.bin/crunch/crunchgen/crunched_main.c index eebd663c88fd..4027518b4afd 100644 --- a/usr.bin/crunch/crunchgen/crunched_main.c +++ b/usr.bin/crunch/crunchgen/crunched_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: crunched_main.c,v 1.2 1997/08/02 21:30:10 perry Exp $ */ +/* $NetBSD: crunched_main.c,v 1.3 2002/07/03 12:45:06 pooka Exp $ */ /* * Copyright (c) 1994 University of Maryland * All Rights Reserved. @@ -34,7 +34,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: crunched_main.c,v 1.2 1997/08/02 21:30:10 perry Exp $"); +__RCSID("$NetBSD: crunched_main.c,v 1.3 2002/07/03 12:45:06 pooka Exp $"); #endif #include @@ -47,7 +47,7 @@ struct stub { extern struct stub entry_points[]; -int main(int argc, char **argv) +int main(int argc, char **argv, char **envp) { char *slash, *basename; struct stub *ep; @@ -62,7 +62,7 @@ int main(int argc, char **argv) if(!strcmp(basename, ep->name)) break; if(ep->name) - return ep->f(argc, argv); + return ep->f(argc, argv, envp); else { fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); crunched_usage(); @@ -70,7 +70,7 @@ int main(int argc, char **argv) } -int crunched_main(int argc, char **argv) +int crunched_main(int argc, char **argv, char **envp) { struct stub *ep; int columns, len; @@ -78,7 +78,7 @@ int crunched_main(int argc, char **argv) if(argc <= 1) crunched_usage(); - return main(--argc, ++argv); + return main(--argc, ++argv, envp); }