summaryrefslogtreecommitdiff
path: root/bin/ls/ls.c
diff options
context:
space:
mode:
authorJared Yanovich <jaredy@cvs.openbsd.org>2005-03-10 00:22:09 +0000
committerJared Yanovich <jaredy@cvs.openbsd.org>2005-03-10 00:22:09 +0000
commitecc145b5f7504c19807f9cb8f2b0b8ec603a985a (patch)
tree1b49e1260c4a8386c50bec76ba188ced8e697f48 /bin/ls/ls.c
parent7734ae4ad1d7e2b65db45eb91bb9da8bb8c4978d (diff)
use fts_path if fts_name is not available, tweak and ok millert
Diffstat (limited to 'bin/ls/ls.c')
-rw-r--r--bin/ls/ls.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 397cf106fa1..7c54ebfd212 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ls.c,v 1.22 2004/04/02 07:31:06 otto Exp $ */
+/* $OpenBSD: ls.c,v 1.23 2005/03/10 00:22:08 jaredy Exp $ */
/* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */
/*
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94";
#else
-static char rcsid[] = "$OpenBSD: ls.c,v 1.22 2004/04/02 07:31:06 otto Exp $";
+static char rcsid[] = "$OpenBSD: ls.c,v 1.23 2005/03/10 00:22:08 jaredy Exp $";
#endif
#endif /* not lint */
@@ -391,7 +391,8 @@ traverse(int argc, char *argv[], int options)
break;
case FTS_DNR:
case FTS_ERR:
- warnx("%s: %s", p->fts_name, strerror(p->fts_errno));
+ warnx("%s: %s", p->fts_name[0] == '\0' ? p->fts_path :
+ p->fts_name, strerror(p->fts_errno));
rval = 1;
break;
}