From: Nathan Wagner Date: Mon, 30 Mar 2015 19:09:52 +0000 (+0000) Subject: use type flag for file input X-Git-Tag: v0.1.6~211 X-Git-Url: https://pd.if.org/git/?p=zpackage;a=commitdiff_plain;h=e6933c72f5a3ada5dd955bf388f129971727e345 use type flag for file input --- diff --git a/elf/elftype.c b/elf/elftype.c index 7d3365d..146e892 100644 --- a/elf/elftype.c +++ b/elf/elftype.c @@ -62,10 +62,25 @@ int main(int ac, char **av) { if (!want) want = (RELOCATABLE|EXECUTABLE|DYNAMIC|CORE); if (list) { + int type; quiet = 2; perr = 0; while (readline(list, fn)) { - if (checkfile(fn, want,perr,quiet)) { + if ((type = checkfile(fn, want,perr,quiet)) & want) { + if (printtype) { + switch (type) { + case RELOCATABLE: + printf("relocatable "); break; + case EXECUTABLE: + printf("executable "); break; + case DYNAMIC: + printf("dynamic "); break; + case CORE: + printf("core "); break; + default: + printf("notelf "); break; + } + } printf("%s\n", fn); } }