diff options
Diffstat (limited to 'usr.sbin/crunch')
-rw-r--r-- | usr.sbin/crunch/crunchgen/crunched_main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunched_main.c b/usr.sbin/crunch/crunchgen/crunched_main.c index 2cf9576..7780aa5 100644 --- a/usr.sbin/crunch/crunchgen/crunched_main.c +++ b/usr.sbin/crunch/crunchgen/crunched_main.c @@ -41,6 +41,7 @@ struct stub { int (*f)(); }; +extern char *__progname; extern struct stub entry_points[]; int main(int argc, char **argv, char **envp) @@ -83,12 +84,16 @@ int crunched_here(char *path) int crunched_main(int argc, char **argv, char **envp) { + char *slash; struct stub *ep; int columns, len; if(argc <= 1) crunched_usage(); + slash = strrchr(argv[1], '/'); + __progname = slash? slash+1 : argv[1]; + return main(--argc, ++argv, envp); } |