summaryrefslogtreecommitdiff
path: root/var.c
diff options
context:
space:
mode:
authortjg <tjg>1999-10-13 16:29:06 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:16 +0100
commitc3ebbbf35d712613024488098645f432160f9e26 (patch)
treedb8bc19b50586c3214d74c44fcdd02e41a153336 /var.c
parentf7a3ce1bd9e66dc46487b3c9f60d11028b9ff35c (diff)
Feature: replace `-V' with `version' variable.
Diffstat (limited to 'var.c')
-rw-r--r--var.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/var.c b/var.c
index 8ef453b..e5fdfcb 100644
--- a/var.c
+++ b/var.c
@@ -57,14 +57,18 @@ extern bool varassign_string(char *extdef) {
associated with $status)
*/
+static List id = { "$Release: @(#)" PACKAGE " " VERSION " " RELDATE " $", 0, 0 };
+
extern List *varlookup(char *name) {
Variable *look;
List *ret, *l;
int sub;
- if (streq(name, "status"))
- return sgetstatus();
if (streq(name, "apids"))
return sgetapids();
+ if (streq(name, "status"))
+ return sgetstatus();
+ if (streq(name, "version"))
+ return &id;
if (*name != '\0' && (sub = a2u(name)) != -1) { /* handle $1, $2, etc. */
for (l = varlookup("*"); l != NULL && sub != 0; --sub)
l = l->n;