From fa9be4336a54558556147f28cfb9dfec47f7d7b2 Mon Sep 17 00:00:00 2001 From: rlar Date: Tue, 31 Jul 2012 20:40:40 +0200 Subject: [PATCH] lexical #16/19, transform append --> append(word) --- src/frontend/parser/lexical.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/frontend/parser/lexical.c b/src/frontend/parser/lexical.c index d2cd5ec87..d61998237 100644 --- a/src/frontend/parser/lexical.c +++ b/src/frontend/parser/lexical.c @@ -74,8 +74,8 @@ static int numeofs = 0; * have no business being in the string. */ -#define append \ - { wordlist *aux = wl_cons(NULL, NULL); \ +#define append(word) \ + { wordlist *aux = wl_cons(word, NULL); \ if (cw) \ cw->wl_next = aux; \ aux->wl_prev = cw; \ @@ -85,8 +85,7 @@ static int numeofs = 0; } #define newword \ - append; \ - cw->wl_word = copy(buf); \ + append(copy(buf)); \ bzero(buf, NEW_BSIZE_SP); \ i = 0; @@ -171,7 +170,7 @@ gotchar: if ((c == EOF) && cp_bqflag) c = '\n'; if ((c == cp_hash) && !cp_interactive && (j == 1)) { - append; + append(NULL); if (string) return (NULL); while (((c = input(cp_inp_cur)) != '\n') && (c != EOF)) @@ -198,7 +197,7 @@ gotchar: buf[i] = '\0'; newword; } - append; + append(NULL); if (cw->wl_prev) { cw->wl_prev->wl_next = NULL; tfree(cw); @@ -246,7 +245,7 @@ gotchar: case '\004': case EOF: - append; + append(NULL); if (cp_interactive && !cp_nocc && (string == NULL)) { if (j == 0) { @@ -293,7 +292,7 @@ gotchar: #else fputc(linebuf[j], cp_out); /* But you can't edit */ #endif - append; + append(NULL); // cp_ccom doesn't mess wlist, read only access to wlist->wl_word cp_ccom(wlist, buf, TRUE); wl_free(wlist);