Prevent a segfault if cp_variablesubst return a nullptr.

Fixes bug-801
This commit is contained in:
Holger Vogt 2025-08-18 23:49:53 +02:00
parent a003159d53
commit 5139cbb36c
1 changed files with 4 additions and 0 deletions

View File

@ -147,6 +147,10 @@ docommand(wordlist *wlist)
/* Do all the things that used to be done by cshpar when the line
* was read... */
wlist = cp_variablesubst(wlist);
if (!wlist || !wlist->wl_word)
return;
pwlist(wlist, "After variable substitution");
wlist = cp_bquote(wlist);