kopia lustrzana https://gitlab.com/sane-project/backends
Don't create and delete a file in batch mode if the document feeder is empty or
if CTRL-D is pressed in prompt mode. This change avoids deleting existing files. For an explanation, see bug #302797.merge-requests/1/head
rodzic
7b03fc2168
commit
56ba575749
|
@ -16,6 +16,10 @@
|
|||
doc/sane-test.man doc/descriptions/test.desc:
|
||||
Added option "source" which can be used to simulate an Automatic
|
||||
Document Feeder (ADF). Added copyright header to test.h.
|
||||
* frontend/scanimage.c: Don't create and delete a file in batch
|
||||
mode if the document feeder is empty or if CTRL-D is pressed in
|
||||
prompt mode. This change avoids deleting existing files. For an
|
||||
explanation, see bug #302797.
|
||||
|
||||
2006-01-01 Oliver Schwartz <Oliver.Schwartz@gmx.de>
|
||||
|
||||
|
|
|
@ -1143,12 +1143,15 @@ scan_it (void)
|
|||
|
||||
do
|
||||
{
|
||||
status = sane_start (device);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
if (!first_frame)
|
||||
{
|
||||
fprintf (stderr, "%s: sane_start: %s\n",
|
||||
prog_name, sane_strstatus (status));
|
||||
goto cleanup;
|
||||
status = sane_start (device);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
fprintf (stderr, "%s: sane_start: %s\n",
|
||||
prog_name, sane_strstatus (status));
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
status = sane_get_parameters (device, &parm);
|
||||
|
@ -2114,11 +2117,6 @@ List of available devices:", prog_name);
|
|||
if (batch) /* format is NULL unless batch mode */
|
||||
sprintf (path, format, n); /* love --(C++) */
|
||||
|
||||
if (batch && NULL == freopen (path, "w", stdout))
|
||||
{
|
||||
fprintf (stderr, "cannot open %s\n", path);
|
||||
return SANE_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if (batch)
|
||||
{
|
||||
|
@ -2135,12 +2133,28 @@ List of available devices:", prog_name);
|
|||
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);
|
||||
}
|
||||
|
||||
status = sane_start (device);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
fprintf (stderr, "%s: sane_start: %s\n",
|
||||
prog_name, sane_strstatus (status));
|
||||
fclose (stdout);
|
||||
break;
|
||||
}
|
||||
|
||||
if (batch && NULL == freopen (path, "w", stdout))
|
||||
{
|
||||
fprintf (stderr, "cannot open %s\n", path);
|
||||
sane_cancel (device);
|
||||
return SANE_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
status = scan_it ();
|
||||
if (batch)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue