It's good to me.

Reviewed-by: Hao Wu <[email protected]>

Best Regards,
Hao Wu

> -----Original Message-----
> From: Zhu, Yonghong
> Sent: Monday, October 26, 2015 11:59 AM
> To: [email protected]
> Cc: Gao, Liming; Wu, Hao A
> Subject: [Patch] BaseTools:remove the redundant directories for '-f' with
> absolute path.
> 
> when the absolute path is given to '-f', it would create some redundant
> empty directories.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu <[email protected]>
> ---
>  Source/C/Split/Split.c | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/Source/C/Split/Split.c b/Source/C/Split/Split.c index
> b63aef7..44a0968 100644
> --- a/Source/C/Split/Split.c
> +++ b/Source/C/Split/Split.c
> @@ -1,10 +1,10 @@
>  /** @file
> 
>    Split a file into two pieces at the request offset.
> 
> -Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>
>  This program and the accompanying materials are licensed and made
> available  under the terms and conditions of the BSD License which
> accompanies this  distribution.  The full text of the license may be found at
> http://opensource.org/licenses/bsd-license.php
> 
> @@ -56,11 +56,11 @@ Returns:
>    None
> 
>  --*/
>  {
>    printf ("%s Version %d.%d %s\n", UTILITY_NAME,
> UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
> -  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights 
> reserved.\n");
> +  printf ("Copyright (c) 1999-2015 Intel Corporation. All rights
> + reserved.\n");
>    printf ("\n  SplitFile creates two Binary files either in the same 
> directory as
> the current working\n");
>    printf ("  directory or in the specified directory.\n");  }
> 
>  void
> @@ -174,24 +174,29 @@ CreateDir (
>    IN OUT CHAR8** FullFileName
>  )
>  {
>    CHAR8* temp = *FullFileName;
>    CHAR8* start = temp;
> +  CHAR8  tempchar;
>    UINT64 index = 0;
> 
>    for (;index < strlen(temp); ++index) {
>      if (temp[index] == '\\' || temp[index] == '/') {
> -      temp[index] = 0;
> -      if (chdir(start)) {
> -        if (mkdir(start, S_IRWXU | S_IRWXG | S_IRWXO) != 0) {
> -          return EFI_ABORTED;
> +      if (temp[index + 1] != '\0') {
> +        tempchar = temp[index + 1];
> +        temp[index + 1] = 0;
> +        if (chdir(start)) {
> +          if (mkdir(start, S_IRWXU | S_IRWXG | S_IRWXO) != 0) {
> +            return EFI_ABORTED;
> +          }
> +          chdir(start);
>          }
> -        chdir(start);
> +        start = temp + index + 1;
> +        temp[index] = '/';
> +        temp[index + 1] = tempchar;
> +      }
>      }
> -      start = temp + index + 1;
> -      temp[index] = '/';
> -  }
>    }
> 
>    return EFI_SUCCESS;
>  }
> 
> --
> 2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to