From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.101.70, mailfrom: supreeth.venkatesh@arm.com) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by groups.io with SMTP; Thu, 04 Apr 2019 13:57:19 -0700 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7226EA78; Thu, 4 Apr 2019 13:57:19 -0700 (PDT) Received: from supven01-thinkstation-p720.austin.arm.com (supven01-thinkstation-p720.austin.arm.com [10.118.30.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4191B3F59C; Thu, 4 Apr 2019 13:57:19 -0700 (PDT) Message-ID: <63d729381dcc6b4d7721a740b080737bf20d3f42.camel@arm.com> Subject: Re: [edk2-test][Patch 1/1 V2] SctPkg/Tools:Fix incorrect break condition in GetLine From: supreeth.venkatesh@arm.com To: Eric Jin , devel@edk2.groups.io Date: Thu, 04 Apr 2019 20:57:18 +0000 In-Reply-To: <65d1b44edf0d9a648e2b96c805ae45c74e432974.camel@arm.com> References: <20190404021418.8280-1-eric.jin@intel.com> <65d1b44edf0d9a648e2b96c805ae45c74e432974.camel@arm.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Adding devel@edk2.groups.io. On Thu, 2019-04-04 at 20:42 +0000, Supreeth Venkatesh wrote: > On Thu, 2019-04-04 at 10:14 +0800, Eric Jin wrote: > > Change the continue to break to get the each useful line. > > Besides above, change EOL to CRLF > > > > CC: Supreeth Venkatesh > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Eric Jin > > Reviewed-by: Supreeth Venkatesh > > Pushed with the commit log modified as below: > Change the "continue" to "break" to get a useful line and skip > comments, empty lines. > Besides above, change EOL to CRLF. > > > Thanks, > Supreeth > > --- > > uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c | 52 > > ++++++++++++++++++++++++++-------------------------- > > 1 file changed, 26 insertions(+), 26 deletions(-) > > > > diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c b/uefi- > > sct/SctPkg/Tools/Source/GenBin/GenBin.c > > index f812e5117d14..47b400c2007c 100644 > > --- a/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c > > +++ b/uefi-sct/SctPkg/Tools/Source/GenBin/GenBin.c > > @@ -1,8 +1,8 @@ > > /** @file > > > > Copyright 2006 - 2010 Unified EFI, Inc.
> > - Copyright (c) 2010 Intel Corporation. All rights reserved.
> > - Copyright (c) 2018 ARM Ltd. All rights reserved.
> > + Copyright (c) 2010 - 2019 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 BSD License > > @@ -33,7 +33,7 @@ Abstract: > > #include > > #include > > #include > > -#include > > +#include > > > > // > > // Definitions > > @@ -51,7 +51,7 @@ PrintUsage ( > > void > > ); > > > > -char * > > +char * > > Trim ( > > char *String > > ); > > @@ -161,42 +161,42 @@ PrintUsage ( > > } > > > > > > -char * > > +char * > > Trim ( > > char *String > > ) > > { > > int Length; > > - char *end; > > + char *end; > > > > Length = strlen (String); > > > > - if (!Length) { > > - return String; > > + if (!Length) { > > + return String; > > } > > > > - end = String + Length - 1; > > + end = String + Length - 1; > > > > // > > // Remove the space characters from the end of this string > > // > > - while (end >= String && isspace (*end)) { > > - end--; > > + while (end >= String && isspace (*end)) { > > + end--; > > } > > > > - *(end + 1) = '\0'; > > - > > - // > > - // Remove the space characters from the beginning of this string > > - // > > - while (*String && isspace (*String)) { > > - String++; > > - } > > + *(end + 1) = '\0'; > > + > > + // > > + // Remove the space characters from the beginning of this string > > + // > > + while (*String && isspace (*String)) { > > + String++; > > + } > > > > // > > // Done > > // > > - return String; > > + return String; > > } > > > > > > @@ -226,15 +226,15 @@ GetLine ( > > // > > // Remove the beginning and ending space characters > > // > > - String = Trim (Result); > > + String = Trim (Result); > > > > // > > - // Skip the empty line and comment line > > + // Ignore the empty line and comment line > > // > > - if ((String[0] == '\0') || > > - (String[0] == '#' )) { > > - continue; > > - } > > + if ((String[0] != '\0') && > > + (String[0] != '#' )) { > > + break; > > + } > > } > > > > //