Mail Archives: djgpp-workers/2001/06/12/14:46:03
> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Mon, 11 Jun 2001 23:39:39 -0400
>
> getconf is a tool I could make use of, so I implemented it. Below is my first
> version.
Thanks!
I have a couple of minor comments:
> /* For now, any option will trigger the usage text. */
> while ((c = getopt(argc, argv, "h")) != -1)
> {
> switch (c)
> {
> case 'h':
> {
> help();
> break;
> }
> default:
Shouldn't we support the -v option defined by the Posix draft?
> while (beg <= end)
> {
> i = (end + beg) / 2;
> cmp = strcmp (var_name, var_list[i].name);
> if (cmp == 0)
> {
> beg = end = i;
> break;
> }
> if (cmp > 0)
> {
> beg = i + 1;
> }
> else
> {
> end = i - 1;
> }
> }
If you are using binary search, isn't it better to call bsearch?
Finally, a general remark that is not directly related to the code. A
few ported packages include a fake getconf script which just exits,
because the configure script invokes getconf. When getconf is
included in djdev, people who work on these packages should remove
those fake scripts and use the real getconf instead. (I know it's too
early to talk about this; I just wanted to go on record about this
before I forget.)
- Raw text -