diff options
author | jilles <jilles@FreeBSD.org> | 2015-02-15 21:47:43 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2015-02-15 21:47:43 +0000 |
commit | a0092595b982169cd521ba2b02e4bccef5235b4e (patch) | |
tree | 999b8055d2fa2e1f7fca45cdaba4917842dba200 | |
parent | 0dba15bee91300d5b8867055900ce2b9527313cf (diff) | |
download | FreeBSD-src-a0092595b982169cd521ba2b02e4bccef5235b4e.zip FreeBSD-src-a0092595b982169cd521ba2b02e4bccef5235b4e.tar.gz |
sh: Prefer "" to nullstr where possible.
-rw-r--r-- | bin/sh/cd.c | 2 | ||||
-rw-r--r-- | bin/sh/eval.c | 2 | ||||
-rw-r--r-- | bin/sh/expand.c | 3 | ||||
-rw-r--r-- | bin/sh/mail.c | 2 | ||||
-rw-r--r-- | bin/sh/miscbltin.c | 2 | ||||
-rw-r--r-- | bin/sh/nodetypes | 2 | ||||
-rw-r--r-- | bin/sh/parser.c | 2 | ||||
-rw-r--r-- | bin/sh/var.c | 2 |
8 files changed, 8 insertions, 9 deletions
diff --git a/bin/sh/cd.c b/bin/sh/cd.c index 017dfa1..88f03f5 100644 --- a/bin/sh/cd.c +++ b/bin/sh/cd.c @@ -122,7 +122,7 @@ cdcmd(int argc __unused, char **argv __unused) (dest[0] == '.' && (dest[1] == '/' || dest[1] == '\0')) || (dest[0] == '.' && dest[1] == '.' && (dest[2] == '/' || dest[2] == '\0')) || (path = bltinlookup("CDPATH", 1)) == NULL) - path = nullstr; + path = ""; while ((p = padvance(&path, dest)) != NULL) { if (stat(p, &statb) < 0) { if (errno != ENOENT) diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 486de9c..347824a 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -498,7 +498,7 @@ exphere(union node *redir, struct arglist *fn) struct localvar *savelocalvars; int need_longjmp = 0; - redir->nhere.expdoc = nullstr; + redir->nhere.expdoc = ""; savelocalvars = localvars; localvars = NULL; forcelocal++; diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 53b2c9b..6fa6d0d 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -530,8 +530,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, error((char *)NULL); } error("%.*s: parameter %snot set", (int)(p - str - 1), - str, (varflags & VSNUL) ? "null or " - : nullstr); + str, (varflags & VSNUL) ? "null or " : ""); return 0; case VSTRIMLEFT: diff --git a/bin/sh/mail.c b/bin/sh/mail.c index 597e733..720cab0 100644 --- a/bin/sh/mail.c +++ b/bin/sh/mail.c @@ -85,7 +85,7 @@ chkmail(int silent) setstackmark(&smark); mpath = mpathset()? mpathval() : mailval(); for (i = 0 ; i < nmboxes ; i++) { - p = padvance(&mpath, nullstr); + p = padvance(&mpath, ""); if (p == NULL) break; if (*p == '\0') diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index 027d8ae..715e324 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -265,7 +265,7 @@ readcmd(int argc __unused, char **argv __unused) /* Set any remaining args to "" */ while (*++ap != NULL) - setvar(*ap, nullstr, 0); + setvar(*ap, "", 0); return status; } diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes index 603c777..d480093 100644 --- a/bin/sh/nodetypes +++ b/bin/sh/nodetypes @@ -138,7 +138,7 @@ NXHERE nhere # fd<<! fd int # file descriptor being redirected next nodeptr # next redirection in list doc nodeptr # input to command (NARG node) - expdoc temp char *expdoc # actual document (for NXHERE) + expdoc temp const char *expdoc # actual document (for NXHERE) NNOT nnot # ! command (actually pipeline) type int diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 0048314..2bba84e 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -1940,7 +1940,7 @@ getprompt(void *unused __unused) */ switch (whichprompt) { case 0: - fmt = nullstr; + fmt = ""; break; case 1: fmt = ps1val(); diff --git a/bin/sh/var.c b/bin/sh/var.c index ebeff16..def1e0c 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -872,7 +872,7 @@ unsetvar(const char *s) if (vp->flags & VREADONLY) return (1); if (vp->text[vp->name_len + 1] != '\0') - setvar(s, nullstr, 0); + setvar(s, "", 0); if ((vp->flags & VEXPORT) && localevar(vp->text)) { change_env(s, 0); setlocale(LC_ALL, ""); |