libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit d860227153a0e8fad5a879763c4952b9ceb15333
parent 27aaf7a1df0c607bdc478fc4f49b59661db5d575
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  3 Jun 2012 22:31:06 +0000

Dear libextractor maintainers,

With the arrival of multiarch in Debian, the standard library path changes (e.g. /usr/lib/x86_64-linux-gnu/ for amd64). The fact that it contains an underscore causes extract to fail to load its plugins, see [1].

Fortunately, Harun Trefry kindly provided a patch against the last revision of you SVN that you'll find attached. Would you consider to include it ?

Cheers,
Bertrand

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=675063 



Diffstat:
Msrc/main/extractor_plugins.c | 4++--
Msrc/main/extractor_plugpath.c | 12++++--------
2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/main/extractor_plugins.c b/src/main/extractor_plugins.c @@ -71,14 +71,14 @@ get_symbol_with_prefix(void *lib_handle, const char *(*opt_fun)(void); if (NULL != options) *options = NULL; - sym_name = strstr (prefix, "_"); + sym_name = strrchr (prefix, '_'); if (sym_name == NULL) return NULL; sym_name++; sym = strdup (sym_name); if (sym == NULL) return NULL; - dot = strstr (sym, "."); + dot = strchr (sym, '.'); if (dot != NULL) *dot = '\0'; name = malloc(strlen(sym) + strlen(template) + 1); diff --git a/src/main/extractor_plugpath.c b/src/main/extractor_plugpath.c @@ -407,7 +407,7 @@ find_plugin_in_path (void *cls, if ( (NULL != (la = strstr (ent->d_name, ".la"))) && (la[3] == '\0') ) continue; /* only load '.so' and '.dll' */ - sym_name = strstr (ent->d_name, "_"); + sym_name = strrchr (ent->d_name, '_'); if (sym_name == NULL) continue; sym_name++; @@ -417,7 +417,7 @@ find_plugin_in_path (void *cls, CLOSEDIR (dir); return; } - dot = strstr (sym, "."); + dot = strchr (sym, '.'); if (dot != NULL) *dot = '\0'; if (0 == strcmp (sym, sc->short_name)) @@ -439,7 +439,6 @@ find_plugin_in_path (void *cls, } - /** * Given a short name of a library (i.e. "mime"), find * the full path of the respective plugin. @@ -457,9 +456,6 @@ find_plugin (const char *short_name) } - - - /** * Load all plugins from the given directory. * @@ -491,7 +487,7 @@ load_plugins_from_dir (void *cls, (la[2] == '\0')) ) continue; /* only load '.so' and '.dll' */ - sym_name = strstr (ent->d_name, "_"); + sym_name = strrchr (ent->d_name, '_'); if (sym_name == NULL) continue; sym_name++; @@ -501,7 +497,7 @@ load_plugins_from_dir (void *cls, closedir (dir); return; } - dot = strstr (sym, "."); + dot = strchr (sym, '.'); if (dot != NULL) *dot = '\0'; #if DEBUG > 1