wok-next view geeqie/stuff/patches/0001-Work-around-changed-c-11-std-string-implementation.patch @ rev 21247
updated cyrus-imapd (2.4.17 -> 3.0.12)
author | Hans-G?nter Theisgen |
---|---|
date | Thu Dec 05 16:28:27 2019 +0100 (2019-12-05) |
parents | |
children |
line source
1 From 0b044d1d685307e5755917e31d56a1a3104cd505 Mon Sep 17 00:00:00 2001
2 From: David Kalnischkies <david@kalnischkies.de>
3 Date: Fri, 27 May 2016 12:04:40 +0100
4 Subject: [PATCH] Work around changed c++11 std::string implementation
6 Bug was already partly fixed by 96db62d but there was even more
7 positions that was unseen by Solomon.
9 The patch is originally from Debian bug report #800350.
11 Signed-off-by: Klaus Ethgen <Klaus@Ethgen.de>
12 ---
13 src/exiv2.cc | 12 +++++++-----
14 1 file changed, 7 insertions(+), 5 deletions(-)
16 diff --git a/src/exiv2.cc b/src/exiv2.cc
17 index 1dbe1182..49b8e07c 100644
18 --- a/src/exiv2.cc
19 +++ b/src/exiv2.cc
20 @@ -25,6 +25,7 @@
21 #include <exiv2/image.hpp>
22 #include <exiv2/exif.hpp>
23 #include <iostream>
24 +#include <string>
26 // EXIV2_TEST_VERSION is defined in Exiv2 0.15 and newer.
27 #ifndef EXIV2_TEST_VERSION
28 @@ -1140,8 +1141,9 @@ guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width,
30 if (!exif->image()) return NULL;
32 + std::string const path = exif->image()->io().path();
33 /* given image pathname, first do simple (and fast) file extension test */
34 - gboolean is_raw = filter_file_class(exif->image()->io().path().c_str(), FORMAT_CLASS_RAWIMAGE);
35 + gboolean is_raw = filter_file_class(path.c_str(), FORMAT_CLASS_RAWIMAGE);
37 if (!is_raw && requested_width == 0) return NULL;
39 @@ -1241,10 +1243,10 @@ extern "C" guchar *exif_get_preview(ExifData *exif, guint *data_len, gint reques
40 if (!exif) return NULL;
41 if (!exif->image()) return NULL;
43 - const char* path = exif->image()->io().path().c_str();
44 + std::string const path = exif->image()->io().path();
46 /* given image pathname, first do simple (and fast) file extension test */
47 - if (!filter_file_class(path, FORMAT_CLASS_RAWIMAGE)) return NULL;
48 + if (!filter_file_class(path.c_str(), FORMAT_CLASS_RAWIMAGE)) return NULL;
50 try {
51 struct stat st;
52 @@ -1255,9 +1257,9 @@ extern "C" guchar *exif_get_preview(ExifData *exif, guint *data_len, gint reques
54 RawFile rf(exif->image()->io());
55 offset = rf.preview_offset();
56 - DEBUG_1("%s: offset %lu", path, offset);
57 + DEBUG_1("%s: offset %lu", path.c_str(), offset);
59 - fd = open(path, O_RDONLY);
60 + fd = open(path.c_str(), O_RDONLY);
61 if (fd == -1)
62 {
63 return NULL;
64 --
65 2.13.2