mirror of https://github.com/YosysHQ/abc.git
Merge pull request #514 from maliberty/fix-non-readline-prompt-pipe
mainUtils: match readline behavior when ABC_USE_READLINE is undefined
This commit is contained in:
commit
cd33ba563f
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "base/abc/abc.h"
|
#include "base/abc/abc.h"
|
||||||
#include "mainInt.h"
|
#include "mainInt.h"
|
||||||
|
|
||||||
|
|
@ -91,7 +93,13 @@ char * Abc_UtilsGetUsersInput( Abc_Frame_t * pAbc )
|
||||||
{
|
{
|
||||||
char * pRetValue;
|
char * pRetValue;
|
||||||
fprintf( pAbc->Out, "%s", Prompt );
|
fprintf( pAbc->Out, "%s", Prompt );
|
||||||
|
fflush( pAbc->Out );
|
||||||
pRetValue = fgets( Prompt, 5000, stdin );
|
pRetValue = fgets( Prompt, 5000, stdin );
|
||||||
|
if ( pRetValue == NULL ) { exit(0); }
|
||||||
|
if ( !isatty( fileno(stdin) ) ) {
|
||||||
|
fputs( Prompt, pAbc->Out );
|
||||||
|
fflush( pAbc->Out );
|
||||||
|
}
|
||||||
return Prompt;
|
return Prompt;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue