|
Message-ID: <1e3f4e2cef0e193b264f4035af9dd6fa@smtp.hushmail.com> Date: Thu, 3 Jan 2013 19:11:07 +0100 From: magnum <john.magnum@...hmail.com> To: john-users@...ts.openwall.com Subject: Re: Sequence of format registration On 3 Jan, 2013, at 18:05 , Frank Dittrich <frank_dittrich@...mail.com> wrote: > Only the plugin-formats (those implemented in *_fmt_plug.c files) are > registered "alphabetically" (after the formats supported by the core > version and the dynamic formats). > > I used "alphabetically" in quotes, because > a) the list of source code *file* names *_fmt_plug.c is sorted, not the > *format* names > b) the sort sequence of the file names even depends on the locale settings. > > This is definitely something we should change. This is the current Makefile receipes: LC_ALL=C $(SED) -n 's/^\(struct fmt_main [^ ]*\) =.*/extern \1;/p' *_fmt_plug.c > fmt_externs.h LC_ALL=C $(SED) -n 's/^struct fmt_main \([^ ]*\) =.*/john_register_one(\&\1);/p' *_fmt_plug.c > fmt_registers.h LC_ALL affects how sed handles 8-bit characters, but it doesn't affect sort order from the globbing (cause it's not done by sed). We could fix it by piping it through "LC_ALL=C sort" before the redirect to file, but this adds a dependency on 'sort' (not that it should be a problem). Note that this makes it sorted after format *struct* name (eg. "fmt_DMD5") but I consider that a good thing. This lets us do ugly tweaks for placing things first or last, without changing the source file name nor the format name to something odd. If we can add a dependency on sort(1), I'd vote for this. magnum
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.