This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] nscd: list all tables in usage()


On Wednesday 01 January 2014 15:20:07 Sami Kerola wrote:
> --- a/nscd/nscd.c
> +++ b/nscd/nscd.c
>
>  more_help (int key, const char *text, void *input)
>  {
> -  char *tp = NULL;
> +  char *tables, *tp = NULL;
>    switch (key)

while you're here, could you add a newline above the switch statement too ?

>      {
>      case ARGP_KEY_HELP_EXTRA:
> +      {
> +	dbtype cnt;
> +
> +	tables = xcalloc (1, sizeof (dbnames) + 1);

you could keep the malloc ... just manually set the first byte to '\0'.  either 
is OK though.

> +	for (cnt = 0; cnt < lastdb; cnt++)
> +	  {
> +            strcat (tables, dbnames[cnt]);
> +	    strcat (tables, " ");
> +	  }
> +      }

hmm, is indentation correct with that first strcat ?  seems like it should be a 
tab and then four spaces.

> +
>        /* We print some extra information.  */
>        if (asprintf (&tp, gettext ("\
> +TABLE names are: %s\n\

how about:
	Supported tables:\n%s\n

that seems to match the style we have in `getent --help`.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]