summaryrefslogtreecommitdiff
path: root/sbin/wsconsctl
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2009-07-15 21:38:17 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2009-07-15 21:38:17 +0000
commitfe7fdd5d111172569b7bd8417912f7bf0f81abe2 (patch)
treeb365f580ab62628482e8f2f53c252b8bbe25343d /sbin/wsconsctl
parent6d37fa34d2ba7e15743d02decc9eb0a6f0750842 (diff)
now that set print is in one place; it is possible to suppress var
making n flag work as expected for set. ok miod@
Diffstat (limited to 'sbin/wsconsctl')
-rw-r--r--sbin/wsconsctl/wsconsctl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/wsconsctl/wsconsctl.c b/sbin/wsconsctl/wsconsctl.c
index 8685cfae252..c772c88024f 100644
--- a/sbin/wsconsctl/wsconsctl.c
+++ b/sbin/wsconsctl/wsconsctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsconsctl.c,v 1.22 2009/07/15 20:32:28 martynas Exp $ */
+/* $OpenBSD: wsconsctl.c,v 1.23 2009/07/15 21:38:16 martynas Exp $ */
/* $NetBSD: wsconsctl.c,v 1.2 1998/12/29 22:40:20 hannken Exp $ */
/*-
@@ -89,7 +89,7 @@ main(int argc, char *argv[])
{
int i, ch, error = 0, aflag = 0, do_merge, putval;
struct vartypesw *sw = NULL;
- char *sep = "=", *p;
+ char *getsep = "=", *setsep = " -> ", *p;
char *wdev = NULL;
struct field *f;
@@ -102,7 +102,7 @@ main(int argc, char *argv[])
wdev = optarg;
break;
case 'n':
- sep = NULL;
+ getsep = setsep = NULL;
break;
case 'w':
/* compat */
@@ -140,7 +140,7 @@ main(int argc, char *argv[])
warnx("Use explicit arg to view %s.%s.",
sw->name, f->name);
else if (f->flags & FLG_GET)
- pr_field(sw->name, f, sep);
+ pr_field(sw->name, f, getsep);
}
} else if (argc > 0) {
for (i = 0; i < argc; i++) {
@@ -171,7 +171,7 @@ main(int argc, char *argv[])
(*sw->getval)(sw->name, sw->fd);
if (f->flags & FLG_DEAD)
continue;
- pr_field(sw->name, f, sep);
+ pr_field(sw->name, f, getsep);
continue;
}
if (p > argv[i] &&
@@ -217,13 +217,13 @@ main(int argc, char *argv[])
if (putval != 0 || f->flags & FLG_DEAD)
continue;
if (f->flags & FLG_WRONLY) {
- pr_field(sw->name, f, " -> ");
+ pr_field(sw->name, f, setsep);
} else {
f->flags |= FLG_GET;
(*sw->getval)(sw->name, sw->fd);
if (f->flags & FLG_DEAD)
continue;
- pr_field(sw->name, f, " -> ");
+ pr_field(sw->name, f, setsep);
}
}
} else