tell the beginning on an entry.
--HG--
branch : 1.7
if (rc == LDAP_SUCCESS && (entry = ldap_first_entry(ld, result))) {
bv = ldap_get_values_len(ld, entry, "sudoOption");
if (bv != NULL) {
- prefix = " ";
+ if (lbuf->len == 0 || isspace((unsigned char)lbuf->buf[lbuf->len - 1]))
+ prefix = " ";
+ else
+ prefix = ", ";
for (p = bv; *p != NULL; p++) {
lbuf_append(lbuf, prefix, (*p)->bv_val, NULL);
prefix = ", ";
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: