always disable stdout buffering
@@ -143,6 +143,7 @@ int main(int argc, pchar *argv[]) {
# endif
hl_global_init(&ctx);
hl_sys_init((void**)argv,argc,file);
+ setbuf(stdout,NULL); // disable stdout buffering
ctx.code = load_code(file);
if( ctx.code == NULL )
return 1;
@@ -152,8 +153,6 @@ int main(int argc, pchar *argv[]) {
if( !hl_module_init(ctx.m, &argc) )
return 3;
hl_code_free(ctx.code);
- if( debug_port > 0 )
- setbuf(stdout,NULL);
if( debug_port > 0 && !hl_module_debug(ctx.m,debug_port,debug_wait) ) {
fprintf(stderr,"Could not start debugger on port %d",debug_port);
return 4;
