Better prefix determination now that we can't rely on len==0 to

tell the beginning on an entry.
This commit is contained in:
Todd C. Miller
2010-03-19 08:17:58 -04:00
parent 5fb6784ab1
commit 8c9db4ef6f

View File

@@ -445,13 +445,17 @@ sudo_file_display_defaults(nss, pw, lbuf)
struct lbuf *lbuf;
{
struct defaults *d;
char *prefix = NULL;
char *prefix;
int nfound = 0;
if (nss->handle == NULL)
return(-1);
prefix = " ";
if (lbuf->len == 0 || isspace((unsigned char)lbuf->buf[lbuf->len - 1]))
prefix = " ";
else
prefix = ", ";
tq_foreach_fwd(&defaults, d) {
switch (d->type) {
case DEFAULTS_HOST: