summaryrefslogtreecommitdiff
path: root/source/tools/acpidump/apfiles.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools/acpidump/apfiles.c')
-rw-r--r--source/tools/acpidump/apfiles.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/tools/acpidump/apfiles.c b/source/tools/acpidump/apfiles.c
index 784a9315ead3..e61bb4ecbe3b 100644
--- a/source/tools/acpidump/apfiles.c
+++ b/source/tools/acpidump/apfiles.c
@@ -177,20 +177,27 @@ ApIsExistingFile (
{
#if !defined(_GNU_EFI) && !defined(_EDK2_EFI)
struct stat StatInfo;
+ int InChar;
if (!stat (Pathname, &StatInfo))
{
fprintf (stderr, "Target path already exists, overwrite? [y|n] ");
- if (getchar () != 'y')
+ InChar = fgetc (stdin);
+ if (InChar == '\n')
+ {
+ InChar = fgetc (stdin);
+ }
+
+ if (InChar != 'y' && InChar != 'Y')
{
return (-1);
}
}
#endif
- return 0;
+ return (0);
}