mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	tools/pw-dump: fix parentheses around isatty() call
				
					
				
			Previously,
  isatty(fileno(data.out) && getenv("NO_COLOR") == NULL))
would call `isatty()` with
  fileno(data.out) && getenv("NO_COLOR") == NULL
as its argument. This meant that, for example,
  NO_COLOR=1 pw-dump
would still produce colored output when run with
a TTY as its standard input.
Fix that by moving the parenthesis.
Fixes: af63d08453 ("tools/pw-dump: only print colors if we're connected to a terminal")
			
			
This commit is contained in:
		
							parent
							
								
									02decd9fba
								
							
						
					
					
						commit
						68f75bbd57
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1429,7 +1429,7 @@ int main(int argc, char *argv[])
 | 
				
			||||||
	pw_init(&argc, &argv);
 | 
						pw_init(&argc, &argv);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	data.out = stdout;
 | 
						data.out = stdout;
 | 
				
			||||||
	if (isatty(fileno(data.out) && getenv("NO_COLOR") == NULL))
 | 
						if (isatty(fileno(data.out)) && getenv("NO_COLOR") == NULL)
 | 
				
			||||||
		colors = true;
 | 
							colors = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while ((c = getopt_long(argc, argv, "hVr:mN", long_options, NULL)) != -1) {
 | 
						while ((c = getopt_long(argc, argv, "hVr:mN", long_options, NULL)) != -1) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue