Add support for multiple attributes. This is required for the

PC98 scheme.
This commit is contained in:
Marcel Moolenaar 2008-10-20 05:12:50 +00:00
parent e1d7111a53
commit 1eecfda454
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184070

View File

@ -223,13 +223,20 @@ fmtsize(long double rawsz)
static const char *
fmtattrib(struct gprovider *pp)
{
static char buf[64];
const char *val;
static char buf[128];
struct gconfig *gc;
u_int idx;
val = find_provcfg(pp, "attrib");
if (val == NULL)
return ("");
snprintf(buf, sizeof(buf), " [%s] ", val);
buf[0] = '\0';
idx = 0;
LIST_FOREACH(gc, &pp->lg_config, lg_config) {
if (strcmp(gc->lg_name, "attrib") != 0)
continue;
idx += snprintf(buf + idx, sizeof(buf) - idx, "%s%s",
(idx == 0) ? " [" : ",", gc->lg_val);
}
if (idx > 0)
snprintf(buf + idx, sizeof(buf) - idx, "] ");
return (buf);
}