2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 09:57:41 +00:00

Print a newline between Runas and Command-specific defaults in

sudo -l.
This commit is contained in:
Todd C. Miller 2009-12-26 17:25:49 +00:00
parent d0b2086a62
commit 8ca8f24001
2 changed files with 8 additions and 2 deletions

8
lbuf.c
View File

@ -245,10 +245,14 @@ lbuf_print(lbuf)
cp = lbuf->buf;
have = cols;
while (cp != NULL && *cp != '\0') {
char *ep = NULL;
char *ep;
int need = lbuf->len - (int)(cp - lbuf->buf);
if (need > have) {
ep = memrchr(cp, '\n', need > have ? have : need);
if (ep) {
need = ep - cp;
ep++; /* skip over newline */
} else if (need > have) {
have -= contlen; /* subtract for continuation char */
if ((ep = memrchr(cp, ' ', have)) == NULL)
ep = memchr(cp + have, ' ', need - have);

View File

@ -560,6 +560,8 @@ display_bound_defaults(dtype, lbuf)
nfound++;
if (binding != tq_first(&d->binding)) {
binding = tq_first(&d->binding);
if (nfound != 1)
lbuf_append(lbuf, "\n", NULL);
lbuf_append(lbuf, " Defaults", dsep, NULL);
for (m = binding; m != NULL; m = m->next) {
if (m != binding)