From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.15.71; helo=eur01-db5-obe.outbound.protection.outlook.com; envelope-from=supreeth.venkatesh@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150071.outbound.protection.outlook.com [40.107.15.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5D69B2194EB76 for ; Fri, 29 Mar 2019 07:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uItvCCCmKJyqWqmUWcfkkmSoO1M8vn7a5gtHhn/QiJU=; b=m1OydapwjaHitB9J5EHwH8V+1rnxAGadmeHNEOpo1a1Zadm30+RCB3vTDKHSngMyd8iS+GHFDWhcWrwHrvvlqeUxocKeCibOFAvDPm8kUCLOPfiN4/s+7PdD3zTJogbJJVOUdVLOKX5gGi6O/9PKOyNBx4TK7K2pzvyOoYvJzN8= Received: from AM4PR08MB2788.eurprd08.prod.outlook.com (10.170.126.27) by AM4PR08MB2787.eurprd08.prod.outlook.com (10.171.191.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Fri, 29 Mar 2019 14:11:40 +0000 Received: from AM4PR08MB2788.eurprd08.prod.outlook.com ([fe80::cc1a:f5ec:27c6:4136]) by AM4PR08MB2788.eurprd08.prod.outlook.com ([fe80::cc1a:f5ec:27c6:4136%3]) with mapi id 15.20.1730.019; Fri, 29 Mar 2019 14:11:40 +0000 From: Supreeth Venkatesh To: "Jin, Eric" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [edk2-test][PATCH v2] SctPkg/Tools: Fix incorrect line ending detection by GenBin tool Thread-Index: AQHU5gnerr4OwnPwhEimznLGg/5zKKYiplSA Date: Fri, 29 Mar 2019 14:11:40 +0000 Message-ID: References: <1543397402-19411-1-git-send-email-lokesh.bv@arm.com> <1543397402-19411-5-git-send-email-lokesh.bv@arm.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Supreeth.Venkatesh@arm.com; x-originating-ip: [2600:1700:8c61:400:9dee:35fc:d60a:3373] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 08f1ab36-a15c-489e-6425-08d6b45076bb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR08MB2787; x-ms-traffictypediagnostic: AM4PR08MB2787: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 0991CAB7B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(136003)(376002)(396003)(40434004)(13464003)(189003)(199004)(14444005)(106356001)(11346002)(6306002)(5024004)(86362001)(8676002)(9686003)(256004)(81156014)(6436002)(81166006)(71200400001)(71190400001)(2906002)(6116002)(52536014)(7696005)(229853002)(99286004)(68736007)(53936002)(55016002)(5660300002)(76176011)(97736004)(2501003)(478600001)(53546011)(25786009)(186003)(14454004)(6246003)(46003)(6506007)(486006)(7736002)(305945005)(72206003)(33656002)(966005)(110136005)(316002)(105586002)(476003)(74316002)(8936002)(446003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB2787; H:AM4PR08MB2788.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: VoSuRTBo6qIASYNv80cYk/EyQ6ddDaa8DgKGO4YIWCJvqoVGEuuwIRgOvmSMnGaxUvh4Rg+eBCB5j17IBWSq9wzx78DB8OItMPHKhfEmm01mI24vSpjqRlKqPSEVEEviXmUrlTWFqocOMj3MzRfs/P7SBIXKS8HHmh4PHtCiQBgnVQkK/ckJinPIlVjERN5YfncETavGNx4zijSNJRyLjWxi91rBDiYnkKbo7+/ZkAyBTySZAS1pyYvKe49VgqacWChOHFYAuX2gezOp0J90RmQJMlG8lSrBUfHEy8B7fTgq6yHZcViEeYwkkIaiRB/c2hj2MXfti8hmLCueHD4t/LpSiZKK3WGGg/gJ3AP/ftG9g0ZmUbeYfJYrpUD/+r9yZibFeBqg8nahIEMxKI6pBikOgxP07WcxCLSGu245zN8= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08f1ab36-a15c-489e-6425-08d6b45076bb X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2019 14:11:40.1049 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2787 Subject: Re: [edk2-test][PATCH v2] SctPkg/Tools: Fix incorrect line ending detection by GenBin tool X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 X-List-Received-Date: Fri, 29 Mar 2019 14:11:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sorry. This was sent in error. I was testing my new Desktop with git send-e= mail. Please ignore. Supreeth -----Original Message----- From: Jin, Eric Sent: Friday, March 29, 2019 3:32 AM To: Supreeth Venkatesh ; edk2-devel@lists.01.or= g Cc: Jin, Eric Subject: RE: [edk2] [edk2-test][PATCH v2] SctPkg/Tools: Fix incorrect line = ending detection by GenBin tool Hi Supreeth, This patch can't be applied to the lasted code base SHA-1: 33022e. One patch from may already fix the issue. Please check again. Best Regards Eric -----Original Message----- From: edk2-devel On Behalf Of Supreeth Ve= nkatesh Sent: Friday, March 29, 2019 7:08 AM To: supreeth.venkatesh@arm.com; edk2-devel@lists.01.org Subject: [edk2] [edk2-test][PATCH v2] SctPkg/Tools: Fix incorrect line endi= ng detection by GenBin tool From: Lokesh B V Some windows editors uses "\r\n" for line feed. While processing uefi sct t= estcase info file, the GenBin tool logic to skip line feed doesn't consider= the presence of carraige return(\r) in line feed. So this results in incor= rect format error. Fixed this issue by changing logic of Trim and Getline functions used in Ge= nBin source code. Cc: Supreeth Venkatesh Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Lokesh B V --- Changes since v1: * Adopted changes suggested by Supreeth. * modified Copyright content uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c | 58 +++++++++++++-----------= ---- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c b/uefi-sct/SctPkg= /Tools/Source/GenBin/GenBin.c index 61bb35b..6d8e844 100644 --- a/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c +++ b/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c @@ -2,6 +2,7 @@ Copyright 2006 - 2010 Unified EFI, Inc.
Copyright (c) 2010 Intel Corporation. All rights reserved.
+ Copyright (c) 2018 ARM Ltd. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -32,6 +33,7 @@ Abstract: #include #include #include +#include // // Definitions @@ -49,7 +51,7 @@ PrintUsage ( void ); -void +char * Trim ( char *String ); @@ -159,50 +161,42 @@ PrintUsage ( } -void +char * Trim ( char *String ) { - int Index1; - int Index2; int Length; + char *end; Length =3D strlen (String); - // - // Remove the space characters from the beginning of this string - // - for (Index1 =3D 0; Index1 < Length; Index1++) { - if ((String[Index1] !=3D ' ' ) && - (String[Index1] !=3D '\t') && - (String[Index1] !=3D '\n')) { - break; - } - } - - for (Index2 =3D Index1; Index2 < Length; Index2++) { - String[Index2 - Index1] =3D String[Index2]; + if (!Length) { + return String; } - Length =3D Length - Index1; + end =3D String + Length - 1; // // Remove the space characters from the end of this string // - for (Index1 =3D 0; Index1 < Length; Index1++) { - if ((String[Length - 1 - Index1] !=3D ' ' ) && - (String[Length - 1 - Index1] !=3D '\t') && - (String[Length - 1 - Index1] !=3D '\n')) { - break; - } + while (end >=3D String && isspace (*end)) { + end--; } - String[Length - Index1] =3D '\0'; + *(end + 1) =3D '\0'; + + // + // Remove the space characters from the beginning of this string // + while (*String && isspace (*String)) { + String++; + } // // Done // + return String; } @@ -227,20 +221,20 @@ GetLine ( return -1; } - (*LineNo)++; - // // Remove the beginning and ending space characters // - Trim (String); + String =3D Trim (Result); // - // Ignore the empty line and comment line + // Skip the empty line and comment line // - if ((String[0] !=3D '\0') && - (String[0] !=3D '#' )) { - break; + if ((String[0] =3D=3D '\0') || + (String[0] =3D=3D '#' )) { + continue; } + + (*LineNo)++; } // -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.