From ab2393f405e19d2629262517a340e9b65cea17c3 Mon Sep 17 00:00:00 2001 From: mkasik Date: Fri, 16 Jul 2010 10:31:44 +0000 Subject: [PATCH] - Restore io mode when returning from opening of synctex file - Patch by David Tardon - Resolves: #613916 --- evince-2.31.5-synctex.patch | 22 ++++++++++++++++++++++ evince.spec | 10 +++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 evince-2.31.5-synctex.patch diff --git a/evince-2.31.5-synctex.patch b/evince-2.31.5-synctex.patch new file mode 100644 index 0000000..ad7a22e --- /dev/null +++ b/evince-2.31.5-synctex.patch @@ -0,0 +1,22 @@ +--- evince-2.31.5/cut-n-paste/synctex/synctex_parser.c 2010-06-27 16:49:01.000000000 +0200 ++++ evince-2.31.5/cut-n-paste/synctex/synctex_parser.c 2010-07-16 12:00:49.000000000 +0200 +@@ -2549,6 +2549,7 @@ int __synctex_open(const char * output, + char * quoteless = NULL; + const char * mode = synctex_io_modes[io_mode]; + size_t size = 0; ++ synctex_io_mode_t orig_io_mode = io_mode; + /* now create the synctex file name */ + size = strlen(output)+strlen(synctex_suffix)+strlen(synctex_suffix_gz)+1; + synctex_name = (char *)malloc(size); +@@ -2565,6 +2566,11 @@ return_on_error: + synctex_name = NULL;/* Don't forget to reinitialize. */ + the_file = NULL; /* Here as well */ + free(quoteless); ++ /* We _must_ restore the original mode. Otherwise, in ++ case it had been "r", later changed to "rb", the next ++ call might use "rb" and "w" and _create_ the file, if ++ the caller is not avare of the change! */ ++ io_mode = orig_io_mode; + return 2; + } + /* remove the last path extension if any */ diff --git a/evince.spec b/evince.spec index 16908bd..d23224f 100644 --- a/evince.spec +++ b/evince.spec @@ -5,7 +5,7 @@ Name: evince Version: 2.31.5 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Document viewer License: GPLv2+ and GFDL @@ -14,6 +14,8 @@ URL: http://projects.gnome.org/evince/ Source0: http://download.gnome.org/sources/%{name}/2.31/%{name}-%{version}.tar.bz2 # https://bugzilla.redhat.com/show_bug.cgi?id=562648 Patch2: evince-t1font-mapping.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=613916 +Patch3: evince-2.31.5-synctex.patch BuildRequires: gtk3-devel BuildRequires: glib2-devel >= %{glib2_version} @@ -105,6 +107,7 @@ It adds an additional tab called "Document" to the file properties dialog. %prep %setup -q %patch2 -p1 -b .t1font-map +%patch3 -p1 -b .synctex %build %configure \ @@ -236,6 +239,11 @@ glib-compile-schemas --allow-any-name %{_datadir}/glib-2.0/schemas ||: %{_libdir}/nautilus/extensions-2.0/libevince-properties-page.so %changelog +* Fri Jul 16 2010 Marek Kasik - 2.31.5-4 +- Restore io mode when returning from opening of synctex file +- Patch by David Tardon +- Resolves: #613916 + * Fri Jul 16 2010 Marek Kasik - 2.31.5-3 - Move %%doc files to evince-libs subpackage - see Subpackage Licensing in Packaging:LicensingGuidelines