aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tip/tip/tip.h2
-rw-r--r--usr.bin/tip/tip/value.c18
2 files changed, 16 insertions, 4 deletions
diff --git a/usr.bin/tip/tip/tip.h b/usr.bin/tip/tip/tip.h
index 6bf94521cdfd..298b08cb6692 100644
--- a/usr.bin/tip/tip/tip.h
+++ b/usr.bin/tip/tip/tip.h
@@ -158,12 +158,10 @@ typedef
#define number(v) ((long)(intptr_t)(v))
#define boolean(v) ((short)(intptr_t)(v))
#define character(v) ((char)(intptr_t)(v))
-#define address(v) ((long *)(v))
#define setnumber(v,n) do { (v) = (char *)(intptr_t)(n); } while (0)
#define setboolean(v,n) do { (v) = (char *)(intptr_t)(n); } while (0)
#define setcharacter(v,n) do { (v) = (char *)(intptr_t)(n); } while (0)
-#define setaddress(v,n) do { (v) = (char *)(n); } while (0)
/*
* Escape command table definitions --
diff --git a/usr.bin/tip/tip/value.c b/usr.bin/tip/tip/value.c
index a4776b80d35d..9cf1052d3ea2 100644
--- a/usr.bin/tip/tip/value.c
+++ b/usr.bin/tip/tip/value.c
@@ -69,8 +69,22 @@ vinit(void)
if (p->v_type&ENVIRON)
if ((cp = getenv(p->v_name)))
p->v_value = cp;
- if (p->v_type&IREMOTE)
- setnumber(p->v_value, *address(p->v_value));
+ if (p->v_type&IREMOTE) {
+ switch (p->v_type&TMASK) {
+ case STRING:
+ p->v_value = *(char **)p->v_value;
+ break;
+ case NUMBER:
+ setnumber(p->v_value, *(long *)p->v_value);
+ break;
+ case BOOL:
+ setboolean(p->v_value, *(short *)p->v_value);
+ break;
+ case CHAR:
+ setcharacter(p->v_value, *(char *)p->v_value);
+ break;
+ }
+ }
}
/*
* Read the .tiprc file in the HOME directory