summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-02-03 05:16:22 +0000
committerJim Meyering <jim@meyering.net>1999-02-03 05:16:22 +0000
commit43aa4122fc84ca2695e7644f7dd942e9808c73c2 (patch)
tree605ca3f397364faae4efc9496670a0ecca1f1ee7 /src
parenta6d30604508a1e9b4425d874f9eede2b34d3a33e (diff)
downloadcoreutils-43aa4122fc84ca2695e7644f7dd942e9808c73c2.tar.xz
(print_type_indicator): Print doors as '>'.
(length_of_file_name_and_frills): Account for this.
Diffstat (limited to 'src')
-rw-r--r--src/ls.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/ls.c b/src/ls.c
index 4760279a2..4e40aa835 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -1,5 +1,5 @@
/* `dir', `vdir' and `ls' directory listing programs for GNU.
- Copyright (C) 85, 88, 90, 91, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 85, 88, 90, 91, 1995-1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -372,13 +372,13 @@ enum color_type
enum indicator_no
{
C_LEFT, C_RIGHT, C_END, C_NORM, C_FILE, C_DIR, C_LINK, C_FIFO, C_SOCK,
- C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC
+ C_BLK, C_CHR, C_MISSING, C_ORPHAN, C_EXEC, C_DOOR
};
static const char *const indicator_name[]=
{
"lc", "rc", "ec", "no", "fi", "di", "ln", "pi", "so",
- "bd", "cd", "mi", "or", "ex", NULL
+ "bd", "cd", "mi", "or", "ex", "do", NULL
};
struct color_ext_type
@@ -2415,6 +2415,11 @@ print_type_indicator (unsigned int mode)
DIRED_PUTCHAR ('=');
#endif
+#ifdef S_ISDOOR
+ if (S_ISDOOR (mode))
+ DIRED_PUTCHAR ('>');
+#endif
+
if (S_ISREG (mode) && indicator_style == classify
&& (mode & S_IXUGO))
DIRED_PUTCHAR ('*');
@@ -2465,6 +2470,11 @@ print_color_indicator (const char *name, unsigned int mode, int linkok)
type = C_CHR;
#endif
+#ifdef S_ISDOOR
+ else if (S_ISDOOR (mode))
+ type = C_DOOR;
+#endif
+
if (type == C_FILE && (mode & S_IXUGO) != 0)
type = C_EXEC;
@@ -2537,6 +2547,9 @@ length_of_file_name_and_frills (const struct fileinfo *f)
#ifdef S_ISSOCK
|| S_ISSOCK (filetype)
#endif
+#ifdef S_ISDOOR
+ || S_ISDOOR (filetype)
+#endif
)
len += 1;
}