Mail Archives: djgpp-workers/2001/06/15/03:44:03
> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Thu, 14 Jun 2001 17:48:45 -0400
>
> case 'v':
> {
> const char *spec = optarg;
> const int num_specs = sizeof(conf_specs) / sizeof(conf_specs[0]);
> int i;
>
> for (i = 0; i < num_specs; ++i)
> {
> if (strcmp (spec, conf_specs[i]) == 0)
> break;
> }
> if (i == num_specs)
> {
> fprintf(stderr, "undefined specification\n", spec);
> }
Shouldn't the output be just "undefined\n"? That's what the Posix
draft I have seems to indicate. Or is there a new draft?
Also, for this to work as Posix requires, I think we need an
additional element in var_list[] which says something like this:
{ "_POSIX_V6_ILP32_OFF32", 0, constant_var }
because Posix says "getconf _POSIX_V6_ILP32_OFF32" should not print
"undefined\n" or "-1\n" if "-v POSIX_V6_ILP32_OFF32" is supported.
(The `0' in that line is arbitrary; any other suggestions?)
> static void
> usage(void)
> {
> fprintf(stderr, "Usage: getopt [-h] [sysvar] [pathvar path]\n");
> exit(1);
> }
This should mention -v.
Also, both usage() and help() should talk about getconf, not getopt ;-)
- Raw text -