As ecolor does not take a tty, try and guess a valid one.
This commit is contained in:
		@@ -319,7 +319,19 @@ hidden_def(ecolor)
 | 
			
		||||
 | 
			
		||||
const char *ecolor (einfo_color_t color)
 | 
			
		||||
{
 | 
			
		||||
	return (_ecolor (stdout, color));
 | 
			
		||||
	FILE *f = stdout;
 | 
			
		||||
 | 
			
		||||
	/* Try and guess a valid tty */
 | 
			
		||||
	if (! isatty (fileno (f))) {
 | 
			
		||||
		f = stderr;
 | 
			
		||||
		if (! isatty (fileno (f))) {
 | 
			
		||||
			f = stdin;
 | 
			
		||||
			if (! isatty (fileno (f)))
 | 
			
		||||
				f = NULL;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (_ecolor (f, color));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define EINFOVN(_file, _color) \
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user