Package: bc
Version: 1.07.1-3+b1
Followup-For: Bug #1028485
X-Debbugs-Cc: krzpyrk...@gmail.com

Dear Maintainer,
The source of the problem is misplaced rl_initialize() in the SIGINT
handler in the debian/patches/05_notice_read_write_errors.diff patch.

Bc is compiled with DONTEXIT macro defined. In the current form, the
buffer cleaning routine is never executed (in fact, it never worked,
since it's just above bc_exit(0)... ). The handler that does the job
is:

void
use_quit (int sig)
{
#ifdef DONTEXIT
  int save = errno;
  write (1, "\n(interrupt) use quit to exit.\n", 31);
#ifdef READLINE
  rl_initialize (); /* Clear readline buffer */
#endif
  signal (SIGINT, use_quit);
  errno = save;
#else
  write (1, "\n(interrupt) Exiting bc.\n", 26);
  bc_exit(0);
#endif
}

I moved the piece of code between #ifdef READLINE #endif from the #else
branch to #ifdef DONTEXIT.
This change solves #1028485, #1037008, #932490.

Regards,
Krzysztof

Reply via email to