diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2019-08-16 17:03:01 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2019-08-16 17:03:01 +0000 |
| commit | e63852a7532181a14cec2928b31af2209e98414a (patch) | |
| tree | be94508475add18bbaa0cacd6c467983d2b8a443 /source/tools/acpidump/apfiles.c | |
| parent | 0ada71f05e76bf61eb2d5aba852db00705edd364 (diff) | |
Diffstat (limited to 'source/tools/acpidump/apfiles.c')
| -rw-r--r-- | source/tools/acpidump/apfiles.c | 11 |
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); } |
