| 264 | static char * stdout_sep = "\r"; |
| 265 | static char * stderr_sep = "\r"; |
| 266 | static void test_tty(void) |
| 267 | { |
| 268 | #if defined(__MINGW32__) |
| 269 | HANDLE handle; |
| 270 | handle = (HANDLE) _get_osfhandle(_fileno(stdout)); |
| 271 | if ((handle != INVALID_HANDLE_VALUE) && (GetFileType(handle) == FILE_TYPE_CHAR)) |
| 272 | { |
| 273 | stdout_tty = 1; |
| 274 | } |
| 275 | handle = (HANDLE) _get_osfhandle(_fileno(stderr)); |
| 276 | if ((handle != INVALID_HANDLE_VALUE) && (GetFileType(handle) == FILE_TYPE_CHAR)) |
| 277 | { |
| 278 | stderr_tty = 1; |
| 279 | } |
| 280 | #else |
| 281 | if (isatty(1) == 1) |
| 282 | { |
| 283 | stdout_tty = 1; |
| 284 | } |
| 285 | if (isatty(2) == 1) |
| 286 | { |
| 287 | stderr_tty = 1; |
| 288 | } |
| 289 | #endif |
| 290 | |
| 291 | /* |
| 292 | if (stdout_tty == 1) stdout_sep = "\r"; |
| 293 | if (stderr_tty == 1) stderr_sep = "\r"; |
| 294 | */ |
| 295 | } |
| 296 | |
| 297 | /**************************************************************************** |
| 298 | * hb_error_handler |