summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-07-08 04:19:36 +0000
committerJim Meyering <jim@meyering.net>1996-07-08 04:19:36 +0000
commit9d691ba42fd8c2ec1335ebfa074103330e63cb08 (patch)
tree8030e7d365b1ca2c7a6d486efa91736a05d12229 /src/ls.c
parent744ef2d96fa7cde53068b3ee302b1bd37dd579ba (diff)
downloadcoreutils-9d691ba42fd8c2ec1335ebfa074103330e63cb08.tar.xz
Include termios.h.
Guard inclusion of sys/ioctl.h with #ifdef GWINSZ_IN_SYS_IOCTL, rather than HAVE_SYS_IOCTL_H. Modelled after sh-utils' stty.c at suggestion from Chip Bennett <BennettC@j64.stratcom.af.mil>.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/ls.c b/src/ls.c
index 2d5ec3500..0b72a3d2a 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -43,7 +43,8 @@
#include <config.h>
#include <sys/types.h>
-#if HAVE_SYS_IOCTL_H
+#include <termios.h>
+#ifdef GWINSZ_IN_SYS_IOCTL
# include <sys/ioctl.h>
#endif
@@ -129,24 +130,6 @@ struct bin_str
char *string; /* Pointer to the same */
};
-struct bin_str color_indicator[] =
- {
- { LEN_STR_PAIR ("\033[") }, /* lc: Left of color sequence */
- { LEN_STR_PAIR ("m") }, /* rc: Right of color sequence */
- { 0, NULL }, /* ec: End color (replaces lc+no+rc) */
- { LEN_STR_PAIR ("0") }, /* no: Normal */
- { LEN_STR_PAIR ("0") }, /* fi: File: default */
- { LEN_STR_PAIR ("32") }, /* di: Directory: green */
- { LEN_STR_PAIR ("36") }, /* ln: Symlink: cyan */
- { LEN_STR_PAIR ("31") }, /* pi: Pipe: red */
- { LEN_STR_PAIR ("33") }, /* so: Socket: yellow/brown */
- { LEN_STR_PAIR ("44;37") }, /* bd: Block device: white on blue */
- { LEN_STR_PAIR ("44;37") }, /* cd: Char device: white on blue */
- { 0, NULL }, /* mi: Missing file: undefined */
- { 0, NULL }, /* or: Orphanned symlink: undefined */
- { LEN_STR_PAIR ("35") } /* ex: Executable: purple */
- };
-
#ifndef STDC_HEADERS
char *ctime ();
time_t time ();
@@ -392,6 +375,24 @@ struct col_ext_type
struct col_ext_type *next; /* Next in list */
};
+static struct bin_str color_indicator[] =
+ {
+ { LEN_STR_PAIR ("\033[") }, /* lc: Left of color sequence */
+ { LEN_STR_PAIR ("m") }, /* rc: Right of color sequence */
+ { 0, NULL }, /* ec: End color (replaces lc+no+rc) */
+ { LEN_STR_PAIR ("0") }, /* no: Normal */
+ { LEN_STR_PAIR ("0") }, /* fi: File: default */
+ { LEN_STR_PAIR ("32") }, /* di: Directory: green */
+ { LEN_STR_PAIR ("36") }, /* ln: Symlink: cyan */
+ { LEN_STR_PAIR ("31") }, /* pi: Pipe: red */
+ { LEN_STR_PAIR ("33") }, /* so: Socket: yellow/brown */
+ { LEN_STR_PAIR ("44;37") }, /* bd: Block device: white on blue */
+ { LEN_STR_PAIR ("44;37") }, /* cd: Char device: white on blue */
+ { 0, NULL }, /* mi: Missing file: undefined */
+ { 0, NULL }, /* or: Orphanned symlink: undefined */
+ { LEN_STR_PAIR ("35") } /* ex: Executable: purple */
+ };
+
/* FIXME: comment */
struct col_ext_type *col_ext_list = NULL;