/* Print a one-line summary of the node. Used in case of 'ls'. */
static void confnode_strconfig_display_short(const struct confnode *n)
{
- /* just display prompt */
- printf(" %s\n", n->prompt);
+#define STRBUFLEN 10
+ char buf[STRBUFLEN];
+
+ memset(buf, 0, sizeof(buf));
+
+ buf[0] = '"';
+ confnode_get_value(n, &buf[1], STRBUFLEN-1);
+ if (strlen(buf) == STRBUFLEN-1) { /* buffer full */
+ buf[STRBUFLEN-4] = '.';
+ buf[STRBUFLEN-3] = '.';
+ buf[STRBUFLEN-2] = '\0';
+ }
+ strcat(buf, "\"");
+
+ while (strlen(buf) < sizeof(buf) - 1)
+ strcat(buf, " ");
+
+ printf("%s %s: %s\n", buf, n->name, n->prompt);
}
/* register the node type */