Mercurial > hg > toybox
view toys/hello.c @ 293:6baa13382880
Sort was including the trailing comma and getting the order wrong.
(Specifically, it was comparing "sh," with "sha1sum," and putting sha1sum first
in generated/newtoys.h so the binary search wasn't finding sha1sum. Alas, you
can't feed separate beginning and ending delimiters to "sort -t". The fix is
to copy the appropriate field out with sed, duplicate it at the start of the
string where it's easy to compare, and then remove it again with a second
sed after the sort.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 12 May 2008 01:23:19 -0500 |
parents | 4f1ca01db000 |
children | 157eab6dcdd2 |
line wrap: on
line source
/* vi: set sw=4 ts=4: * * hello.c - A hello world program. * * Copyright 2006 Rob Landley <rob@landley.net> * * Not in SUSv3. * See http://www.opengroup.org/onlinepubs/009695399/utilities/ USE_HELLO(NEWTOY(hello, "e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN)) config HELLO bool "hello" default y help A hello world program. You don't need this. Mostly used as an example/skeleton file for adding new commands, occasionally nice to test kernel booting via "init=/bin/hello". */ #include "toys.h" // Hello doesn't use these globals, they're here for example/skeleton purposes. DEFINE_GLOBALS( char *b_string; long c_number; struct arg_list *d_list; long e_count; int more_globals; ) #define TT this.hello void hello_main(void) { printf("Hello world\n"); }