Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/crunch/crunchgen Add envp argument support to crunch...



details:   https://anonhg.NetBSD.org/src/rev/40a7cfe275d9
branches:  trunk
changeset: 533530:40a7cfe275d9
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jul 03 12:45:06 2002 +0000

description:
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@localhost, via OpenBSD

diffstat:

 usr.bin/crunch/crunchgen/crunched_main.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r b02cb7aa5b86 -r 40a7cfe275d9 usr.bin/crunch/crunchgen/crunched_main.c
--- a/usr.bin/crunch/crunchgen/crunched_main.c  Wed Jul 03 11:51:34 2002 +0000
+++ b/usr.bin/crunch/crunchgen/crunched_main.c  Wed Jul 03 12:45:06 2002 +0000
@@ -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 <sys/cdefs.h>
 #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 <stdio.h>
@@ -47,7 +47,7 @@
 
 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 @@
        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 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 @@
     if(argc <= 1) 
        crunched_usage();
 
-    return main(--argc, ++argv);
+    return main(--argc, ++argv, envp);
 }
 
 



Home | Main Index | Thread Index | Old Index