Index: scanelf.c =================================================================== RCS file: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v retrieving revision 1.85 diff -u -r1.85 scanelf.c --- scanelf.c 25 Jul 2005 23:31:32 -0000 1.85 +++ scanelf.c 19 Sep 2005 12:47:31 -0000 @@ -78,7 +78,7 @@ static char *find_lib = NULL; static char *out_format = NULL; static char *search_path = NULL; - +static char base_match = 0; /* sub-funcs for scanelf_file() */ @@ -498,9 +498,9 @@ } \ *found_needed = 1; \ } else { \ - if (!strcmp(find_lib, needed)) { \ + if (!strncmp(find_lib, needed, strlen(!base_match ? needed : find_lib))) { \ *found_lib = 1; \ - return (be_wewy_wewy_quiet ? NULL : find_lib); \ + return (be_wewy_wewy_quiet ? NULL : needed); \ } \ } \ } \ @@ -982,7 +982,7 @@ /* usage / invocation handling functions */ -#define PARSE_FLAGS "plRmyxetrnibSs:N:TaqvF:f:o:BhV" +#define PARSE_FLAGS "plRmyxetrnibSs:N:gTaqvF:f:o:BhV" #define a_argument required_argument static struct option const long_opts[] = { {"path", no_argument, NULL, 'p'}, @@ -1000,6 +1000,7 @@ {"soname", no_argument, NULL, 'S'}, {"symbol", a_argument, NULL, 's'}, {"lib", a_argument, NULL, 'N'}, + {"blah", no_argument, NULL, 'g'}, {"textrels", no_argument, NULL, 'T'}, {"all", no_argument, NULL, 'a'}, {"quiet", no_argument, NULL, 'q'}, @@ -1029,6 +1030,7 @@ "Print SONAME information", "Find a specified symbol", "Find a specified library", + "Match the base of a library (use with -N)", "Locate cause of TEXTREL", "Print all scanned info (-x -e -t -r -b)\n", "Only output 'bad' things", @@ -1121,7 +1123,7 @@ out_format = xstrdup(optarg); break; } - + case 'g': base_match = 1; break; case 'y': scan_symlink = 0; break; case 'B': show_banner = 0; break; case 'l': scan_ldpath = 1; break;