mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
Remove the tput shit
This commit is contained in:
parent
f0678cfa5a
commit
18deba1a51
1 changed files with 0 additions and 40 deletions
40
con.c
40
con.c
|
@ -199,46 +199,6 @@ static void con_enablecolor() {
|
|||
console.color_err = !!(isatty(STDERR_FILENO));
|
||||
if (console.handle_out == stderr || console.handle_out == stdout)
|
||||
console.color_out = !!(isatty(STDOUT_FILENO));
|
||||
|
||||
#ifndef _WIN32
|
||||
{
|
||||
char buf[4] = {0, 0, 0, 0};
|
||||
|
||||
/*
|
||||
* This is such a hack. But I'm not linking in any libraries to
|
||||
* do this stupidity. It's insane there is simply not a ttyhascolor
|
||||
* in unistd.h
|
||||
*/
|
||||
FILE *tput = popen("tput colors", "r");
|
||||
if (!tput) {
|
||||
/*
|
||||
* disable colors since we can't determine without tput
|
||||
* which should be guranteed on all *nix OSes
|
||||
*/
|
||||
console.color_err = 0;
|
||||
console.color_out = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle to tput was a success, lets read in the amount of
|
||||
* color support. It should be at minimal 8.
|
||||
*/
|
||||
fread(buf, 1, sizeof(buf)-1, tput);
|
||||
|
||||
if (atoi(buf) < 8) {
|
||||
console.color_err = 0;
|
||||
console.color_out = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* We made it this far, which means we support colors in the
|
||||
* terminal.
|
||||
*/
|
||||
fclose(tput);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue