Re-correct commit 1.73, but this time in a way that does not cause

all column-headers to print in lowercase by default.  I was in too
much of a rush in committing 1.75, and didn't notice that the case
had changed.  This time I did considerably more testing, and used
'diff' instead of just quickly eyeballing the results...

Apologies.  I expect this means the dunce cap is mine for awhile.
If this doesn't work, I'll just drop back to 1.72 and hide under
my desk for awhile.
This commit is contained in:
gad 2006-04-06 03:24:31 +00:00
parent d2dc014de0
commit 20f9416a8f

View File

@ -302,22 +302,31 @@ findvar(char *p, int user, char **header)
hp = strchr(p, '=');
if (hp)
*hp++ = '\0';
else
hp = p;
key.name = p;
v = bsearch(&key, var, sizeof(var)/sizeof(VAR) - 1, sizeof(VAR), vcmp);
if (v && v->alias) {
/*
* XXX - This processing will not be correct for any alias
* which expands into a list of format keywords. Presently
* there are no aliases which do that.
* If the user specified an alternate-header for this
* (aliased) format-name, then we need to copy that
* alternate-header when making the recursive call to
* process the alias.
*/
rflen = strlen(v->alias) + strlen(hp) + 2;
realfmt = malloc(rflen);
snprintf(realfmt, rflen, "%s=%s", v->alias, hp);
parsefmt(realfmt, user);
if (hp == NULL)
parsefmt(v->alias, user);
else {
/*
* XXX - This processing will not be correct for
* any alias which expands into a list of format
* keywords. Presently there are no aliases
* which do that.
*/
rflen = strlen(v->alias) + strlen(hp) + 2;
realfmt = malloc(rflen);
snprintf(realfmt, rflen, "%s=%s", v->alias, hp);
parsefmt(realfmt, user);
}
return ((VAR *)NULL);
}
if (!v) {