(xdver): Dump version string.

This commit is contained in:
Markus Armbruster 2006-01-28 17:26:05 +00:00
parent c9d35a6d0a
commit b4a76e04a3

View file

@ -40,6 +40,7 @@
#include "news.h" #include "news.h"
#include "nsc.h" #include "nsc.h"
#include "optlist.h" #include "optlist.h"
#include "version.h"
#include "commands.h" #include "commands.h"
/* /*
@ -313,8 +314,8 @@ xdmeta(int type)
if (ca[i].ca_flags & NSC_EXTRA) if (ca[i].ca_flags & NSC_EXTRA)
continue; continue;
xdflds(mdchr_ca, &ca[i]); xdflds(mdchr_ca, &ca[i]);
n++;
pr("\n"); pr("\n");
n++;
} }
xdftr(n); xdftr(n);
@ -329,6 +330,9 @@ xdmeta(int type)
static int static int
xdver(int meta) xdver(int meta)
{ {
static struct castr vers_ca = {
NSC_STRINGY, 0, sizeof(PACKAGE_STRING), 0, "version", EF_BAD
};
struct keymatch *kp; struct keymatch *kp;
char *sep; char *sep;
int n; int n;
@ -339,6 +343,9 @@ xdver(int meta)
if (meta) { if (meta) {
n = 0; n = 0;
xdflds(mdchr_ca, &vers_ca);
pr("\n");
n++;
for (kp = configkeys; kp->km_key; ++kp) { for (kp = configkeys; kp->km_key; ++kp) {
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) { if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) {
ca.ca_type = kp->km_type; ca.ca_type = kp->km_type;
@ -356,7 +363,8 @@ xdver(int meta)
return RET_OK; return RET_OK;
} }
sep = ""; xdeval(&val, vers_ca.ca_type, version, 0, 0);
sep = xdprval(&val, "");
for (kp = configkeys; kp->km_key; ++kp) { for (kp = configkeys; kp->km_key; ++kp) {
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) { if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) {
xdeval(&val, kp->km_type, kp->km_data, 0, 0); xdeval(&val, kp->km_type, kp->km_data, 0, 0);