From 7d150b7705f9385af4d9a776118705e09549880e Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sun, 21 May 1995 01:50:13 +0000 Subject: [PATCH] Added a crunched_here(char *path) function so crunched programs can find out who they share bed and breakfast with. --- usr.sbin/crunch/crunchgen/crunched_main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/usr.sbin/crunch/crunchgen/crunched_main.c b/usr.sbin/crunch/crunchgen/crunched_main.c index a07317aa5a6b..662b87c9c45a 100644 --- a/usr.sbin/crunch/crunchgen/crunched_main.c +++ b/usr.sbin/crunch/crunchgen/crunched_main.c @@ -64,6 +64,21 @@ int main(int argc, char **argv) } +int crunched_here(char *path) +{ + char *slash, *basename; + struct stub *ep; + + slash = strrchr(path, '/'); + basename = slash? slash+1 : path; + + for(ep=entry_points; ep->name != NULL; ep++) + if(!strcmp(basename, ep->name)) + return 1; + return 0; +} + + int crunched_main(int argc, char **argv) { struct stub *ep;