Codebase list libmawk / a323d5b2-e0eb-4fad-b708-b7817dc988fe/main src / libmawk / viohack.c
a323d5b2-e0eb-4fad-b708-b7817dc988fe/main

Tree @a323d5b2-e0eb-4fad-b708-b7817dc988fe/main (Download .tar.gz)

viohack.c @a323d5b2-e0eb-4fad-b708-b7817dc988fe/main

b761e9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/********************************************
libmawk (C) 2014, Tibor 'Igor2' Palinkas;

This is a source file for libmawk, an implementation of
the AWK programming language, fork of mawk.

Libmawk is distributed without warranty under the terms of
the GNU General Public License, version 2, 1991.
********************************************/

#include "mawk.h"
#include "field.h"

extern int isatty(int);

void mawk_detect_interactive(mawk_state_t *MAWK)
{
	if (isatty(0) && MAWK->rs_shadow.type == SEP_CHAR && MAWK->rs_shadow.c == '\n') {
		/* interactive line buffered mode */
		MAWK->interactive_flag = 1;
	}
}