diff options
author | Rafael J. Wysocki | 2019-09-17 09:51:25 +0200 |
---|---|---|
committer | Rafael J. Wysocki | 2019-09-17 09:51:25 +0200 |
commit | 522778cda11f7f6fccfe6dbd5010364e282df1c2 (patch) | |
tree | e1943e99111d591d1a15f81987f541dc8a89c191 /tools | |
parent | 4c4cdc4c63853fee48c02e25c8605fb65a6c9924 (diff) | |
parent | 71bb4d9a4085ec6e2a90ca62c6afcafb945b55aa (diff) |
Merge branch 'acpica'
* acpica:
ACPICA: Update version to 20190816.
ACPICA: Add "Windows 2019" string to _OSI support.
ACPICA: Differentiate Windows 8.1 from Windows 8.
ACPICA: Fully deploy ACPI_PRINTF_LIKE macro
ACPICA: iASL,acpi_dump: Improve y/n query
ACPICA: Fix issues with arg types within printf format strings
ACPICA: Macros: remove pointer math on a null pointer
ACPICA: Increase total number of possible Owner IDs
ACPICA: Debugger: remove redundant assignment on obj_desc
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/acpi/tools/acpidump/apfiles.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c index a42cfcaa3293..16d919bd133b 100644 --- a/tools/power/acpi/tools/acpidump/apfiles.c +++ b/tools/power/acpi/tools/acpidump/apfiles.c @@ -29,18 +29,24 @@ static int ap_is_existing_file(char *pathname) { #if !defined(_GNU_EFI) && !defined(_EDK2_EFI) struct stat stat_info; + int in_char; if (!stat(pathname, &stat_info)) { fprintf(stderr, "Target path already exists, overwrite? [y|n] "); - if (getchar() != 'y') { + in_char = fgetc(stdin); + if (in_char == '\n') { + in_char = fgetc(stdin); + } + + if (in_char != 'y' && in_char != 'Y') { return (-1); } } #endif - return 0; + return (0); } /****************************************************************************** |