/[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.33 Revision 1.34
1/* 1/*
2 * Copyright 2003 Ned Ludd <solar@gentoo.org> 2 * Copyright 2003 Ned Ludd <solar@gentoo.org>
3 * Copyright 1999-2005 Gentoo Foundation 3 * Copyright 1999-2005 Gentoo Foundation
4 * Distributed under the terms of the GNU General Public License v2 4 * Distributed under the terms of the GNU General Public License v2
5 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.33 2005/04/10 15:15:40 solar Exp $ 5 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.34 2005/04/12 19:11:32 solar Exp $
6 * 6 *
7 ******************************************************************** 7 ********************************************************************
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as 9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the 10 * published by the Free Software Foundation; either version 2 of the
33#include <getopt.h> 33#include <getopt.h>
34#include <assert.h> 34#include <assert.h>
35 35
36#include "paxelf.h" 36#include "paxelf.h"
37 37
38static const char *rcsid = "$Id: scanelf.c,v 1.33 2005/04/10 15:15:40 solar Exp $"; 38static const char *rcsid = "$Id: scanelf.c,v 1.34 2005/04/12 19:11:32 solar Exp $";
39 39
40 40
41/* helper functions for showing errors */ 41/* helper functions for showing errors */
42#define argv0 "scanelf" /*((*argv != NULL) ? argv[0] : __FILE__ "\b\b")*/ 42#define argv0 "scanelf" /*((*argv != NULL) ? argv[0] : __FILE__ "\b\b")*/
43#define warn(fmt, args...) \ 43#define warn(fmt, args...) \
406} 406}
407 407
408/* scan env PATH for paths */ 408/* scan env PATH for paths */
409static void scanelf_envpath() 409static void scanelf_envpath()
410{ 410{
411 char *orig_path, *path, *p; 411 char *path, *p;
412 412
413 path = getenv("PATH"); 413 path = getenv("PATH");
414 if (!path) 414 if (!path)
415 err("PATH is not set in your env !"); 415 err("PATH is not set in your env !");
416 416
417 if ((orig_path = path = strdup(path)) == NULL) 417 if ((path = strdup(path)) == NULL)
418 err("strdup failed: %s", strerror(errno)); 418 err("strdup failed: %s", strerror(errno));
419 419
420 while ((p = strrchr(path, ':')) != NULL) { 420 while ((p = strrchr(path, ':')) != NULL) {
421 scanelf_dir(p + 1); 421 scanelf_dir(p + 1);
422 *p = 0; 422 *p = 0;
423 } 423 }
424 424
425 free(orig_path); 425 free(path);
426} 426}
427 427
428 428
429 429
430/* usage / invocation handling functions */ 430/* usage / invocation handling functions */

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.20