Accepting request 1292485 from GNOME:Factory

OBS-URL: https://build.opensuse.org/request/show/1292485
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/evince?expand=0&rev=183
This commit is contained in:
2025-07-14 08:52:01 +00:00
committed by Git OBS Bridge
12 changed files with 70 additions and 15355 deletions
+17 -1
View File
@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Sat Jul 12 13:32:15 UTC 2025 - Michael Gorse <mgorse@suse.com>
- Remove SLE 15 patches (no longer needed for 16):
+ 0001-reversed-synctex-Annotate-more-functions-that-wraps-formatting-strings.patch
+ 0001-reversed-synctex-Move-_GNU_SOURCE-to-the-top-of-the-source-code.patch
+ 0002-reversed-synctex-Remove-unused-labels.patch
+ 0002-reversed-synctex-Sync-against-upstream-synctex.patch
+ 0003-reversed-cut-n-paste-Annotate-functions-that-wraps-formatting-strings.patch
+ 0003-reversed-synctex-Silence-error-when-no-synctex-file-is-present.patch
+ 0004-reversed-synctex-Annotate-functions-that-wrap-vfprintf.patch
+ 0005-reversed-synctex-Fix-compilation.patch
+ 0006-reversed-synctex-Update-from-version-1.18-to-1.21.patch
- Add evince-a11y-crash.patch: fix crash in the accessible code
when page cache text is NULL.
-------------------------------------------------------------------
Mon Jun 30 06:30:47 UTC 2025 - Bjørn Lie <bjorn.lie@gmail.com>
@@ -3863,7 +3879,7 @@ Wed Apr 11 13:28:02 CDT 2007 - maw@suse.de
- Updated translations for the ca, gl, eu, es, cs, and dz locales.
-------------------------------------------------------------------
Fri Mar 23 11:57:17 CST 2007 - maw@suse.de
Fri Mar 23 11:57:17 CDT 2007 - maw@suse.de
- Update to version 0.8.0
- b.g.o fixes: 416447, 334542, 409828, 392186, 318568, and 164755.
+4 -33
View File
@@ -29,27 +29,10 @@ License: GPL-2.0-or-later
Group: Productivity/Office/Other
URL: https://wiki.gnome.org/Apps/Evince
Source0: %{name}-%{version}.tar.zst
# PATCH-FIX-SLE alarrosa@suse.com - Reverse upstream bump of synctex required version to build with texlive 2017
Patch0: 0001-reversed-synctex-Annotate-more-functions-that-wraps-formatting-strings.patch
# PATCH-FIX-SLE
Patch1: 0002-reversed-synctex-Sync-against-upstream-synctex.patch
# PATCH-FIX-SLE
Patch2: 0003-reversed-cut-n-paste-Annotate-functions-that-wraps-formatting-strings.patch
# PATCH-FIX-SLE
Patch3: 0001-reversed-synctex-Move-_GNU_SOURCE-to-the-top-of-the-source-code.patch
# PATCH-FIX-SLE
Patch4: 0002-reversed-synctex-Remove-unused-labels.patch
# PATCH-FIX-SLE
Patch5: 0003-reversed-synctex-Silence-error-when-no-synctex-file-is-present.patch
# PATCH-FIX-SLE
Patch6: 0004-reversed-synctex-Annotate-functions-that-wrap-vfprintf.patch
# PATCH-FIX-SLE
Patch7: 0005-reversed-synctex-Fix-compilation.patch
# PATCH-FIX-SLE
Patch8: 0006-reversed-synctex-Update-from-version-1.18-to-1.21.patch
# PATCH-FIX-UPSTREAM evince-kpathsea.patch -- Fix build with gcc 15
Patch1000: evince-kpathsea.patch
Patch0: evince-kpathsea.patch
# PATCH-FIX-UPSTREAM evince-a11y-crash.patch mgorse@suse.com -- fix crash in the accessible code when page cache text is NULL.
Patch1: evince-a11y-crash.patch
BuildRequires: c_compiler
BuildRequires: desktop-file-utils
@@ -211,19 +194,7 @@ A plugin for Evince to read XPS documents.
%lang_package
%prep
%setup
%if %{pkg_vcmp pkgconfig(synctex) < 1.19}
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%patch -P 5 -p1
%patch -P 6 -p1
%patch -P 7 -p1
%patch -P 8 -p1
%endif
%autopatch -p1 -m 1000
%autosetup -p1
%build
%meson \
@@ -1,18 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser_utils.c
+++ a/cut-n-paste/synctex/synctex_parser_utils.c
@@ -86,7 +86,6 @@
# include <syslog.h>
#endif
-__attribute__((__format__ (__printf__, 3, 0)))
static int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
int result;
# ifdef SYNCTEX_RECENT_WINDOWS
@@ -133,7 +132,6 @@
return result;
}
-__attribute__((__format__ (__printf__, 1, 2)))
int _synctex_error(const char * reason,...) {
va_list arg;
int result;
@@ -1,22 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser.c
+++ a/cut-n-paste/synctex/synctex_parser.c
@@ -83,11 +83,6 @@
* First level objects are sheets and forms, containing boxes, glues, kerns...
* The third tree allows to browse leaves according to tag and line.
*/
-/* Declare _GNU_SOURCE for accessing vasprintf. For MSC compiler, vasprintf is
- * defined in this file
- */
-#define _GNU_SOURCE
-
# if defined(SYNCTEX_USE_LOCAL_HEADER)
# include "synctex_parser_local.h"
# else
@@ -100,6 +95,7 @@
# endif
# endif
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
@@ -1,18 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser.c
+++ a/cut-n-paste/synctex/synctex_parser.c
@@ -754,6 +754,7 @@
(char *)_synctex_malloc(reader->size+1); /* one more character for null termination */
if (NULL == reader->start) {
_synctex_error("! malloc error in synctex_reader_init_with_output_file.");
+ bailey:
#ifdef SYNCTEX_DEBUG
return reader;
#else
@@ -5458,6 +5459,7 @@
# pragma mark + SCAN KERN
# endif
ns = _synctex_parse_new_kern(scanner);
+ continue_scan:
if (ns.status == SYNCTEX_STATUS_OK) {
if (child) {
_synctex_node_set_sibling(child,ns.node);
@@ -1,416 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser.c
+++ a/cut-n-paste/synctex/synctex_parser.c
@@ -267,6 +267,8 @@
# pragma mark Abstract OBJECTS and METHODS
# endif
+void synctex_node_free(synctex_node_p node);
+
/**
* \def SYNCTEX_MSG_SEND
* \brief Takes care of sending the given message if possible.
@@ -284,7 +286,7 @@
* Free the given node by sending the free message.
* - parameter NODE: of type synctex_node_p
*/
+void synctex_node_free(synctex_node_p node) {
-static void synctex_node_free(synctex_node_p node) {
SYNCTEX_MSG_SEND(node,free);
}
# if defined(SYNCTEX_TESTING)
@@ -441,7 +443,7 @@
/*
* _synctex_tree_set_... methods return the old value.
* The return value of _synctex_tree_set_child and
+ * _synctex_tree_set_sibling must be released somehown.
- * _synctex_tree_set_sibling must be released somehow.
*/
DEFINE_SYNCTEX_TREE__GETSETRESET(sibling)
DEFINE_SYNCTEX_TREE_GETSETRESET(parent)
@@ -538,6 +540,10 @@
synctex_io_mode_t io_mode;
} synctex_open_s;
+void synctex_reader_free(synctex_reader_p reader);
+synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, const char * output, const char * build_directory);
+synctex_node_p _synctex_node_next(synctex_node_p node);
+
/* This functions opens the file at the "output" given location.
* It manages the problem of quoted filenames that appear with pdftex and filenames containing the space character.
* In TeXLive 2008, the synctex file created with pdftex did contain unexpected quotes.
@@ -653,12 +659,12 @@
quoteless_synctex_name = NULL;
}
}
+ /* The operation is successfull, return the arguments by value. */
- /* The operation is successful, return the arguments by value. */
open.status = SYNCTEX_STATUS_OK;
return open;
}
+/* Opens the ouput file, taking into account the eventual build_directory.
-/* Opens the output file, taking into account the eventual build_directory.
* - returns: an open structure which status is
* SYNCTEX_STATUS_OK on success,
* SYNCTEX_STATUS_ERROR on failure.
@@ -712,7 +718,7 @@
} /* if (build_directory...) */
return open;
}
+void synctex_reader_free(synctex_reader_p reader) {
-static void synctex_reader_free(synctex_reader_p reader) {
if (reader) {
_synctex_free(reader->output);
_synctex_free(reader->synctex);
@@ -725,7 +731,7 @@
* Return reader on success.
* Deallocate reader and return NULL on failure.
*/
+synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, const char * output, const char * build_directory) {
-static synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, const char * output, const char * build_directory) {
if (reader) {
/* now open the synctex file */
synctex_open_s open = _synctex_open_v2(output,build_directory,0,synctex_ADD_QUOTES);
@@ -752,7 +758,6 @@
(char *)_synctex_malloc(reader->size+1); /* one more character for null termination */
if (NULL == reader->start) {
_synctex_error("! malloc error in synctex_reader_init_with_output_file.");
- bailey:
#ifdef SYNCTEX_DEBUG
return reader;
#else
@@ -2832,6 +2837,20 @@
}
return _synctex_node_sibling_or_parents(node);
}
+/**
+ * The next nodes corresponds to a deep first tree traversal.
+ * Does not create child proxies as side effect contrary to
+ * the synctex_node_next method above.
+ * May loop infinitely many times if the tree
+ * is not properly built (contains loops).
+ */
+synctex_node_p _synctex_node_next(synctex_node_p node) {
+ synctex_node_p N = _synctex_tree_child(node);
+ if (N) {
+ return N;
+ }
+ return _synctex_node_sibling_or_parents(node);
+}
/**
* The node which argument is the sibling.
* - return: NULL if the argument has no parent or
@@ -5156,7 +5175,7 @@
/* At least 1 more character */
zs = _synctex_buffer_get_available_size(scanner,1);
if (zs.size == 0){
+ _synctex_error("Uncomplete synctex file, postamble missing.");
- _synctex_error("Incomplete synctex file, postamble missing.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
goto main_loop;
@@ -5173,13 +5192,13 @@
--ignored_form_depth;
}
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
+ _synctex_error("Uncomplete container.");
- _synctex_error("Incomplete container.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
} else {
zs = _synctex_buffer_get_available_size(scanner,1);
if (zs.size == 0){
+ _synctex_error("Uncomplete synctex file, postamble missing.");
- _synctex_error("Incomplete synctex file, postamble missing.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
}
@@ -5255,7 +5274,7 @@
synctex_node_log(child);
# endif
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
+ _synctex_error("Uncomplete container.");
- _synctex_error("Incomplete container.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
last_k = last_g = NULL;
@@ -5364,7 +5383,7 @@
sibling = _synctex_tree_child(parent);
_synctex_data_set_point(sibling,_synctex_data_point_V(parent));
if (last_k && last_g && (child = synctex_node_child(parent))) {
+ /* Find the node preceeding last_k */
- /* Find the node preceding last_k */
synctex_node_p next;
while ((next = __synctex_tree_sibling(child))) {
if (next == last_k) {
@@ -5388,7 +5407,7 @@
# endif
}
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
+ _synctex_error("Uncomplete container.");
- _synctex_error("Incomplete container.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
last_k = last_g = NULL;
@@ -5443,7 +5462,6 @@
# pragma mark + SCAN KERN
# endif
ns = _synctex_parse_new_kern(scanner);
- continue_scan:
if (ns.status == SYNCTEX_STATUS_OK) {
if (child) {
_synctex_node_set_sibling(child,ns.node);
@@ -5669,7 +5687,7 @@
}
zs = _synctex_buffer_get_available_size(scanner,1);
if (zs.size == 0){
+ _synctex_error("Uncomplete synctex file, postamble missing.");
- _synctex_error("Incomplete synctex file, postamble missing.");
SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);
}
last_k = last_g = NULL;
@@ -5935,11 +5953,11 @@
/* Used when parsing the synctex file
*/
static synctex_status_t _synctex_scan_content(synctex_scanner_p scanner) {
+ scanner->reader->lastv = -1;
+ synctex_status_t status = 0;
if (NULL == scanner) {
return SYNCTEX_STATUS_BAD_ARGUMENT;
}
- scanner->reader->lastv = -1;
- synctex_status_t status = 0;
/* Find where this section starts */
content_not_found:
status = _synctex_match_string(scanner,"Content:");
@@ -5947,7 +5965,7 @@
return status;
}
if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
+ _synctex_error("Uncomplete Content.");
- _synctex_error("Incomplete Content.");
return SYNCTEX_STATUS_ERROR;
}
if (status == SYNCTEX_STATUS_NOT_OK) {
@@ -6052,8 +6070,8 @@
scanner->pre_magnification = 1000;
scanner->pre_unit = 8192;
scanner->pre_x_offset = scanner->pre_y_offset = 578;
+ /* initialize the offset with a fake unprobable value,
+ * If there is a post scriptum section, this value will be overriden by the real life value */
- /* initialize the offset with a fake improbable value,
- * If there is a post scriptum section, this value will be overridden by the real life value */
scanner->x_offset = scanner->y_offset = 6.027e23f;
scanner->reader->line_number = 1;
@@ -7603,7 +7621,7 @@
width = _synctex_data_width(node);
min = _synctex_data_h(node);
max = min + (width>0?width:-width);
+ /* We allways have min <= max */
- /* We always have min <= max */
if (hit->h<min) {
nd.distance = min - hit->h; /* regions 1+4+7, result is > 0 */
} else if (hit->h>max) {
@@ -7617,7 +7635,7 @@
width = synctex_node_width(node);
min = synctex_node_h(node);
max = min + (width>0?width:-width);
+ /* We allways have min <= max */
- /* We always have min <= max */
if (hit->h<min) {
nd.distance = min - hit->h; /* regions 1+4+7, result is > 0 */
} else if (hit->h>max) {
@@ -7632,7 +7650,7 @@
width = synctex_node_hbox_width(node);
min = synctex_node_hbox_h(node);
max = min + (width>0?width:-width);
+ /* We allways have min <= max */
- /* We always have min <= max */
if (hit->h<min) {
nd.distance = min - hit->h; /* regions 1+4+7, result is > 0 */
} else if (hit->h>max) {
@@ -7744,7 +7762,7 @@
min = synctex_node_v(node);
max = min + _synctex_abs(_synctex_data_depth(node));
min -= _synctex_abs(_synctex_data_height(node));
+ /* We allways have min <= max */
- /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -7758,7 +7776,7 @@
min = synctex_node_v(node);
max = min + _synctex_abs(synctex_node_depth(node));
min -= _synctex_abs(synctex_node_height(node));
+ /* We allways have min <= max */
- /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -7775,7 +7793,7 @@
max = min + (depth>0?depth:-depth);
height = synctex_node_hbox_height(node);
min -= (height>0?height:-height);
+ /* We allways have min <= max */
- /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -7791,7 +7809,7 @@
min = _synctex_data_v(node);
max = min + _synctex_abs(_synctex_data_depth(_synctex_tree_parent(node)));
min -= _synctex_abs(_synctex_data_height(_synctex_tree_parent(node)));
+ /* We allways have min <= max */
- /* We always have min <= max */
if (hit->v<min) {
nd.distance = min - hit->v; /* regions 1+2+3, result is > 0 */
} else if (hit->v>max) {
@@ -8384,10 +8402,10 @@
gzFile as_gzFile;
FILE * as_FILE_p;
void * as_ptr;
+} syncex_file_u;
-} synctex_file_u;
struct synctex_updater_t {
+ syncex_file_u file;
- synctex_file_u file;
synctex_print_f print;
synctex_close_f close;
int length; /* the number of chars appended */
@@ -8552,20 +8570,6 @@
# pragma mark -
# pragma mark Testers
# endif
-/**
- * The next nodes corresponds to a deep first tree traversal.
- * Does not create child proxies as side effect contrary to
- * the synctex_node_next method above.
- * May loop infinitely many times if the tree
- * is not properly built (contains loops).
- */
-static synctex_node_p _synctex_node_next(synctex_node_p node) {
- synctex_node_p N = _synctex_tree_child(node);
- if (N) {
- return N;
- }
- return _synctex_node_sibling_or_parents(node);
-}
static int _synctex_input_copy_name(synctex_node_p input, char * name) {
char * copy = _synctex_malloc(strlen(name)+1);
memcpy(copy,name,strlen(name)+1);
--- b/cut-n-paste/synctex/synctex_parser.h
+++ a/cut-n-paste/synctex/synctex_parser.h
@@ -146,7 +146,7 @@
/* The main entry points.
* Given the file name, a line and a column number, synctex_display_query returns the number of nodes
+ * satisfying the contrain. Use code like
- * satisfying the constrain. Use code like
*
* if(synctex_display_query(scanner,name,line,column,page_hint)>0) {
* synctex_node_p node;
@@ -165,7 +165,7 @@
* - highlight just the character using that information
*
* Given the page and the position in the page, synctex_edit_query returns the number of nodes
+ * satisfying the contrain. Use code like
- * satisfying the constrain. Use code like
*
* if(synctex_edit_query(scanner,page,h,v)>0) {
* synctex_node_p node;
@@ -230,7 +230,7 @@
* synctex_node_box_visible_depth(node)
* );
* The visible dimensions are bigger than real ones
+ * to compensate 0 width boxes or nodes intentionnaly
- * to compensate 0 width boxes or nodes intentionally
* put outside the box (using \kern for example).
* - parameter node: a node.
* - returns: a float.
@@ -248,7 +248,7 @@
* as opposite to TeX coordinates.
* The origin is at the top left corner of the page.
* The visible dimensions are bigger than real ones
+ * to compensate 0 width boxes or nodes intentionnaly
- * to compensate 0 width boxes or nodes intentionally
* put outside the box (using \kern for example).
* All nodes have coordinates, but all nodes don't
* have non null size. For example, math nodes
@@ -389,7 +389,7 @@
* The scanner owns a list of sheet siblings and
* a list of form siblings.
* Sheets or forms have one child which is a box:
+ * theie contents.
- * their contents.
* - argument page: 1 based sheet page number.
* - argument tag: 1 based form tag number.
*/
--- b/cut-n-paste/synctex/synctex_parser_advanced.h
+++ a/cut-n-paste/synctex/synctex_parser_advanced.h
@@ -449,7 +449,7 @@
*/
void synctex_iterator_free(synctex_iterator_p iterator);
/**
+ * Wether the iterator actually points to an object.
- * Whether the iterator actually points to an object.
* - argument iterator: the object to iterate on...
*/
synctex_bool_t synctex_iterator_has_next(synctex_iterator_p iterator);
--- b/cut-n-paste/synctex/synctex_parser_utils.c
+++ a/cut-n-paste/synctex/synctex_parser_utils.c
@@ -48,6 +48,7 @@
#include <limits.h>
#include <ctype.h>
+#include <string.h>
#include <sys/stat.h>
@@ -86,7 +87,10 @@
# include <syslog.h>
#endif
+int _synctex_error(const char * reason, ...) __attribute__((__format__ (__printf__, 1, 2)));
+int _synctex_log(int level, const char * prompt, const char * reason, va_list arg) __attribute__((__format__ (__printf__, 3, 0)));
+
+int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
-static int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
int result;
# ifdef SYNCTEX_RECENT_WINDOWS
{/* This code is contributed by William Blum.
@@ -301,7 +305,7 @@
if(src && dest_ref) {
const char * lpc;
# define dest (*dest_ref)
+ dest = NULL; /* Default behavior: no change and sucess. */
- dest = NULL; /* Default behavior: no change and success. */
lpc = _synctex_last_path_component(src);
if(strlen(lpc)) {
if(strchr(lpc,' ') && lpc[0]!='"' && lpc[strlen(lpc)-1]!='"') {
@@ -351,7 +355,6 @@
size_t len = strlen(temp);
if(UINT_MAX-len<size) {
_synctex_error("! _synctex_merge_strings: Capacity exceeded.");
- va_end(arg);
return NULL;
}
size+=len;
@@ -372,7 +375,6 @@
_synctex_error("! _synctex_merge_strings: Copy problem");
free(result);
result = NULL;
- va_end(arg);
return NULL;
}
dest += size;
@@ -390,7 +392,7 @@
/* The purpose of _synctex_get_name is to find the name of the synctex file.
* There is a list of possible filenames from which we return the most recent one and try to remove all the others.
+ * With two runs of pdftex or xetex we are sure the the synctex file is really the most appropriate.
- * With two runs of pdftex or xetex we are sure the synctex file is really the most appropriate.
*/
int _synctex_get_name(const char * output, const char * build_directory, char ** synctex_name_ref, synctex_io_mode_t * io_mode_ref)
{
@@ -1,38 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser.c
+++ a/cut-n-paste/synctex/synctex_parser.c
@@ -8411,7 +8411,6 @@
int length; /* the number of chars appended */
};
-__attribute__((__format__ (__printf__, 2, 3)))
static int _synctex_updater_print(synctex_updater_p updater, const char * format, ...) {
int result = 0;
if (updater) {
@@ -8448,7 +8447,6 @@
/**
* gzvprintf is not available until OSX 10.10
*/
-__attribute__((__format__ (__printf__, 2, 3)))
static int _synctex_updater_print_gz(synctex_updater_p updater, const char * format, ...) {
int result = 0;
if (updater) {
--- b/cut-n-paste/synctex/synctex_parser_utils.c
+++ a/cut-n-paste/synctex/synctex_parser_utils.c
@@ -149,7 +149,6 @@
return result;
}
-__attribute__((__format__ (__printf__, 1, 2)))
int _synctex_debug(const char * reason,...) {
va_list arg;
int result;
--- b/cut-n-paste/unarr/common/unarr.c
+++ a/cut-n-paste/unarr/common/unarr.c
@@ -92,7 +92,6 @@
return ar->get_comment(ar, buffer, count);
}
-__attribute__((__format__ (__printf__, 4, 0)))
void ar_log(const char *prefix, const char *file, int line, const char *msg, ...)
{
va_list args;
@@ -1,10 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser.c
+++ a/cut-n-paste/synctex/synctex_parser.c
@@ -6030,6 +6030,7 @@
if ((scanner->reader = synctex_reader_init_with_output_file(scanner->reader, output, build_directory))) {
return parse? synctex_scanner_parse(scanner):scanner;
}
+ _synctex_error("No file?");
return NULL;
}
@@ -1,12 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser_utils.c
+++ a/cut-n-paste/synctex/synctex_parser_utils.c
@@ -87,8 +87,7 @@
# include <syslog.h>
#endif
+int _synctex_log(int level, const char * prompt, const char * reason,va_list arg);
-int _synctex_error(const char * reason, ...) __attribute__((__format__ (__printf__, 1, 2)));
-int _synctex_log(int level, const char * prompt, const char * reason, va_list arg) __attribute__((__format__ (__printf__, 3, 0)));
int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
int result;
@@ -1,41 +0,0 @@
--- b/cut-n-paste/synctex/synctex_parser.c
+++ a/cut-n-paste/synctex/synctex_parser.c
@@ -95,7 +95,6 @@
# endif
# endif
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
@@ -263,8 +262,6 @@
# pragma mark Abstract OBJECTS and METHODS
# endif
-void synctex_node_free(synctex_node_p node);
-
/**
* \def SYNCTEX_MSG_SEND
* \brief Takes care of sending the given message if possible.
@@ -536,10 +533,6 @@
synctex_io_mode_t io_mode;
} synctex_open_s;
-void synctex_reader_free(synctex_reader_p reader);
-synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, const char * output, const char * build_directory);
-synctex_node_p _synctex_node_next(synctex_node_p node);
-
/* This functions opens the file at the "output" given location.
* It manages the problem of quoted filenames that appear with pdftex and filenames containing the space character.
* In TeXLive 2008, the synctex file created with pdftex did contain unexpected quotes.
--- b/cut-n-paste/synctex/synctex_parser_utils.c
+++ a/cut-n-paste/synctex/synctex_parser_utils.c
@@ -87,8 +87,6 @@
# include <syslog.h>
#endif
-int _synctex_log(int level, const char * prompt, const char * reason,va_list arg);
-
int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
int result;
# ifdef SYNCTEX_RECENT_WINDOWS
File diff suppressed because it is too large Load Diff
+49
View File
@@ -0,0 +1,49 @@
From 440ab79d832557997af3c8f17c8a244b8d1bce1a Mon Sep 17 00:00:00 2001
From: Colomban Wendling <cwendling@hypra.fr>
Date: Thu, 7 Mar 2024 17:01:38 +0100
Subject: [PATCH] libview: Fix crash in the accessible code when page cache
text is NULL
If `ev_page_cache_get_text()` returns `NULL`, it can crash both
`get_character_count()` and `get_substring()` implementations of
`EvPageAccessible`, although it's a valid return value from the former.
Fix those two implementations to handle this edge case.
---
libview/ev-page-accessible.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/libview/ev-page-accessible.c b/libview/ev-page-accessible.c
index 85995b89..2d392de3 100644
--- a/libview/ev-page-accessible.c
+++ b/libview/ev-page-accessible.c
@@ -486,6 +486,9 @@ ev_page_accessible_get_substring (AtkText *text,
return NULL;
page_text = ev_page_cache_get_text (view->page_cache, self->priv->page);
+ if (!page_text)
+ return NULL;
+
if (end_offset < 0 || end_offset > g_utf8_strlen (page_text, -1))
end_offset = strlen (page_text);
start_offset = CLAMP (start_offset, 0, end_offset);
@@ -633,11 +636,13 @@ ev_page_accessible_get_character_count (AtkText *text)
{
EvPageAccessible *self = EV_PAGE_ACCESSIBLE (text);
EvView *view = ev_page_accessible_get_view (self);
- gint retval;
+ const gchar *page_text;
- retval = g_utf8_strlen (ev_page_cache_get_text (view->page_cache, self->priv->page), -1);
+ page_text = ev_page_cache_get_text (view->page_cache, self->priv->page);
+ if (!page_text)
+ return 0;
- return retval;
+ return g_utf8_strlen (page_text, -1);
}
static gboolean
--
2.50.0