Better prefix determination now that we can't rely on len==0 to
tell the beginning on an entry.
This commit is contained in:
@@ -445,13 +445,17 @@ sudo_file_display_defaults(nss, pw, lbuf)
|
|||||||
struct lbuf *lbuf;
|
struct lbuf *lbuf;
|
||||||
{
|
{
|
||||||
struct defaults *d;
|
struct defaults *d;
|
||||||
char *prefix = NULL;
|
char *prefix;
|
||||||
int nfound = 0;
|
int nfound = 0;
|
||||||
|
|
||||||
if (nss->handle == NULL)
|
if (nss->handle == NULL)
|
||||||
return(-1);
|
return(-1);
|
||||||
|
|
||||||
|
if (lbuf->len == 0 || isspace((unsigned char)lbuf->buf[lbuf->len - 1]))
|
||||||
prefix = " ";
|
prefix = " ";
|
||||||
|
else
|
||||||
|
prefix = ", ";
|
||||||
|
|
||||||
tq_foreach_fwd(&defaults, d) {
|
tq_foreach_fwd(&defaults, d) {
|
||||||
switch (d->type) {
|
switch (d->type) {
|
||||||
case DEFAULTS_HOST:
|
case DEFAULTS_HOST:
|
||||||
|
Reference in New Issue
Block a user