aboutsummaryrefslogtreecommitdiff
path: root/bin/pwd
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2002-02-10 05:56:36 +0000
committerMike Barcroft <mike@FreeBSD.org>2002-02-10 05:56:36 +0000
commit3ce3a0bf8dd196bbf74dc736716c62ebe65b25c6 (patch)
tree609096612d39c8e4e8433008800b6f3f31eb8b15 /bin/pwd
parent56e04d01c0e1b6bd330735e02e4cc3295267740f (diff)
downloadsrc-3ce3a0bf8dd196bbf74dc736716c62ebe65b25c6.tar.gz
src-3ce3a0bf8dd196bbf74dc736716c62ebe65b25c6.zip
Use the getprogname(3) function instead of directly accessing
`__progname'. Submitted by: dd
Notes
Notes: svn path=/head/; revision=90458
Diffstat (limited to 'bin/pwd')
-rw-r--r--bin/pwd/pwd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bin/pwd/pwd.c b/bin/pwd/pwd.c
index a05f04effb99..6302c28015e3 100644
--- a/bin/pwd/pwd.c
+++ b/bin/pwd/pwd.c
@@ -56,8 +56,6 @@ static const char rcsid[] =
#include <unistd.h>
#include <sys/param.h>
-extern char *__progname;
-
static char *getcwd_logical(void);
void usage(void);
@@ -69,7 +67,7 @@ main(int argc, char *argv[])
char *p;
char buf[PATH_MAX];
- if (strcmp(__progname, "realpath") == 0) {
+ if (strcmp(getprogname(), "realpath") == 0) {
if (argc != 2)
usage();
if ((p = realpath(argv[1], buf)) == NULL)
@@ -109,7 +107,7 @@ void
usage(void)
{
- if (strcmp(__progname, "realpath") == 0)
+ if (strcmp(getprogname(), "realpath") == 0)
(void)fprintf(stderr, "usage: realpath [path]\n");
else
(void)fprintf(stderr, "usage: pwd [-L | -P]\n");