diff options
| author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-12-04 19:57:41 +0100 | 
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-12-04 19:57:41 +0100 | 
| commit | 9f01cda55d519406248fc095667442575b7329f0 (patch) | |
| tree | 9533f890cd86b5f1dd612f3ae3c9a5becbdb080a /debian/patches/03_scanadf_options_fix.patch | |
| parent | 9d7b3dd818adbeb80fb7274e01be3a2e49f10f4e (diff) | |
Many work to make DebSrc3 fit
Diffstat (limited to 'debian/patches/03_scanadf_options_fix.patch')
| -rw-r--r-- | debian/patches/03_scanadf_options_fix.patch | 42 | 
1 files changed, 42 insertions, 0 deletions
| diff --git a/debian/patches/03_scanadf_options_fix.patch b/debian/patches/03_scanadf_options_fix.patch new file mode 100644 index 0000000..8c1b0c7 --- /dev/null +++ b/debian/patches/03_scanadf_options_fix.patch @@ -0,0 +1,42 @@ +Author: <jblache@debian.org> +Description: Get option descriptor 0 before getting the value for option 0. +Index: trunk/src/scanadf.c +=================================================================== +--- trunk.orig/src/scanadf.c ++++ trunk/src/scanadf.c +@@ -550,15 +550,33 @@ fetch_options (SANE_Device * device) +   const SANE_Option_Descriptor * opt; +   SANE_Int num_dev_options; +   int i, option_count; ++  SANE_Status status; +  +   /* and now build the full table of long options: */ +  +-  sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_dev_options, 0); ++  opt = sane_get_option_descriptor (device, 0); ++  if (opt == NULL) ++    { ++      fprintf (stderr, "Could not get option descriptor for option 0\n"); ++      exit (1); ++    } ++ ++  status = sane_control_option (device, 0, SANE_ACTION_GET_VALUE, &num_dev_options, 0); ++  if (status != SANE_STATUS_GOOD) ++    { ++      fprintf (stderr, "Could not get value for option 0: %s\n", sane_strstatus (status)); ++      exit (1); ++    } +  +   option_count = 0; +-  for (i = 0; i < num_dev_options; ++i) ++  for (i = 1; i < num_dev_options; ++i) +     { +       opt = sane_get_option_descriptor (device, i); ++      if (opt == NULL) ++	{ ++	  fprintf (stderr, "Could not get option descriptor for option %d\n", i); ++	  exit (1); ++	} +  +       if (!SANE_OPTION_IS_SETTABLE (opt->cap)) + 	continue; | 
