diff --git a/src/frontend/parser/complete.c b/src/frontend/parser/complete.c index c87026446..5bf730739 100644 --- a/src/frontend/parser/complete.c +++ b/src/frontend/parser/complete.c @@ -94,11 +94,11 @@ cp_ccom(wordlist *wlist, char *buf, bool esc) buf = cp_unquote(copy(buf)); cp_wstrip(buf); - if (wlist->wl_next) { /* Not the first word. */ + if (wlist) { /* Not the first word. */ cc = getccom(wlist->wl_word); if (cc && cc->cc_invalid) cc = NULL; - arg = wl_length(wlist) - 2; + arg = wl_length(wlist) - 1; if (arg > 3) arg = 3; /* First filenames. */ diff --git a/src/frontend/parser/lexical.c b/src/frontend/parser/lexical.c index 8d7d8aeba..3b93c6c1b 100644 --- a/src/frontend/parser/lexical.c +++ b/src/frontend/parser/lexical.c @@ -256,7 +256,6 @@ gotchar: goto done; } // cp_ccom doesn't mess wlist, read only access to wlist->wl_word - append(NULL); cp_ccom(wlist, buf, FALSE); wl_free(wlist); (void) fputc('\r', cp_out); @@ -291,7 +290,6 @@ gotchar: #else fputc(linebuf[j], cp_out); /* But you can't edit */ #endif - append(NULL); // cp_ccom doesn't mess wlist, read only access to wlist->wl_word cp_ccom(wlist, buf, TRUE); wl_free(wlist);