mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 16:54:02 +00:00
Don't use curses includes, include termcap.h instead
Add ^C reaction set
This commit is contained in:
parent
ecb7192ace
commit
bd82d8ab8f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61289
15
bin/ls/ls.c
15
bin/ls/ls.c
|
@ -53,9 +53,6 @@ static const char rcsid[] =
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#ifdef COLORLS
|
|
||||||
#include <curses.h>
|
|
||||||
#endif
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -65,10 +62,11 @@ static const char rcsid[] =
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef COLORLS
|
|
||||||
#include <term.h>
|
|
||||||
#endif
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifdef COLORLS
|
||||||
|
#include <termcap.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ls.h"
|
#include "ls.h"
|
||||||
#include "extern.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_bgcol; /* ANSI sequence to set background colour */
|
||||||
char *ansi_fgcol; /* ANSI sequence to set foreground colour */
|
char *ansi_fgcol; /* ANSI sequence to set foreground colour */
|
||||||
char *ansi_coloff; /* ANSI sequence to reset colours */
|
char *ansi_coloff; /* ANSI sequence to reset colours */
|
||||||
|
extern void colorquit __P((int));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int rval;
|
int rval;
|
||||||
|
@ -299,8 +298,10 @@ main(argc, argv)
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
#ifdef COLORLS
|
#ifdef COLORLS
|
||||||
if (f_color)
|
if (f_color) {
|
||||||
|
(void) signal(SIGINT, colorquit);
|
||||||
parsecolors(getenv("LSCOLORS"));
|
parsecolors(getenv("LSCOLORS"));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue