SHA256
1
0
forked from pool/xfig

Fix problem with gcc 13 with upstream patches

OBS-URL: https://build.opensuse.org/package/show/graphics/xfig?expand=0&rev=84
This commit is contained in:
Dr. Werner Fink 2024-01-08 08:55:30 +00:00 committed by Git OBS Bridge
parent 018684d903
commit b940e8176d
4 changed files with 93 additions and 7 deletions

View File

@ -0,0 +1,29 @@
From a4a2f3f3aa29ec7fc84f9d782306b37bbe75025c Mon Sep 17 00:00:00 2001
From: Thomas Loimer <thomas.loimer@tuwien.ac.at>
Date: Sun, 31 Dec 2023 22:51:29 +0100
Subject: [PATCH] Fix exporting only active layers, ticket #163
---
src/u_print.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/u_print.c b/src/u_print.c
index c24c096..57921b3 100644
--- a/src/u_print.c
+++ b/src/u_print.c
@@ -861,10 +861,10 @@ build_layer_list(char *layers)
}
if (len < notlen && firstyes != -1) {
/* use list of layers TO print */
- sprintf(layers," -D +%s ",list);
+ sprintf(layers, "+%s", list);
} else if (firstno != -1){
/* use list of layers to NOT print */
- sprintf(layers," -D -%s ",notlist);
+ sprintf(layers, "-%s", notlist);
}
}
--
2.39.2

View File

@ -0,0 +1,44 @@
From 68403622a6f6c7d74f73e38989cfc0ed86fb83fc Mon Sep 17 00:00:00 2001
From: Thomas Loimer <thomas.loimer@tuwien.ac.at>
Date: Sun, 31 Dec 2023 15:18:45 +0100
Subject: [PATCH] Sanitize a call to realloc(), ticket #165
---
src/u_print.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/u_print.c b/src/u_print.c
index 2ed385f..c24c096 100644
--- a/src/u_print.c
+++ b/src/u_print.c
@@ -130,7 +130,7 @@ start_argumentlist(char *arg[restrict], char argbuf[restrict][ARGBUF_SIZE],
arg[0] = fig2dev_cmd;
arg[1] = "-L";
*a = 2; /* arg[2] will be the output language */
- if (appres.magnification < 99.99 | appres.magnification > 100.01) {
+ if (appres.magnification < 99.99 || appres.magnification > 100.01) {
int n;
arg[++*a] = "-m";
n = snprintf(argbuf[++*b], ARGBUF_SIZE,
@@ -531,6 +531,7 @@ print_export(char *file, int xoff, int yoff, char *backgrnd, char *transparent,
} else if (cur_exp_lang == LANG_PSTEX ||
cur_exp_lang == LANG_PDFTEX) {
size_t len = strlen(outfile);
+ char *s;
/* Options were already set above
- output the first file */
@@ -544,8 +545,9 @@ print_export(char *file, int xoff, int yoff, char *backgrnd, char *transparent,
goto free_outfile;
}
memcpy(tmp_name, outfile, len + 1);
- if (!realloc(outfile, len + 3)) {
+ if (!(outfile = realloc(s = outfile, len + 3))) {
ret = 1;
+ outfile = s; /* for free(outfile) below */
goto free_tmp_name;
}
strcpy(outfile + len, "_t");
--
2.39.2

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jan 8 08:53:08 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Add patches from upstream alert
* Fix-exporting-only-active-layers-ticket-163.patch
* Sanitize-a-call-to-realloc-ticket-165.patch
-------------------------------------------------------------------
Mon Sep 25 06:55:31 UTC 2023 - Dr. Werner Fink <werner@suse.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package xfig
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -40,6 +40,10 @@ Patch3: xfig.3.2.3d-international-std-fonts.dif
Patch5: xfig.3.2.5b-null.dif
Patch6: xfig.3.2.5b-locale.dif
Patch7: xfig.3.2.5b-fixes.dif
# PATCH-FIX-UPSTREAM
Patch8: Sanitize-a-call-to-realloc-ticket-165.patch
# PATCH-FIX-UPSTREAM
Patch9: Fix-exporting-only-active-layers-ticket-163.patch
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: flex
@ -97,12 +101,14 @@ find -type f | while read file; do
fi
done
set -x
%patch0
%patch1 -b .dingbats
%patch3 -b .international-std-fonts
%patch5 -b .null
%patch6 -b .locale
%patch7 -b .fixes
%patch -P0
%patch -P1 -b .dingbats
%patch -P3 -b .international-std-fonts
%patch -P5 -b .null
%patch -P6 -b .locale
%patch -P7 -b .fixes
%patch -P8 -p1
%patch -P9 -p1
cp %{SOURCE1} .
test ! -e Libraries/Examples/aircraft.fig || { echo forbidden file found 1>&2; exit 1; }