aboutsummaryrefslogtreecommitdiff
path: root/src/main/extractor_plugpath.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-03 22:31:06 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-03 22:31:06 +0000
commitd860227153a0e8fad5a879763c4952b9ceb15333 (patch)
tree08a67e1eca41606691679a77314fd26b6e9345b1 /src/main/extractor_plugpath.c
parent27aaf7a1df0c607bdc478fc4f49b59661db5d575 (diff)
downloadlibextractor-d860227153a0e8fad5a879763c4952b9ceb15333.tar.gz
libextractor-d860227153a0e8fad5a879763c4952b9ceb15333.zip
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 (limited to 'src/main/extractor_plugpath.c')
-rw-r--r--src/main/extractor_plugpath.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/extractor_plugpath.c b/src/main/extractor_plugpath.c
index 1cc5858..a47cb6c 100644
--- a/src/main/extractor_plugpath.c
+++ b/src/main/extractor_plugpath.c
@@ -407,7 +407,7 @@ find_plugin_in_path (void *cls,
407 if ( (NULL != (la = strstr (ent->d_name, ".la"))) && 407 if ( (NULL != (la = strstr (ent->d_name, ".la"))) &&
408 (la[3] == '\0') ) 408 (la[3] == '\0') )
409 continue; /* only load '.so' and '.dll' */ 409 continue; /* only load '.so' and '.dll' */
410 sym_name = strstr (ent->d_name, "_"); 410 sym_name = strrchr (ent->d_name, '_');
411 if (sym_name == NULL) 411 if (sym_name == NULL)
412 continue; 412 continue;
413 sym_name++; 413 sym_name++;
@@ -417,7 +417,7 @@ find_plugin_in_path (void *cls,
417 CLOSEDIR (dir); 417 CLOSEDIR (dir);
418 return; 418 return;
419 } 419 }
420 dot = strstr (sym, "."); 420 dot = strchr (sym, '.');
421 if (dot != NULL) 421 if (dot != NULL)
422 *dot = '\0'; 422 *dot = '\0';
423 if (0 == strcmp (sym, sc->short_name)) 423 if (0 == strcmp (sym, sc->short_name))
@@ -439,7 +439,6 @@ find_plugin_in_path (void *cls,
439} 439}
440 440
441 441
442
443/** 442/**
444 * Given a short name of a library (i.e. "mime"), find 443 * Given a short name of a library (i.e. "mime"), find
445 * the full path of the respective plugin. 444 * the full path of the respective plugin.
@@ -457,9 +456,6 @@ find_plugin (const char *short_name)
457} 456}
458 457
459 458
460
461
462
463/** 459/**
464 * Load all plugins from the given directory. 460 * Load all plugins from the given directory.
465 * 461 *
@@ -491,7 +487,7 @@ load_plugins_from_dir (void *cls,
491 (la[2] == '\0')) ) 487 (la[2] == '\0')) )
492 continue; /* only load '.so' and '.dll' */ 488 continue; /* only load '.so' and '.dll' */
493 489
494 sym_name = strstr (ent->d_name, "_"); 490 sym_name = strrchr (ent->d_name, '_');
495 if (sym_name == NULL) 491 if (sym_name == NULL)
496 continue; 492 continue;
497 sym_name++; 493 sym_name++;
@@ -501,7 +497,7 @@ load_plugins_from_dir (void *cls,
501 closedir (dir); 497 closedir (dir);
502 return; 498 return;
503 } 499 }
504 dot = strstr (sym, "."); 500 dot = strchr (sym, '.');
505 if (dot != NULL) 501 if (dot != NULL)
506 *dot = '\0'; 502 *dot = '\0';
507#if DEBUG > 1 503#if DEBUG > 1