tools: thanks to Ludovic; check for getline() in configure.ac and use 'HAVE_GETLINE' macro in get password procedure.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4266 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
06f5b0ba5b
commit
122d357fde
|
@ -17,6 +17,8 @@ OPENSC_VERSION_MAJOR="PACKAGE_VERSION_MAJOR"
|
|||
OPENSC_VERSION_MINOR="PACKAGE_VERSION_MINOR"
|
||||
OPENSC_VERSION_FIX="PACKAGE_VERSION_FIX"
|
||||
|
||||
AC_CHECK_FUNCS([getline])
|
||||
|
||||
# LT Version numbers, remember to change them just *before* a release.
|
||||
# (Code changed: REVISION++)
|
||||
# (Oldest interface removed: OLDEST++)
|
||||
|
|
|
@ -285,7 +285,7 @@ util_warn(const char *fmt, ...)
|
|||
|
||||
int util_getpass (char **lineptr, size_t *len, FILE *stream)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifndef HAVE_GETLINE
|
||||
#define MAX_PASS_SIZE 128
|
||||
char *buf;
|
||||
int i;
|
||||
|
@ -295,7 +295,8 @@ int util_getpass (char **lineptr, size_t *len, FILE *stream)
|
|||
return -1;
|
||||
|
||||
for (i = 0; i < MAX_PASS_SIZE - 1; i++) {
|
||||
buf[i] = _getch();
|
||||
/* buf[i] = _getch(); */
|
||||
buf[i] = getchar();
|
||||
if (buf[i] == 0 || buf[i] == 3)
|
||||
return -1;
|
||||
if (buf[i] == '\n' || buf[i] == '\r')
|
||||
|
|
Loading…
Reference in New Issue