/[gentoo-projects]/pax-utils/scanelf.c
Gentoo

Diff of /pax-utils/scanelf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.92 Revision 1.93
1/* 1/*
2 * Copyright 2003-2005 Gentoo Foundation 2 * Copyright 2003-2005 Gentoo Foundation
3 * Distributed under the terms of the GNU General Public License v2 3 * Distributed under the terms of the GNU General Public License v2
4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.92 2005/12/09 01:41:32 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.93 2005/12/10 04:07:55 vapier Exp $
5 * 5 *
6 * Copyright 2003-2005 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2005 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2005 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2005 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
19#include <dirent.h> 19#include <dirent.h>
20#include <getopt.h> 20#include <getopt.h>
21#include <assert.h> 21#include <assert.h>
22#include "paxinc.h" 22#include "paxinc.h"
23 23
24static const char *rcsid = "$Id: scanelf.c,v 1.92 2005/12/09 01:41:32 vapier Exp $"; 24static const char *rcsid = "$Id: scanelf.c,v 1.93 2005/12/10 04:07:55 vapier Exp $";
25#define argv0 "scanelf" 25#define argv0 "scanelf"
26 26
27#define IS_MODIFIER(c) (c == '%' || c == '#') 27#define IS_MODIFIER(c) (c == '%' || c == '#')
28 28
29 29
1121 SET_STDOUT(fp); 1121 SET_STDOUT(fp);
1122 break; 1122 break;
1123 } 1123 }
1124 1124
1125 case 's': { 1125 case 's': {
1126 size_t len;
1127 if (find_sym) err("Don't specify -s twice"); 1126 if (find_sym) warn("You prob don't want to specify -s twice");
1128 find_sym = xstrdup(optarg); 1127 find_sym = optarg;
1129 len = strlen(find_sym) + 1;
1130 versioned_symname = (char*)xmalloc(sizeof(char) * (len+1)); 1128 versioned_symname = (char*)xmalloc(sizeof(char) * (strlen(find_sym)+1+1));
1131 sprintf(versioned_symname, "%s@", find_sym); 1129 sprintf(versioned_symname, "%s@", find_sym);
1132 break; 1130 break;
1133 } 1131 }
1134 case 'N': { 1132 case 'N': {
1135 if (find_lib) err("Don't specify -N twice"); 1133 if (find_lib) warn("You prob don't want to specify -N twice");
1136 find_lib = xstrdup(optarg); 1134 find_lib = optarg;
1137 break; 1135 break;
1138 } 1136 }
1139 1137
1140 case 'F': { 1138 case 'F': {
1141 if (out_format) err("Don't specify -F twice"); 1139 if (out_format) warn("You prob don't want to specify -F twice");
1142 out_format = xstrdup(optarg); 1140 out_format = optarg;
1143 break; 1141 break;
1144 } 1142 }
1145 1143
1146 case 'g': gmatch = 1; 1144 case 'g': gmatch = 1;
1147 case 'y': scan_symlink = 0; break; 1145 case 'y': scan_symlink = 0; break;
1240 search_path = argv[optind++]; 1238 search_path = argv[optind++];
1241 scanelf_dir(search_path); 1239 scanelf_dir(search_path);
1242 } 1240 }
1243 1241
1244 /* clean up */ 1242 /* clean up */
1245 if (find_sym) { 1243 if (versioned_symname) free(versioned_symname);
1246 free(find_sym);
1247 free(versioned_symname);
1248 }
1249 if (find_lib) free(find_lib);
1250 if (out_format) free(out_format);
1251 for (i = 0; ldpaths[i]; ++i) 1244 for (i = 0; ldpaths[i]; ++i)
1252 free(ldpaths[i]); 1245 free(ldpaths[i]);
1253} 1246}
1254 1247
1255 1248

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.93

  ViewVC Help
Powered by ViewVC 1.1.20