summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Ostorga <vostorga@gentoo.org>2009-08-14 00:05:09 +0000
committerVictor Ostorga <vostorga@gentoo.org>2009-08-14 00:05:09 +0000
commit424138265022c80b1dec540184ae9797af4d8d71 (patch)
treeed8c32c6cef09802a9dc5fc2e4779a4710f5c286 /media-gfx/iscan/files
parentVersion bump to add package.use check to 'all' parameter (diff)
downloadgentoo-2-424138265022c80b1dec540184ae9797af4d8d71.tar.gz
gentoo-2-424138265022c80b1dec540184ae9797af4d8d71.tar.bz2
gentoo-2-424138265022c80b1dec540184ae9797af4d8d71.zip
Fixing build against glibc 2.10 , Patch thanks to Martin Väth <vaeth@mathematik.uni-wuerzburg.de>
(Portage version: 2.1.6.13/cvs/Linux i686)
Diffstat (limited to 'media-gfx/iscan/files')
-rw-r--r--media-gfx/iscan/files/iscan-2.11.0-glibc210.patch103
1 files changed, 103 insertions, 0 deletions
diff --git a/media-gfx/iscan/files/iscan-2.11.0-glibc210.patch b/media-gfx/iscan/files/iscan-2.11.0-glibc210.patch
new file mode 100644
index 000000000000..e5e3cfaf6317
--- /dev/null
+++ b/media-gfx/iscan/files/iscan-2.11.0-glibc210.patch
@@ -0,0 +1,103 @@
+--- frontend/file-selector.cc
++++ frontend/file-selector.cc
+@@ -35,6 +35,7 @@
+ #include <cstdio>
+ #include <cstdlib>
+ #include <cstring>
++#include <string>
+ #include <unistd.h>
+
+ #include "pisa_aleart_dialog.h"
+@@ -1023,17 +1024,14 @@
+ // check write access to the directory (note that we need execute
+ // privileges as well)
+
+- char *slash = strrchr( file, '/');
+- *slash = '\0'; // temporarily truncate to dirname
+- const char *dir = (file == slash
+- ? "/" // whoops!, file in root directory
+- : file);
++ const char *slash = strrchr( file, '/');
++ std::string dir( file, slash - file);
++ if (dir.empty())
++ dir = "/";
+
+ bool w_ok = false; // assume the worst
+- if (0 == access( dir, F_OK ))
+- w_ok = (0 == access( dir, W_OK | X_OK ));
+-
+- *slash = '/'; // restore filename
++ if (0 == access( dir.c_str(), F_OK ))
++ w_ok = (0 == access( dir.c_str(), W_OK | X_OK ));
+
+ return w_ok;
+ }
+--- frontend/pisa_view_manager.cc
++++ frontend/pisa_view_manager.cc
+@@ -45,6 +45,7 @@
+ #include <sys/stat.h>
+ #include <dirent.h>
+ #include <locale.h>
++#include <string>
+
+ /*------------------------------------------------------------*/
+ #include "pisa_view_manager.h"
+@@ -1170,10 +1171,10 @@
+ pisa_file_type
+ view_manager::get_file_type (const char *filename)
+ {
+- char *dot = strrchr (filename, '.');
++ const char *dot = strrchr (filename, '.');
+ if (!dot)
+ {
+- char *slash = strrchr (filename, '/');
++ const char *slash = strrchr (filename, '/');
+ if ( (strlen (slash) == strlen ("/" PACKAGE_TARNAME "XXXXXX"))
+ && (0 == strncmp (slash, "/" PACKAGE_TARNAME,
+ strlen ("/" PACKAGE_TARNAME))))
+@@ -1260,19 +1261,19 @@
+ {
+ int cancel = 0; // default: don't cancel
+
+- char *slash = strrchr( regexp, '/' );
++ const char *slash = strrchr( regexp, '/' );
+
+ if (!slash)
+ return cancel = 1;
+
+- *slash = '\0'; // regexp now holds the directory name
+- char dirname[ strlen( regexp )];
+- strcpy( dirname, regexp );
++ std::string s( regexp, slash - regexp);
++ char dirname[ s.size()];
++ strcpy( dirname, s.c_str());
+
+- *slash = '^'; // re-anchor the regexp
++ s = std::string("^") + slash; // re-anchor the regexp
+
+ regex_t *comp_regex = new regex_t;
+- int comp = regcomp( comp_regex, slash, REG_EXTENDED );
++ int comp = regcomp( comp_regex, s.c_str(), REG_EXTENDED );
+
+ if (0 == comp)
+ {
+--- lib/imgstream.cc
++++ lib/imgstream.cc
+@@ -185,7 +185,7 @@
+ return lt_dlclose (lib);
+ }
+
+-static int reversionsort (const void*, const void*);
++static int reversionsort (const dirent**, const dirent**);
+ int selector (const dirent *);
+ // forward declarations
+
+@@ -321,7 +321,7 @@
+ //! The C library's versionsort() function in reverse.
+ static
+ int
+-reversionsort (const void *a, const void *b)
++reversionsort (const dirent **a, const dirent **b)
+ {
+ return versionsort (b, a);
+ }