summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-09-15 18:07:22 +0000
committertedu <tedu@openbsd.org>2015-09-15 18:07:22 +0000
commit0f09b4e45d3d27c5ef6ea164e0839c76467e2506 (patch)
tree7744e15f79a23bb96a397191da93727f3e2bec25
parentupdate spacing in usage(); reminded by jmc@ (diff)
downloadwireguard-openbsd-0f09b4e45d3d27c5ef6ea164e0839c76467e2506.tar.xz
wireguard-openbsd-0f09b4e45d3d27c5ef6ea164e0839c76467e2506.zip
stop abusing null (the variable) for an empty string in output formats.
from Michael McConville ok nicm
-rw-r--r--bin/ksh/c_ksh.c9
-rw-r--r--bin/ksh/jobs.c14
-rw-r--r--bin/ksh/misc.c4
3 files changed, 13 insertions, 14 deletions
diff --git a/bin/ksh/c_ksh.c b/bin/ksh/c_ksh.c
index 8644dcab0dd..9454153dec8 100644
--- a/bin/ksh/c_ksh.c
+++ b/bin/ksh/c_ksh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c_ksh.c,v 1.38 2015/09/14 16:08:50 nicm Exp $ */
+/* $OpenBSD: c_ksh.c,v 1.39 2015/09/15 18:07:22 tedu Exp $ */
/*
* built-in Korn commands: c_*
@@ -466,8 +466,7 @@ c_whence(char **wp)
case CALIAS:
if (vflag)
shprintf(" is an %salias for ",
- (tp->flag & EXPORT) ? "exported " :
- null);
+ (tp->flag & EXPORT) ? "exported " : "");
if (!iam_whence && !vflag)
shprintf("alias %s=", id);
print_value_quoted(tp->val.s);
@@ -491,7 +490,7 @@ c_whence(char **wp)
case CSHELL:
if (vflag)
shprintf(" is a%s shell builtin",
- (tp->flag & SPEC_BI) ? " special" : null);
+ (tp->flag & SPEC_BI) ? " special" : "");
break;
case CTALIAS:
case CEXEC:
@@ -501,7 +500,7 @@ c_whence(char **wp)
if (tp->type == CTALIAS)
shprintf("a tracked %salias for ",
(tp->flag & EXPORT) ?
- "exported " : null);
+ "exported " : "");
}
shprintf("%s", tp->val.s);
} else {
diff --git a/bin/ksh/jobs.c b/bin/ksh/jobs.c
index 1cf40658b5e..642e09632e9 100644
--- a/bin/ksh/jobs.c
+++ b/bin/ksh/jobs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: jobs.c,v 1.43 2015/09/10 22:48:58 nicm Exp $ */
+/* $OpenBSD: jobs.c,v 1.44 2015/09/15 18:07:22 tedu Exp $ */
/*
* Process and job control
@@ -739,7 +739,7 @@ j_resume(const char *cp, int bg)
p->status = 0;
running = 1;
}
- shprintf("%s%s", p->command, p->next ? "| " : null);
+ shprintf("%s%s", p->command, p->next ? "| " : "");
}
shprintf("\n");
shf_flush(shl_stdout);
@@ -1394,13 +1394,13 @@ j_print(Job *j, int how, struct shf *shf)
if (buf[0]) {
output = 1;
shf_fprintf(shf, "%s%s ",
- buf, coredumped ? " (core dumped)" : null);
+ buf, coredumped ? " (core dumped)" : "");
}
} else {
output = 1;
shf_fprintf(shf, "%-20s %s%s%s", buf, p->command,
- p->next ? "|" : null,
- coredumped ? " (core dumped)" : null);
+ p->next ? "|" : "",
+ coredumped ? " (core dumped)" : "");
}
state = p->state;
@@ -1409,10 +1409,10 @@ j_print(Job *j, int how, struct shf *shf)
while (p && p->state == state && p->status == status) {
if (how == JP_LONG)
shf_fprintf(shf, "%s%5d %-20s %s%s", filler, p->pid,
- " ", p->command, p->next ? "|" : null);
+ " ", p->command, p->next ? "|" : "");
else if (how == JP_MEDIUM)
shf_fprintf(shf, " %s%s", p->command,
- p->next ? "|" : null);
+ p->next ? "|" : "");
p = p->next;
}
}
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c
index 8f0db83e77c..ed2426e4f25 100644
--- a/bin/ksh/misc.c
+++ b/bin/ksh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.41 2015/09/10 22:48:58 nicm Exp $ */
+/* $OpenBSD: misc.c,v 1.42 2015/09/15 18:07:22 tedu Exp $ */
/*
* Miscellaneous functions
@@ -1039,7 +1039,7 @@ print_columns(struct shf *shf, int n, char *(*func) (void *, int, char *, int),
col_width,
(*func)(arg, i, str, max_width + 1));
if (c + 1 < cols)
- shf_fprintf(shf, "%*s", nspace, null);
+ shf_fprintf(shf, "%*s", nspace, "");
}
}
shf_putchar('\n', shf);