diff options
author | phk <phk@FreeBSD.org> | 1995-05-21 01:50:13 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-05-21 01:50:13 +0000 |
commit | 54abfae1de08bdacfb9127084986b7225f9345d9 (patch) | |
tree | 8cf4197fe6a670d26469e405230292392fceabd1 /usr.sbin/crunch/crunchgen/crunched_main.c | |
parent | 1a410e1dc43e989b4ce83948c13a278a909ed27c (diff) | |
download | FreeBSD-src-54abfae1de08bdacfb9127084986b7225f9345d9.zip FreeBSD-src-54abfae1de08bdacfb9127084986b7225f9345d9.tar.gz |
Added a crunched_here(char *path) function so crunched programs can find out
who they share bed and breakfast with.
Diffstat (limited to 'usr.sbin/crunch/crunchgen/crunched_main.c')
-rw-r--r-- | usr.sbin/crunch/crunchgen/crunched_main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/usr.sbin/crunch/crunchgen/crunched_main.c b/usr.sbin/crunch/crunchgen/crunched_main.c index a07317a..662b87c 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; |