gets() fixes.
This commit is contained in:
parent
eb2788f010
commit
7c4ce41803
|
@ -665,13 +665,20 @@ INT32 __cdecl CRTDLL_fflush(LPVOID stream)
|
||||||
*/
|
*/
|
||||||
LPSTR __cdecl CRTDLL_gets(LPSTR buf)
|
LPSTR __cdecl CRTDLL_gets(LPSTR buf)
|
||||||
{
|
{
|
||||||
char * ret;
|
int cc;
|
||||||
/* BAD, for the whole WINE process blocks... just done this way to test
|
LPSTR buf_start = buf;
|
||||||
* windows95's ftp.exe.
|
|
||||||
*/
|
/* BAD, for the whole WINE process blocks... just done this way to test
|
||||||
ret = gets(buf);
|
* windows95's ftp.exe.
|
||||||
TRACE(crtdll,"got %s\n",ret);
|
*/
|
||||||
return ret;
|
|
||||||
|
for(cc = fgetc(stdin); cc != EOF && cc != '\n'; cc = fgetc(stdin))
|
||||||
|
if(cc != '\r') *buf++ = (char)cc;
|
||||||
|
|
||||||
|
*buf = '\0';
|
||||||
|
|
||||||
|
TRACE(crtdll,"got '%s'\n", buf_start);
|
||||||
|
return buf_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue