Skip to content
Snippets Groups Projects
Commit 1144a1f5 authored by deuce's avatar deuce
Browse files

Try closing stdout to avoid the Win32 magical echo.

parent 3a4b92d2
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,8 @@ int ansi_row=0; ...@@ -31,6 +31,8 @@ int ansi_row=0;
int ansi_col=0; int ansi_col=0;
int force_move=1; int force_move=1;
int outfd;
/* Control sequence table definitions. */ /* Control sequence table definitions. */
typedef struct typedef struct
{ {
...@@ -137,7 +139,7 @@ void ansi_sendch(char ch) ...@@ -137,7 +139,7 @@ void ansi_sendch(char ch)
ansi_row=ansi_rows-1; ansi_row=ansi_rows-1;
} }
} }
fwrite(&ch,1,1,stdout); write(outfd,&ch,1);
if(ch<' ') if(ch<' ')
force_move=1; force_move=1;
} }
...@@ -148,7 +150,7 @@ void ansi_sendstr(char *str,int len) ...@@ -148,7 +150,7 @@ void ansi_sendstr(char *str,int len)
if(len==-1) if(len==-1)
len=strlen(str); len=strlen(str);
if(len) { if(len) {
fwrite(str,len,1,stdout); write(outfd,str,len);
} }
} }
...@@ -639,6 +641,8 @@ int ansi_initciolib(long inmode) ...@@ -639,6 +641,8 @@ int ansi_initciolib(long inmode)
atexit(ansi_fixterm); atexit(ansi_fixterm);
} }
#endif #endif
outfd=dup(fileno(stdout));
fclose(stdout);
vmem=(WORD *)malloc(ansi_rows*ansi_cols*sizeof(WORD)); vmem=(WORD *)malloc(ansi_rows*ansi_cols*sizeof(WORD));
ansi_sendstr(init,-1); ansi_sendstr(init,-1);
for(i=0;i<ansi_rows*ansi_cols;i++) for(i=0;i<ansi_rows*ansi_cols;i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment