summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/00list8
-rw-r--r--debian/patches/01_printing_defaults.dpatch21
-rw-r--r--debian/patches/02_docviewer.dpatch37
-rw-r--r--debian/patches/03_gimp_acquire_menu.dpatch39
-rw-r--r--debian/patches/04_inhibit_clickthrough.dpatch59
-rw-r--r--debian/patches/05_options_handling_fix.dpatch242
-rw-r--r--debian/patches/06_fix_pdf_xref.dpatch21
-rw-r--r--debian/patches/10_broken_links.dpatch20
8 files changed, 447 insertions, 0 deletions
diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644
index 0000000..3d24b66
--- /dev/null
+++ b/debian/patches/00list
@@ -0,0 +1,8 @@
+01_printing_defaults
+02_docviewer
+03_gimp_acquire_menu
+04_inhibit_clickthrough
+05_options_handling_fix
+06_fix_pdf_xref
+10_broken_links
+
diff --git a/debian/patches/01_printing_defaults.dpatch b/debian/patches/01_printing_defaults.dpatch
new file mode 100644
index 0000000..7f037bc
--- /dev/null
+++ b/debian/patches/01_printing_defaults.dpatch
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_printing_defaults.dpatch by <jblache@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Change default printing options, switch from lpr to lp.
+
+@DPATCH@
+diff -urNad xsane-0.995~/src/xsane.h xsane-0.995/src/xsane.h
+--- xsane-0.995~/src/xsane.h 2008-09-08 11:02:36.000000000 +0200
++++ xsane-0.995/src/xsane.h 2008-09-08 11:03:17.191704659 +0200
+@@ -510,8 +510,8 @@
+
+ #define OUT_FILENAME "out.pnm"
+ #define PRINTERNAME "new printer"
+-#define PRINTERCOMMAND "lpr"
+-#define PRINTERCOPYNUMBEROPTION "-#"
++#define PRINTERCOMMAND "lp"
++#define PRINTERCOPYNUMBEROPTION "-n"
+ #define FAXPROJECT "faxproject"
+ #define FAXCOMMAND "sendfax"
+ #define FAXRECEIVEROPT "-d"
diff --git a/debian/patches/02_docviewer.dpatch b/debian/patches/02_docviewer.dpatch
new file mode 100644
index 0000000..8dd70e8
--- /dev/null
+++ b/debian/patches/02_docviewer.dpatch
@@ -0,0 +1,37 @@
+#!/bin/sh -e
+## 02_docviewer.dpatch.dpatch by Aurelien Jarno <aurel32@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Change default browser to /usr/bin/sensible-browser.
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad xsane-0.995~/src/xsane.h xsane-0.995/src/xsane.h
+--- xsane-0.995~/src/xsane.h 2007-08-13 09:20:32.000000000 +0200
++++ xsane-0.995/src/xsane.h 2007-11-22 11:24:15.068421579 +0100
+@@ -251,7 +251,7 @@
+ # elif defined(HAVE_OS2_H)
+ # define DEFAULT_BROWSER "netscape"
+ # else
+-# define DEFAULT_BROWSER "netscape"
++# define DEFAULT_BROWSER "/usr/bin/sensible-browser"
+ # endif
+ #endif
+
diff --git a/debian/patches/03_gimp_acquire_menu.dpatch b/debian/patches/03_gimp_acquire_menu.dpatch
new file mode 100644
index 0000000..0909faf
--- /dev/null
+++ b/debian/patches/03_gimp_acquire_menu.dpatch
@@ -0,0 +1,39 @@
+#!/bin/sh -e
+## 03_gimp_acquire_menu.dpatch.dpatch by Aurelien Jarno <aurel32@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Group XSane actions in their own submenu in the Acquire menu.
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad xsane-0.995~/src/xsane-text.h xsane-0.995/src/xsane-text.h
+--- xsane-0.995~/src/xsane-text.h 2007-08-13 09:16:43.000000000 +0200
++++ xsane-0.995/src/xsane-text.h 2007-11-22 11:24:49.170421498 +0100
+@@ -869,8 +869,8 @@
+ #define XSANE_GIMP_INSTALL_HELP _("This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface.")
+
+ /* Menu path must not be translated, this is done by the gimp. Only translate the text behind the last "/" */
+-#define XSANE_GIMP_MENU_DIALOG _("<Toolbox>/File/Acquire/XSane: Device dialog...")
+-#define XSANE_GIMP_MENU _("<Toolbox>/File/Acquire/XSane: ")
++#define XSANE_GIMP_MENU_DIALOG _("<Toolbox>/File/Acquire/XSane/Device dialog...")
++#define XSANE_GIMP_MENU _("<Toolbox>/File/Acquire/XSane/")
+ #define XSANE_GIMP_MENU_DIALOG_OLD _("<Toolbox>/Xtns/XSane/Device dialog...")
+ #define XSANE_GIMP_MENU_OLD _("<Toolbox>/Xtns/XSane/")
+
diff --git a/debian/patches/04_inhibit_clickthrough.dpatch b/debian/patches/04_inhibit_clickthrough.dpatch
new file mode 100644
index 0000000..d38727b
--- /dev/null
+++ b/debian/patches/04_inhibit_clickthrough.dpatch
@@ -0,0 +1,59 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_inhibit_clickthrough.dpatch by <jblache@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Finally give up and inhibit the license clickthrough.
+
+@DPATCH@
+diff -urNad xsane-0.995~/src/xsane.c xsane-0.995/src/xsane.c
+--- xsane-0.995~/src/xsane.c 2007-09-28 17:24:56.000000000 +0200
++++ xsane-0.995/src/xsane.c 2008-04-11 18:56:55.120439147 +0200
+@@ -1901,11 +1901,11 @@
+ /* ---------------------------------------------------------------------------------------------------------------------- */
+
+ static int xsane_pref_restore(void)
+-/* returns true if this is the first time this xsane version is called */
++/* Originally: returns true if this is the first time this xsane version is called */
+ {
+ char filename[PATH_MAX];
+ int fd;
+- int result = TRUE;
++ int result = FALSE;
+ int i;
+
+ DBG(DBG_proc, "xsane_pref_restore\n");
+@@ -1919,6 +1919,7 @@
+ preferences_restore(fd);
+ close(fd);
+
++#if 0
+ /* the version test only is done for the local xsane.rc file because each user */
+ /* shall accept (or not) the license for xsane */
+ if (preferences.xsane_version_str)
+@@ -1928,6 +1929,7 @@
+ result = FALSE; /* this version already has been started */
+ }
+ }
++#endif /* 0 */
+ }
+ else /* no local sane file, look for system file */
+ {
+@@ -5795,7 +5797,10 @@
+ xsane.xsane_rc_set_filename = strdup("xsane"); /* ".rc" is appended later */
+ }
+
++ xsane_pref_restore();
++ xsane_pref_save();
+
++#if 0 /* Original XSane code */
+ if (xsane_pref_restore()) /* restore preferences, returns TRUE if license is not accpted yet */
+ {
+ if (xsane_display_eula(1)) /* show license and ask for accept/not accept */
+@@ -5808,6 +5813,7 @@
+ xsane_pref_save();
+ }
+ }
++#endif /* Original XSane code */
+
+ xsane_pref_restore_media();
+
diff --git a/debian/patches/05_options_handling_fix.dpatch b/debian/patches/05_options_handling_fix.dpatch
new file mode 100644
index 0000000..31619f7
--- /dev/null
+++ b/debian/patches/05_options_handling_fix.dpatch
@@ -0,0 +1,242 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_options_handling_fix.dpatch by <jblache@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Duplicate string values for options with constraint type of
+## DP: SANE_CONSTRAINT_STRING_LIST. The string list is not guaranteed to
+## DP: be stable, and actually isn't stable when the net backend is used.
+
+@DPATCH@
+diff -urNad xsane-0.995~/src/xsane-back-gtk.c xsane-0.995/src/xsane-back-gtk.c
+--- xsane-0.995~/src/xsane-back-gtk.c 2008-07-25 18:53:38.000000000 +0200
++++ xsane-0.995/src/xsane-back-gtk.c 2008-07-25 18:53:45.764102480 +0200
+@@ -2226,11 +2226,13 @@
+ /* ----------------------------------------------------------------------------------------------------------------- */
+
+ void xsane_back_gtk_option_menu_new(GtkWidget *parent, const char *name, char *str_list[],
+- const char *val, DialogElement *elem,
++ const char *val, SANE_Constraint_Type constraint_type, DialogElement *elem,
+ GtkTooltips *tooltips, const char *desc, SANE_Int settable)
+ {
+ GtkWidget *hbox, *label, *option_menu, *menu, *item;
+ MenuItem *menu_items;
++ int dup_string;
++ char *strval;
+ int i, num_items;
+
+ DBG(DBG_proc, "xsane_back_gtk_option_menu_new(%s)\n", name);
+@@ -2248,16 +2250,23 @@
+
+ menu_items = malloc((num_items + 1) * sizeof(menu_items[0]));
+
++ dup_string = (constraint_type == SANE_CONSTRAINT_STRING_LIST);
++
+ menu = gtk_menu_new();
+ for (i = 0; i < num_items; ++i)
+ {
+- item = gtk_menu_item_new_with_label(_BGT(str_list[i]));
++ if (dup_string)
++ strval = strdup(str_list[i]);
++ else
++ strval = str_list[i];
++
++ item = gtk_menu_item_new_with_label(_BGT(strval));
+ gtk_container_add(GTK_CONTAINER(menu), item);
+ g_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_back_gtk_option_menu_callback, menu_items + i);
+
+ gtk_widget_show(item);
+
+- menu_items[i].label = str_list[i];
++ menu_items[i].label = strval;
+ menu_items[i].elem = elem;
+ menu_items[i].index = i;
+ }
+@@ -2403,14 +2412,15 @@
+ xsane.standard_hbox = NULL;
+ xsane.advanced_hbox = NULL;
+
+- /* free the menu labels of integer/fix-point word-lists: */
++ /* free the menu labels */
+ for (i = 0; i < xsane.num_elements; ++i)
+ {
+ if (xsane.element[i].menu)
+ {
+ opt = xsane_get_option_descriptor(xsane.dev, i);
+ elem = xsane.element + i;
+- if (opt->type != SANE_TYPE_STRING)
++ if ((opt->type != SANE_TYPE_STRING)
++ || (opt->constraint_type == SANE_CONSTRAINT_STRING_LIST))
+ {
+ for (j = 0; j < elem->menu_size; ++j)
+ {
+diff -urNad xsane-0.995~/src/xsane-back-gtk.h xsane-0.995/src/xsane-back-gtk.h
+--- xsane-0.995~/src/xsane-back-gtk.h 2008-07-25 18:53:38.000000000 +0200
++++ xsane-0.995/src/xsane-back-gtk.h 2008-07-25 18:53:45.764102480 +0200
+@@ -117,7 +117,7 @@
+ gfloat quant, int automatic,
+ DialogElement *elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
+ extern void xsane_back_gtk_option_menu_new(GtkWidget *parent, const char *name, char *str_list[],
+- const char *val, DialogElement *elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
++ const char *val, SANE_Constraint_Type constraint_type, DialogElement *elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
+ extern void xsane_back_gtk_text_entry_new(GtkWidget *parent, const char *name, const char *val,
+ DialogElement *elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
+ extern void xsane_back_gtk_push_button_callback(GtkWidget *widget, gpointer data);
+diff -urNad xsane-0.995~/src/xsane-front-gtk.c xsane-0.995/src/xsane-front-gtk.c
+--- xsane-0.995~/src/xsane-front-gtk.c 2008-07-25 18:53:38.000000000 +0200
++++ xsane-0.995/src/xsane-front-gtk.c 2008-07-25 18:53:58.887267644 +0200
+@@ -64,10 +64,10 @@
+ int *state, void *xsane_toggle_button_callback);
+ GtkWidget *xsane_button_new_with_pixmap(GdkWindow *window, GtkWidget *parent, const char *xpm_d[], const char *desc,
+ void *xsane_button_callback, gpointer data);
+-void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, int option_number, const char *desc,
++void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, SANE_Constraint_Type constraint_type, int option_number, const char *desc,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+ void xsane_option_menu_new_with_pixmap(GdkWindow *window, GtkBox *parent, const char *xpm_d[], const char *desc,
+- char *str_list[], const char *val,
++ char *str_list[], const char *val, SANE_Constraint_Type constraint_type,
+ GtkWidget **data, int option,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+ void xsane_range_new(GtkBox *parent, char *labeltext, const char *desc,
+@@ -1007,12 +1007,14 @@
+
+ /* ---------------------------------------------------------------------------------------------------------------------- */
+
+-void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, int option_number, const char *desc,
++void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, SANE_Constraint_Type constraint_type, int option_number, const char *desc,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name)
+ {
+ GtkWidget *option_menu, *menu, *item;
+ MenuItem *menu_items;
+ DialogElement *elem;
++ int dup_string;
++ char *strval;
+ int i, num_items;
+
+ DBG(DBG_proc, "xsane_option_menu_new\n");
+@@ -1031,9 +1033,16 @@
+ gtk_widget_set_name(menu, widget_name);
+ }
+
++ dup_string = (constraint_type == SANE_CONSTRAINT_STRING_LIST);
++
+ for (i = 0; i < num_items; ++i)
+ {
+- item = gtk_menu_item_new_with_label(_BGT(str_list[i]));
++ if (dup_string)
++ strval = strdup(str_list[i]);
++ else
++ strval = str_list[i];
++
++ item = gtk_menu_item_new_with_label(_BGT(strval));
+ gtk_container_add(GTK_CONTAINER(menu), item);
+
+ if (option_menu_callback)
+@@ -1047,7 +1056,7 @@
+
+ gtk_widget_show(item);
+
+- menu_items[i].label = str_list[i];
++ menu_items[i].label = strval;
+ menu_items[i].elem = elem;
+ menu_items[i].index = i;
+ }
+@@ -1075,7 +1084,7 @@
+ /* ---------------------------------------------------------------------------------------------------------------------- */
+
+ void xsane_option_menu_new_with_pixmap(GdkWindow *window, GtkBox *parent, const char *xpm_d[], const char *desc,
+- char *str_list[], const char *val,
++ char *str_list[], const char *val, SANE_Constraint_Type constraint_type,
+ GtkWidget **data, int option,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name)
+ {
+@@ -1094,7 +1103,7 @@
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+ gtk_widget_show(pixmapwidget);
+
+- xsane_option_menu_new(hbox, str_list, val, option, desc, option_menu_callback, settable, widget_name);
++ xsane_option_menu_new(hbox, str_list, val, constraint_type, option, desc, option_menu_callback, settable, widget_name);
+ gtk_widget_show(hbox);
+ }
+
+diff -urNad xsane-0.995~/src/xsane-front-gtk.h xsane-0.995/src/xsane-front-gtk.h
+--- xsane-0.995~/src/xsane-front-gtk.h 2008-07-25 18:53:38.000000000 +0200
++++ xsane-0.995/src/xsane-front-gtk.h 2008-07-25 18:53:45.768101033 +0200
+@@ -54,10 +54,10 @@
+ extern GtkWidget *xsane_button_new_with_pixmap(GdkWindow *window, GtkWidget *parent, const char *xpm_d[], const char *desc,
+ void *xsane_button_callback, gpointer data);
+ extern void xsane_pixmap_new(GtkWidget *parent, char *title, int width, int height, XsanePixmap *hist);
+-extern void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, int option_number, const char *desc,
++extern void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, SANE_Constraint_Type constraint_type, int option_number, const char *desc,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+ extern void xsane_option_menu_new_with_pixmap(GdkWindow *window, GtkBox *parent, const char *xpm_d[], const char *desc,
+- char *str_list[], const char *val,
++ char *str_list[], const char *val, SANE_Constraint_Type constraint_type,
+ GtkWidget **data, int option,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+ extern void xsane_range_new(GtkBox *parent, char *labeltext, const char *desc,
+diff -urNad xsane-0.995~/src/xsane.c xsane-0.995/src/xsane.c
+--- xsane-0.995~/src/xsane.c 2008-07-25 18:53:45.132101694 +0200
++++ xsane-0.995/src/xsane.c 2008-07-25 18:53:45.772100494 +0200
+@@ -876,7 +876,7 @@
+ str_list[j] = 0;
+ sprintf(str, "%d", (int) val);
+
+- xsane_option_menu_new_with_pixmap(xsane.xsane_window->window, GTK_BOX(parent), image_xpm, desc, str_list, str, &resolution_widget, well_known_option,
++ xsane_option_menu_new_with_pixmap(xsane.xsane_window->window, GTK_BOX(parent), image_xpm, desc, str_list, str, opt->constraint_type, &resolution_widget, well_known_option,
+ xsane_resolution_list_callback, SANE_OPTION_IS_SETTABLE(opt->cap), widget_name);
+
+ free(str_list);
+@@ -931,7 +931,7 @@
+
+
+ xsane_option_menu_new_with_pixmap(xsane.xsane_window->window, GTK_BOX(parent), image_xpm, desc,
+- str_list, str, &resolution_widget, well_known_option,
++ str_list, str, opt->constraint_type, &resolution_widget, well_known_option,
+ xsane_resolution_list_callback, SANE_OPTION_IS_SETTABLE(opt->cap), widget_name);
+ free(str_list);
+ }
+@@ -1490,7 +1490,7 @@
+ set = malloc(opt->size);
+ status = xsane_control_option(xsane.dev, xsane.well_known.scansource, SANE_ACTION_GET_VALUE, set, 0);
+
+- xsane_option_menu_new(hbox, (char **) opt->constraint.string_list, set, xsane.well_known.scansource,
++ xsane_option_menu_new(hbox, (char **) opt->constraint.string_list, set, opt->constraint_type, xsane.well_known.scansource,
+ _BGT(opt->desc), 0, SANE_OPTION_IS_SETTABLE(opt->cap), 0);
+ }
+ break;
+@@ -1529,7 +1529,7 @@
+ set = malloc(opt->size);
+ status = xsane_control_option(xsane.dev, xsane.well_known.scanmode, SANE_ACTION_GET_VALUE, set, 0);
+
+- xsane_option_menu_new(hbox, (char **) opt->constraint.string_list, set, xsane.well_known.scanmode,
++ xsane_option_menu_new(hbox, (char **) opt->constraint.string_list, set, opt->constraint_type, xsane.well_known.scanmode,
+ _BGT(opt->desc), xsane_scanmode_menu_callback, SANE_OPTION_IS_SETTABLE(opt->cap), 0);
+ }
+ break;
+@@ -4635,7 +4635,7 @@
+ }
+ str_list[j] = 0;
+ sprintf(str, "%d", val);
+- xsane_back_gtk_option_menu_new(parent, title, str_list, str, elem, xsane.tooltips, _BGT(opt->desc),
++ xsane_back_gtk_option_menu_new(parent, title, str_list, str, opt->constraint_type, elem, xsane.tooltips, _BGT(opt->desc),
+ SANE_OPTION_IS_SETTABLE(opt->cap));
+ free(str_list);
+ gtk_widget_show(parent->parent);
+@@ -4733,7 +4733,7 @@
+ }
+ str_list[j] = 0;
+ sprintf(str, "%g", SANE_UNFIX(val));
+- xsane_back_gtk_option_menu_new(parent, title, str_list, str, elem, xsane.tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
++ xsane_back_gtk_option_menu_new(parent, title, str_list, str, opt->constraint_type, elem, xsane.tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ free (str_list);
+ gtk_widget_show(parent->parent);
+ }
+@@ -4770,7 +4770,7 @@
+ (strcmp (opt->name, SANE_NAME_SCAN_SOURCE) != 0) ) /* do not show scansource */
+ {
+ /* use a "list-selection" widget */
+- xsane_back_gtk_option_menu_new(parent, title, (char **) opt->constraint.string_list, buf,
++ xsane_back_gtk_option_menu_new(parent, title, (char **) opt->constraint.string_list, buf, opt->constraint_type,
+ elem, xsane.tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ gtk_widget_show (parent->parent);
+ }
diff --git a/debian/patches/06_fix_pdf_xref.dpatch b/debian/patches/06_fix_pdf_xref.dpatch
new file mode 100644
index 0000000..60cc285
--- /dev/null
+++ b/debian/patches/06_fix_pdf_xref.dpatch
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 06_fix_pdf_xref.dpatch by <jblache@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Mark non-existent objects as free in the xref table.
+
+@DPATCH@
+diff -urNad xsane-0.995~/src/xsane-multipage-project.c xsane-0.995/src/xsane-multipage-project.c
+--- xsane-0.995~/src/xsane-multipage-project.c 2007-05-17 14:57:31.000000000 +0200
++++ xsane-0.995/src/xsane-multipage-project.c 2008-09-17 21:54:28.871207862 +0200
+@@ -973,6 +973,10 @@
+ else if (output_format == XSANE_PDF)
+ {
+ xsane_save_pdf_create_document_header(outfile, &xref, pages, preferences.save_pdf_flatedecoded);
++
++ /* Objects 4 and 5 are unused and do not exist */
++ xref.obj[4] = 0;
++ xref.obj[5] = 0;
+ }
+ }
+ #ifdef HAVE_LIBTIFF
diff --git a/debian/patches/10_broken_links.dpatch b/debian/patches/10_broken_links.dpatch
new file mode 100644
index 0000000..8e30119
--- /dev/null
+++ b/debian/patches/10_broken_links.dpatch
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_broken_links.dpatch by <jblache@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix broken links in HTML documentation.
+
+@DPATCH@
+diff -urNad xsane-0.995~/doc/sane-xsane-doc.html xsane-0.995/doc/sane-xsane-doc.html
+--- xsane-0.995~/doc/sane-xsane-doc.html 2007-03-03 14:11:32.000000000 +0100
++++ xsane-0.995/doc/sane-xsane-doc.html 2007-11-22 11:25:36.385421627 +0100
+@@ -165,8 +165,7 @@
+ <li><a href="sane-xsane-setup-display-doc.html">Display setup</a></li>
+ <li><a href="sane-xsane-setup-enhancement-doc.html">Enhancement setup</a></li>
+ <li><a href="sane-xsane-setup-fax-doc.html">Fax setup</a></li>
+-<li><a href="sane-xsane-setup-image-doc.html">Image setup</a></li>
+-<li><a href="sane-xsane-setup-mail-doc.html">Mail setup</a></li>
++<li><a href="sane-xsane-setup-email-doc.html">Mail setup</a></li>
+ <li><a href="sane-xsane-setup-save-doc.html">Saving setup</a></li>
+ <li><a href="sane-xsane-setup-color-management-doc.html">Color management setup</a></li>
+ </ul>