mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 10:12:17 +00:00
msvcr80: Add gets_s implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45393 Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
13f9461e99
commit
6b268e77bb
|
@ -140,7 +140,7 @@
|
||||||
@ cdecl getc(ptr) ucrtbase.getc
|
@ cdecl getc(ptr) ucrtbase.getc
|
||||||
@ cdecl getchar() ucrtbase.getchar
|
@ cdecl getchar() ucrtbase.getchar
|
||||||
@ cdecl gets(str) ucrtbase.gets
|
@ cdecl gets(str) ucrtbase.gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) ucrtbase.gets_s
|
||||||
@ cdecl getwc(ptr) ucrtbase.getwc
|
@ cdecl getwc(ptr) ucrtbase.getwc
|
||||||
@ cdecl getwchar() ucrtbase.getwchar
|
@ cdecl getwchar() ucrtbase.getwchar
|
||||||
@ cdecl putc(long ptr) ucrtbase.putc
|
@ cdecl putc(long ptr) ucrtbase.putc
|
||||||
|
|
|
@ -1700,7 +1700,7 @@
|
||||||
@ cdecl getenv(str) MSVCRT_getenv
|
@ cdecl getenv(str) MSVCRT_getenv
|
||||||
@ cdecl getenv_s(ptr ptr long str)
|
@ cdecl getenv_s(ptr ptr long str)
|
||||||
@ cdecl gets(str) MSVCRT_gets
|
@ cdecl gets(str) MSVCRT_gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) MSVCRT_gets_s
|
||||||
@ cdecl getwc(ptr) MSVCRT_getwc
|
@ cdecl getwc(ptr) MSVCRT_getwc
|
||||||
@ cdecl getwchar() MSVCRT_getwchar
|
@ cdecl getwchar() MSVCRT_getwchar
|
||||||
@ cdecl is_wctype(long long) ntdll.iswctype
|
@ cdecl is_wctype(long long) ntdll.iswctype
|
||||||
|
|
|
@ -2058,7 +2058,7 @@
|
||||||
@ cdecl getenv(str) MSVCRT_getenv
|
@ cdecl getenv(str) MSVCRT_getenv
|
||||||
@ cdecl getenv_s(ptr ptr long str)
|
@ cdecl getenv_s(ptr ptr long str)
|
||||||
@ cdecl gets(str) MSVCRT_gets
|
@ cdecl gets(str) MSVCRT_gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) MSVCRT_gets_s
|
||||||
@ cdecl getwc(ptr) MSVCRT_getwc
|
@ cdecl getwc(ptr) MSVCRT_getwc
|
||||||
@ cdecl getwchar() MSVCRT_getwchar
|
@ cdecl getwchar() MSVCRT_getwchar
|
||||||
@ cdecl is_wctype(long long) ntdll.iswctype
|
@ cdecl is_wctype(long long) ntdll.iswctype
|
||||||
|
|
|
@ -2204,7 +2204,7 @@
|
||||||
@ cdecl getenv(str) MSVCRT_getenv
|
@ cdecl getenv(str) MSVCRT_getenv
|
||||||
@ cdecl getenv_s(ptr ptr long str)
|
@ cdecl getenv_s(ptr ptr long str)
|
||||||
@ cdecl gets(str) MSVCRT_gets
|
@ cdecl gets(str) MSVCRT_gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) MSVCRT_gets_s
|
||||||
@ cdecl getwc(ptr) MSVCRT_getwc
|
@ cdecl getwc(ptr) MSVCRT_getwc
|
||||||
@ cdecl getwchar() MSVCRT_getwchar
|
@ cdecl getwchar() MSVCRT_getwchar
|
||||||
@ stub ilogb
|
@ stub ilogb
|
||||||
|
|
|
@ -1868,7 +1868,7 @@
|
||||||
@ cdecl getc(ptr) msvcr120.getc
|
@ cdecl getc(ptr) msvcr120.getc
|
||||||
@ cdecl getchar() msvcr120.getchar
|
@ cdecl getchar() msvcr120.getchar
|
||||||
@ cdecl gets(str) msvcr120.gets
|
@ cdecl gets(str) msvcr120.gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) msvcr120.gets_s
|
||||||
@ cdecl getwc(ptr) msvcr120.getwc
|
@ cdecl getwc(ptr) msvcr120.getwc
|
||||||
@ cdecl getwchar() msvcr120.getwchar
|
@ cdecl getwchar() msvcr120.getwchar
|
||||||
@ stub ilogb
|
@ stub ilogb
|
||||||
|
|
|
@ -1382,7 +1382,7 @@
|
||||||
@ cdecl getenv(str) MSVCRT_getenv
|
@ cdecl getenv(str) MSVCRT_getenv
|
||||||
@ cdecl getenv_s(ptr ptr long str)
|
@ cdecl getenv_s(ptr ptr long str)
|
||||||
@ cdecl gets(str) MSVCRT_gets
|
@ cdecl gets(str) MSVCRT_gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) MSVCRT_gets_s
|
||||||
@ cdecl getwc(ptr) MSVCRT_getwc
|
@ cdecl getwc(ptr) MSVCRT_getwc
|
||||||
@ cdecl getwchar() MSVCRT_getwchar
|
@ cdecl getwchar() MSVCRT_getwchar
|
||||||
@ cdecl is_wctype(long long) ntdll.iswctype
|
@ cdecl is_wctype(long long) ntdll.iswctype
|
||||||
|
|
|
@ -1355,7 +1355,7 @@
|
||||||
@ cdecl getenv(str) MSVCRT_getenv
|
@ cdecl getenv(str) MSVCRT_getenv
|
||||||
@ cdecl getenv_s(ptr ptr long str)
|
@ cdecl getenv_s(ptr ptr long str)
|
||||||
@ cdecl gets(str) MSVCRT_gets
|
@ cdecl gets(str) MSVCRT_gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) MSVCRT_gets_s
|
||||||
@ cdecl getwc(ptr) MSVCRT_getwc
|
@ cdecl getwc(ptr) MSVCRT_getwc
|
||||||
@ cdecl getwchar() MSVCRT_getwchar
|
@ cdecl getwchar() MSVCRT_getwchar
|
||||||
@ cdecl is_wctype(long long) ntdll.iswctype
|
@ cdecl is_wctype(long long) ntdll.iswctype
|
||||||
|
|
|
@ -4719,22 +4719,36 @@ int CDECL MSVCRT_getc(MSVCRT_FILE* file)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* gets (MSVCRT.@)
|
* gets_s (MSVCR80.@)
|
||||||
*/
|
*/
|
||||||
char * CDECL MSVCRT_gets(char *buf)
|
char * CDECL MSVCRT_gets_s(char *buf, MSVCRT_size_t len)
|
||||||
{
|
{
|
||||||
|
char *buf_start = buf;
|
||||||
int cc;
|
int cc;
|
||||||
char * buf_start = buf;
|
|
||||||
|
if (!MSVCRT_CHECK_PMT(buf != NULL)) return NULL;
|
||||||
|
if (!MSVCRT_CHECK_PMT(len != 0)) return NULL;
|
||||||
|
|
||||||
MSVCRT__lock_file(MSVCRT_stdin);
|
MSVCRT__lock_file(MSVCRT_stdin);
|
||||||
for(cc = MSVCRT__fgetc_nolock(MSVCRT_stdin); cc != MSVCRT_EOF && cc != '\n';
|
for(cc = MSVCRT__fgetc_nolock(MSVCRT_stdin);
|
||||||
|
len != 0 && cc != MSVCRT_EOF && cc != '\n';
|
||||||
cc = MSVCRT__fgetc_nolock(MSVCRT_stdin))
|
cc = MSVCRT__fgetc_nolock(MSVCRT_stdin))
|
||||||
{
|
{
|
||||||
if(cc != '\r')
|
if (cc != '\r')
|
||||||
|
{
|
||||||
*buf++ = (char)cc;
|
*buf++ = (char)cc;
|
||||||
|
len--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MSVCRT__unlock_file(MSVCRT_stdin);
|
MSVCRT__unlock_file(MSVCRT_stdin);
|
||||||
|
|
||||||
|
if (!len)
|
||||||
|
{
|
||||||
|
*buf_start = 0;
|
||||||
|
MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((cc == MSVCRT_EOF) && (buf_start == buf))
|
if ((cc == MSVCRT_EOF) && (buf_start == buf))
|
||||||
{
|
{
|
||||||
TRACE(":nothing read\n");
|
TRACE(":nothing read\n");
|
||||||
|
@ -4746,6 +4760,14 @@ char * CDECL MSVCRT_gets(char *buf)
|
||||||
return buf_start;
|
return buf_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* gets (MSVCRT.@)
|
||||||
|
*/
|
||||||
|
char * CDECL MSVCRT_gets(char *buf)
|
||||||
|
{
|
||||||
|
return MSVCRT_gets_s(buf, -1);
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _getws (MSVCRT.@)
|
* _getws (MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2337,7 +2337,7 @@
|
||||||
@ cdecl getenv(str) MSVCRT_getenv
|
@ cdecl getenv(str) MSVCRT_getenv
|
||||||
@ cdecl getenv_s(ptr ptr long str)
|
@ cdecl getenv_s(ptr ptr long str)
|
||||||
@ cdecl gets(str) MSVCRT_gets
|
@ cdecl gets(str) MSVCRT_gets
|
||||||
@ stub gets_s
|
@ cdecl gets_s(ptr long) MSVCRT_gets_s
|
||||||
@ cdecl getwc(ptr) MSVCRT_getwc
|
@ cdecl getwc(ptr) MSVCRT_getwc
|
||||||
@ cdecl getwchar() MSVCRT_getwchar
|
@ cdecl getwchar() MSVCRT_getwchar
|
||||||
@ cdecl hypot(double double) _hypot
|
@ cdecl hypot(double double) _hypot
|
||||||
|
|
Loading…
Reference in a new issue