aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-03-21 05:33:33 +0000
committerMike Frysinger <vapier@gentoo.org>2014-03-21 05:33:33 +0000
commitcdd9dba1ce881de278eebf8014cef9c5c0eb9fc9 (patch)
tree62f47824abf706ff3ffa937deade97440067eec1
parentrewrite which() so that it works and does not break $PATH (diff)
downloadpax-utils-cdd9dba1ce881de278eebf8014cef9c5c0eb9fc9.tar.gz
pax-utils-cdd9dba1ce881de278eebf8014cef9c5c0eb9fc9.tar.bz2
pax-utils-cdd9dba1ce881de278eebf8014cef9c5c0eb9fc9.zip
note that which() does not handle PATH="/foo::/bar" correctlyv0.8.1
-rw-r--r--scanelf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/scanelf.c b/scanelf.c
index 43cfc84..0fb108d 100644
--- a/scanelf.c
+++ b/scanelf.c
@@ -1,13 +1,13 @@
/*
* Copyright 2003-2012 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.264 2014/03/21 05:27:21 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.265 2014/03/21 05:33:33 vapier Exp $
*
* Copyright 2003-2012 Ned Ludd - <solar@gentoo.org>
* Copyright 2004-2012 Mike Frysinger - <vapier@gentoo.org>
*/
-static const char rcsid[] = "$Id: scanelf.c,v 1.264 2014/03/21 05:27:21 vapier Exp $";
+static const char rcsid[] = "$Id: scanelf.c,v 1.265 2014/03/21 05:33:33 vapier Exp $";
const char argv0[] = "scanelf";
#include "paxinc.h"
@@ -72,7 +72,8 @@ static unsigned long setpax = 0UL;
static const char *objdump;
-/* find the path to a file by name */
+/* Find the path to a file by name. Note: we do not currently handle the
+ * empty path element correctly (should behave by searching $PWD). */
static const char *which(const char *fname, const char *envvar)
{
size_t path_len, fname_len;