/[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.74 Revision 1.75
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.74 2005/06/05 09:42:06 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.75 2005/06/06 23:32:38 vapier Exp $
5 * 5 *
6 ******************************************************************** 6 ********************************************************************
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as 8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the 9 * published by the Free Software Foundation; either version 2 of the
33#include <dirent.h> 33#include <dirent.h>
34#include <getopt.h> 34#include <getopt.h>
35#include <assert.h> 35#include <assert.h>
36#include "paxelf.h" 36#include "paxelf.h"
37 37
38static const char *rcsid = "$Id: scanelf.c,v 1.74 2005/06/05 09:42:06 vapier Exp $"; 38static const char *rcsid = "$Id: scanelf.c,v 1.75 2005/06/06 23:32:38 vapier Exp $";
39#define argv0 "scanelf" 39#define argv0 "scanelf"
40 40
41#define IS_MODIFIER(c) (c == '%' || c == '#') 41#define IS_MODIFIER(c) (c == '%' || c == '#')
42 42
43 43
264 *r = (char*)(elf->data + offset); \ 264 *r = (char*)(elf->data + offset); \
265 /* If quiet, don't output paths in ld.so.conf */ \ 265 /* If quiet, don't output paths in ld.so.conf */ \
266 if (be_quiet) { \ 266 if (be_quiet) { \
267 size_t len; \ 267 size_t len; \
268 char *start, *end; \ 268 char *start, *end; \
269 for (s = 0; *r && ldpaths[s]; ++s) { \ 269 /* note that we only 'chop' off leading known paths. */ \
270 /* since *r is read-only memory, we can only move the ptr forward. */ \
271 start = *r; \
270 /* scan each path in : delimited list */ \ 272 /* scan each path in : delimited list */ \
271 start = *r; \ 273 while (start) { \
272 end = strchr(start, ':'); \ 274 end = strchr(start, ':'); \
273 while ((start && ((end = strchr(start, ':')) != NULL)) || start) { \
274 len = (end ? abs(end - start) : strlen(start)); \ 275 len = (end ? abs(end - start) : strlen(start)); \
276 for (s = 0; ldpaths[s]; ++s) { \
275 if (!strncmp(ldpaths[s], start, len) && !ldpaths[s][len]) { \ 277 if (!strncmp(ldpaths[s], start, len) && !ldpaths[s][len]) { \
276 *r = (end ? end + 1 : NULL); \ 278 *r = (end ? end + 1 : NULL); \
277 break; \ 279 break; \
278 } \ 280 } \
279 start = (end ? start + len + 1 : NULL); \
280 } \ 281 } \
282 if (!*r || !ldpaths[s] || !end) \
283 start = NULL; \
284 else \
285 start = start + len + 1; \
281 } \ 286 } \
282 } \ 287 } \
283 if (*r) *found_rpath = 1; \ 288 if (*r) *found_rpath = 1; \
284 } \ 289 } \
285 ++dyn; \ 290 ++dyn; \

Legend:
Removed from v.1.74  
changed lines
  Added in v.1.75

  ViewVC Help
Powered by ViewVC 1.1.20