From 7a7250cdbdbd9f151d15fbe2142bde3a2dd81ca0 Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 27 Jul 2012 21:36:15 +0200 Subject: [PATCH] cleanup, use wl_cons() --- src/frontend/com_hardcopy.c | 4 +--- src/frontend/parser/lexical.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/frontend/com_hardcopy.c b/src/frontend/com_hardcopy.c index 212f46110..7daf2889a 100644 --- a/src/frontend/com_hardcopy.c +++ b/src/frontend/com_hardcopy.c @@ -144,9 +144,7 @@ com_hardcopy(wordlist *wl) buf2 = prompt(cp_in); if (!buf2) return; - wl = TMALLOC(struct wordlist, 1); - wl->wl_word = buf2; - wl->wl_next = NULL; + wl = wl_cons(buf2, NULL); wl = process(wl); } diff --git a/src/frontend/parser/lexical.c b/src/frontend/parser/lexical.c index 4b4159a74..44a4cf0b7 100644 --- a/src/frontend/parser/lexical.c +++ b/src/frontend/parser/lexical.c @@ -75,10 +75,8 @@ static int numeofs = 0; */ #define newword cw->wl_word = copy(buf); \ - cw->wl_next = alloc(struct wordlist); \ - cw->wl_next->wl_prev = cw; \ + wl_append(cw, wl_cons(NULL, NULL)); \ cw = cw->wl_next; \ - cw->wl_next = NULL; \ bzero(buf, NEW_BSIZE_SP); \ i = 0;