Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 201186 Details for
Bug 276932
media-gfx/iscan fails to build with glibc-2.10
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix pointer arithmetic of previous patch
iscan-glibc-2.10.patch (text/plain), 2.82 KB, created by
Martin Väth
on 2009-08-14 00:02:58 UTC
(
hide
)
Description:
Fix pointer arithmetic of previous patch
Filename:
MIME Type:
Creator:
Martin Väth
Created:
2009-08-14 00:02:58 UTC
Size:
2.82 KB
patch
obsolete
>--- 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 + 1); // 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); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 276932
:
197083
|
201185
| 201186