8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 10:43:03 +01:00

Make sure the interactive gfix answer is correctly processed.

This commit is contained in:
robocop 2009-08-16 08:43:45 +00:00
parent e039672963
commit 1552a125ad

View File

@ -671,11 +671,12 @@ static SINT64 ask()
ALICE_print(85); ALICE_print(85);
// msg 85: Commit, rollback, or neither (c, r, or n)? // msg 85: Commit, rollback, or neither (c, r, or n)?
int c; int c;
char* p; const char* end = response + sizeof(response) - 1;
for (p = response; (c = getchar()) != '\n' && !feof(stdin) && !ferror(stdin);) char* p = response;
while ((c = getchar()) != '\n' && !feof(stdin) && !ferror(stdin) && p < end)
*p++ = c; *p++ = c;
if (p == response) if (p == response)
return ~0; return ~(SINT64(0));
*p = 0; *p = 0;
ALICE_down_case(response, response, sizeof(response)); ALICE_down_case(response, response, sizeof(response));
if (!strcmp(response, "n") || !strcmp(response, "c") || !strcmp(response, "r")) if (!strcmp(response, "n") || !strcmp(response, "c") || !strcmp(response, "r"))