summaryrefslogtreecommitdiffstats
path: root/bin/ls/util.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>1998-04-24 12:43:26 +0000
committerdes <des@FreeBSD.org>1998-04-24 12:43:26 +0000
commit7f8983e5f50864be87a5d978f4c4b46e8c1b7591 (patch)
tree4ac5da9a8bccd136cbb8d25743982b314a2cb5c4 /bin/ls/util.c
parent8047e5cea0b71ae987d9b5d875ebbd2e416bc4cc (diff)
downloadFreeBSD-src-7f8983e5f50864be87a5d978f4c4b46e8c1b7591.zip
FreeBSD-src-7f8983e5f50864be87a5d978f4c4b46e8c1b7591.tar.gz
o Removed two unused variables (f_dirname and f_newline) in ls.c
o Added the -H and -P options for treatment of symbolic links. o Removed the #ifdef BSD4_4_LITE, since it does not seem to do anything useful o Fixed up prn_octal() so its output looks more like that of AT&T Unices when -b is given. The next two lines apply only to the first two changes above: PR: bin/6140 Submitted by: Max Euston
Diffstat (limited to 'bin/ls/util.c')
-rw-r--r--bin/ls/util.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/bin/ls/util.c b/bin/ls/util.c
index f72ef6c..3d16088 100644
--- a/bin/ls/util.c
+++ b/bin/ls/util.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)util.c 8.3 (Berkeley) 4/2/94";
#else
static const char rcsid[] =
- "$Id: util.c,v 1.12 1998/04/21 22:02:01 des Exp $";
+ "$Id: util.c,v 1.13 1998/04/24 07:49:51 des Exp $";
#endif
#endif /* not lint */
@@ -103,22 +103,14 @@ prn_octal(s)
while ((ch = *s++))
{
- if (isprint(ch)) putchar(ch), len++;
+ if (isprint(ch) && (ch != '\"') && (ch != '\\'))
+ putchar(ch), len++;
else if (f_octal_escape) {
putchar('\\');
switch (ch) {
- case 0:
- putchar('0');
- break;
case '\\':
putchar('\\');
break;
- case '\?':
- putchar('?');
- break;
- case '\'':
- putchar('\'');
- break;
case '\"':
putchar('"');
break;
@@ -166,10 +158,7 @@ prn_octal(s)
void
usage()
{
-#ifdef BSD4_4_LITE
- (void)fprintf(stderr, "usage: ls [-1ACFLRTacdfiklqrstu] [file ...]\n");
-#else
- (void)fprintf(stderr, "usage: ls [-ACFLRTWacdfgikloqrstu1] [file ...]\n");
-#endif
+ (void)fprintf(stderr, "usage: ls [-?ACFHLPRTWacdfgikloqrstu1]"
+ " [file ...]\n");
exit(1);
}
OpenPOWER on IntegriCloud