looks good to me, any other ok?
null is serious poo and really needs to go as well
On Thu, Sep 10, 2015 at 10:45:46AM -0400, Michael McConville wrote:
> Does this look good? I'm not sure why these globals existed.
>
> It looks like it's going to take a little more than search-and-replace
> to remove null.
>
>
> Index: c_ksh.c
> ===
> RCS file: /cvs/src/bin/ksh/c_ksh.c,v
> retrieving revision 1.36
> diff -u -p -r1.36 c_ksh.c
> --- c_ksh.c 8 Sep 2015 11:35:57 - 1.36
> +++ c_ksh.c 10 Sep 2015 14:37:54 -
> @@ -515,7 +515,7 @@ c_whence(char **wp)
> break;
> }
> if (vflag || !ret)
> - shprintf(newline);
> + shprintf("\n");
> }
> return ret;
> }
> @@ -816,7 +816,7 @@ c_typeset(char **wp)
> else
>
> print_value_quoted(s);
> }
> - shprintf(newline);
> + shprintf("\n");
> }
> /* Only report first `element' of an
> array with
> * no set elements.
> @@ -906,7 +906,7 @@ c_alias(char **wp)
> shf_putc('=', shl_stdout);
> print_value_quoted(ap->val.s);
> }
> - shprintf(newline);
> + shprintf("\n");
> }
> }
>
> @@ -930,7 +930,7 @@ c_alias(char **wp)
> shf_putc('=', shl_stdout);
> print_value_quoted(ap->val.s);
> }
> - shprintf(newline);
> + shprintf("\n");
> } else {
> shprintf("%s alias not found\n", alias);
> rv = 1;
> @@ -1184,10 +1184,10 @@ c_kill(char **wp)
> }
> } else if (Flag(FPOSIX)) {
> p = null;
> - for (i = 1; i < NSIG; i++, p = space)
> + for (i = 1; i < NSIG; i++, p = " ")
> if (sigtraps[i].name)
> shprintf("%s%s", p, sigtraps[i].name);
> - shprintf(newline);
> + shprintf("\n");
> } else {
> int w, i;
> int mess_width;
> Index: emacs.c
> ===
> RCS file: /cvs/src/bin/ksh/emacs.c,v
> retrieving revision 1.51
> diff -u -p -r1.51 emacs.c
> --- emacs.c 1 Sep 2015 13:12:31 - 1.51
> +++ emacs.c 10 Sep 2015 14:37:54 -
> @@ -1758,7 +1758,7 @@ x_expand(int c)
> x_delete(end - start, false);
> for (i = 0; i < nwords;) {
> if (x_escape(words[i], strlen(words[i]), x_emacs_putbuf) < 0 ||
> - (++i < nwords && x_ins(space) < 0)) {
> + (++i < nwords && x_ins(" ") < 0)) {
> x_e_putc(BEL);
> return KSTD;
> }
> @@ -1806,7 +1806,7 @@ do_complete(int flags, /* XCF_{COMMAND,F
> }
> /* add space if single non-dir match */
> if (nwords == 1 && words[0][nlen - 1] != '/') {
> - x_ins(space);
> + x_ins(" ");
> completed = 1;
> }
>
> @@ -1914,7 +1914,7 @@ x_debug_info(int c)
> shellf("\txbp == 0x%lx,\txbuf == 0x%lx\n", (long) xbp, (long) xbuf);
> shellf("\txlp == 0x%lx\n", (long) xlp);
> shellf("\txlp == 0x%lx\n", (long) x_lastcp());
> - shellf(newline);
> + shellf("\n");
> x_redraw(-1);
> return 0;
> }
> Index: exec.c
> ===
> RCS file: /cvs/src/bin/ksh/exec.c,v
> retrieving revision 1.51
> diff -u -p -r1.51 exec.c
> --- exec.c18 Apr 2015 18:28:36 - 1.51
> +++ exec.c10 Sep 2015 14:37:54 -
> @@ -83,7 +83,7 @@ execute(struct op *volatile t,
> PS4_SUBSTITUTE(str_val(global("PS4";
> for (i = 0; ap[i]; i++)
> shf_fprintf(shl_out, "%s%s", ap[i],
> - ap[i + 1] ? space : newline);
> + ap[i + 1] ? " " : "\n");
> shf_flush(shl_out);
> }
> if (ap[0])
> @@ -499,7 +499,7 @@ comexec(struct op *t, struct tbl *volati
> shf_fprintf(shl_out, "%s",
>