From c5f9d0d7112ffb103c37c74deadde3971ca55c50 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sat, 31 Jul 2004 17:26:02 +0000 Subject: [PATCH] * frontend/scanimage.c: Added the possibility to cleanly stop a batch by pressing Ctrl+D when using --batch-prompt. --- ChangeLog | 4 ++++ frontend/scanimage.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9bb350619..2d0ab7460 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-07-31 Julien Blache + * frontend/scanimage.c: Added the possibility to cleanly stop a + batch by pressing Ctrl+D when using --batch-prompt. + 2004-07-28 Gerard Klaver * doc/descriptions/unsupported.desc: Added Logitech PageScan USB and diff --git a/frontend/scanimage.c b/frontend/scanimage.c index bd2741276..a73285a21 100644 --- a/frontend/scanimage.c +++ b/frontend/scanimage.c @@ -1983,7 +1983,16 @@ List of available devices:", prog_name); { fprintf (stderr, "Place document no. %d on the scanner.\n", n); fprintf (stderr, "Press to continue.\n"); + fprintf (stderr, "Press Ctrl + D to terminate.\n"); readbuf2=fgets(readbuf, 2, stdin); + + if (readbuf2 == NULL) + { + fprintf (stderr, "Batch terminated, %d pages scanned\n", (n - batch_increment)); + fclose (stdout); + unlink (path); + break; /* get out of this loop */ + } } fprintf (stderr, "Scanning page %d\n", n); }