summaryrefslogtreecommitdiffstats
path: root/bin/ls/ls.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-06-05 19:36:06 +0000
committerache <ache@FreeBSD.org>2000-06-05 19:36:06 +0000
commit5051e56f813eef50c686459b47df5a21d98ae6de (patch)
tree667088123a2472ec97326ed287b1069cd848a026 /bin/ls/ls.c
parent6a455e7b4214e71975ac876a3776d4342fbdc235 (diff)
downloadFreeBSD-src-5051e56f813eef50c686459b47df5a21d98ae6de.zip
FreeBSD-src-5051e56f813eef50c686459b47df5a21d98ae6de.tar.gz
Don't use curses includes, include termcap.h instead
Add ^C reaction set
Diffstat (limited to 'bin/ls/ls.c')
-rw-r--r--bin/ls/ls.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index ee9da2c..88b1d6d 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -53,9 +53,6 @@ static const char rcsid[] =
#include <sys/stat.h>
#include <sys/ioctl.h>
-#ifdef COLORLS
-#include <curses.h>
-#endif
#include <dirent.h>
#include <err.h>
#include <errno.h>
@@ -65,10 +62,11 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#ifdef COLORLS
-#include <term.h>
+#include <termcap.h>
+#include <signal.h>
#endif
-#include <unistd.h>
#include "ls.h"
#include "extern.h"
@@ -123,6 +121,7 @@ int f_color; /* add type in color for non-regular files */
char *ansi_bgcol; /* ANSI sequence to set background colour */
char *ansi_fgcol; /* ANSI sequence to set foreground colour */
char *ansi_coloff; /* ANSI sequence to reset colours */
+extern void colorquit __P((int));
#endif
int rval;
@@ -299,8 +298,10 @@ main(argc, argv)
argv += optind;
#ifdef COLORLS
- if (f_color)
+ if (f_color) {
+ (void) signal(SIGINT, colorquit);
parsecolors(getenv("LSCOLORS"));
+ }
#endif
/*
OpenPOWER on IntegriCloud