Commit 5a40e744 authored by deuce's avatar deuce
Browse files

New bug introduced in f* fixes, and break the input loop on an error reading

stdin in uifcx getstr().
parent aa608173
......@@ -2719,7 +2719,8 @@ static void help(void)
if(fread(str,12,1,fp)!=1)
break;
str[12]=0;
if(fread(&line,2,1,fp)!=1);
if(fread(&line,2,1,fp)!=1)
break;
if(stricmp(str,p) || line!=helpline) {
if(fseek(fp,4,SEEK_CUR)==0)
break;
......
......@@ -121,7 +121,8 @@ static int getstr(char* str, int maxlen)
istty=isatty(fileno(stdin));
#endif
while(1) {
fread(&ch,1,1,stdin);
if(fread(&ch,1,1,stdin)!=1)
break;
#ifdef __unix__
if(!istty) {
printf("%c",ch);
......@@ -414,7 +415,8 @@ void help()
if(fread(str,12,1,fp)!=1)
break;
str[12]=0;
if(fread(&line,2,1,fp)!=1);
if(fread(&line,2,1,fp)!=1)
break;
if(stricmp(str,p) || line!=helpline) {
if(fseek(fp,4,SEEK_CUR)==0)
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment