From cb5c08b6980bddc9dbe4c825da3914e4ae38a113 Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Thu, 30 Apr 2020 12:40:22 +0100 Subject: Fix fiptool packaging issue on windows Windows does not have a standard getopt implementation. To address this an equivalent implementation has been provided in win_posix.c However, the implementation has an issue with option processing as described below. Long option names may be abbreviated if the abbreviation is unique or an exact match for some defined option. Since some options can be substring of other options e.g. "scp-fw" option is a substring of "scp-fwu-cfg", we need to identify if an option is abbreviated and also check for uniqueness. Otherwise if a user passes --scp-fw as an option, the "scp-fwu-cfg" option may get selected, resulting in an incorrectly packaged FIP. This issue has been be fixed by: - First searching for an exact match. - If exact match was not found search for a abbreviated match. By doing this an incorrect option selection can be avoided. Change-Id: I22f4e7a683f3df857f5b6f0783bf9b03a64a0bcc Signed-off-by: Sami Mujawar --- tools/fiptool/win_posix.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tools/fiptool/win_posix.h') diff --git a/tools/fiptool/win_posix.h b/tools/fiptool/win_posix.h index 836ffed31..6f0d8e6b6 100644 --- a/tools/fiptool/win_posix.h +++ b/tools/fiptool/win_posix.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2020, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -9,13 +9,15 @@ #define _CRT_SECURE_NO_WARNINGS -#include -#include +#include #include #include #include #include +#include +#include + #include "uuid.h" /* Derive or provide Windows equivalents of Posix/GCC/Unix stuff. */ -- cgit v1.2.3