Skip to content

Commit

Permalink
Fix crash in nfe_input
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryHRich committed Dec 25, 2024
1 parent ab75fac commit 42a134f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jsrc/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ void breakclose(JS jt);
// result is NUL-terminated string which is on the tstack
// We echo the string before returning
static C* nfeinput(JS jt,C* s){A y;
WITHATTNDISABLED(y=jtstr0(MDTHREAD(jt),jtexec1(MDTHREAD(jt),jtcstr(MDTHREAD(jt),s),ds(CEXEC)));) // exec the sentence with break interrupts disabled to get the string; NUL-terminate
// obsolete WITHATTNDISABLED(y=jtstr0(MDTHREAD(jt),jtexec1(MDTHREAD(jt),jtcstr(MDTHREAD(jt),s),ds(CEXEC)));) // exec the sentence with break interrupts disabled to get the string; NUL-terminate
WITHATTNDISABLED(y=jtstr0(MDTHREAD(jt),PARSERVALUE(jtparse((JTT*)((I)MDTHREAD(jt)|JTFROMEXEC),jtddtokens(MDTHREAD(jt),jtcstr(MDTHREAD(jt),s),4+1+0))));); // replace DDs, but require that they be complete within the string (no jgets); 0 is !!EXPLICITRUNNING; execute, NUL-terminate

if(!y){breakclose(jt);exit(2);} /* J input verb failed */
jtwri(jt,MTYOLOG,"",AN(y)-1,CAV(y)); // call to nfeinput() comes from a prompt or from jdo. In either case we want to display the result. Thus jt
return CAV(y); /* don't combine with previous line! CAV runs (x) 2 times! */
Expand Down

0 comments on commit 42a134f

Please sign in to comment.