The YesNo() routine uses buffer rather than buffer2, so the yes-no problem is really caused by the line that checks to see whether or not the reading a command activity is going on, not by any deeper issue.
Would it be possible to solve the buffer2 issue by hacking VM_ReadKeyboard to store a reference to the passed array as a global? (VM_ReadKeyboard is also used for the disambiguation questions. The temporary variable that represents the buffer array in VM_ReadKeyboard is a_buffer.) These two lines could then refer to that global:
To re-request line event in main window:
(- glk_request_line_event(gg_mainwin, global
+ WORDSIZE, INPUT_BUFFER_LEN - WORDSIZE, global
To cancel line input in the/-- main-window:
(- glk_cancel_line_event(gg_mainwin, gg_event); global
-->0 = gg_event-->2; -)
I'm not sure how to do this, though--would it be a pointer? (This--pointers, stacks, memory management--is where my lack of knowledge of C and real programming in general *really* ducks in to bite me!)
Alternatively, surrounding the code that generates disambiguation input with flags and then testing for those when the timed event fires might also work, e.g.:
disambiguating = true;
disambiguating = false;
When disambiguating is true, we use alternate versions of the cancel line input and re-request input phrases.