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 <yonghong.zhu@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18675
6f19259b-4bc3-4df7-8a09-
765794883524
\r
Split a file into two pieces at the request offset.\r
\r
\r
Split a file into two pieces at the request offset.\r
\r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
distribution. The full text of the license may be found at\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
distribution. The full text of the license may be found at\r
--*/\r
{\r
printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
--*/\r
{\r
printf ("%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
- printf ("Copyright (c) 1999-2014 Intel Corporation. All rights reserved.\n");\r
+ printf ("Copyright (c) 1999-2015 Intel Corporation. All rights reserved.\n");\r
printf ("\n SplitFile creates two Binary files either in the same directory as the current working\n");\r
printf (" directory or in the specified directory.\n");\r
}\r
printf ("\n SplitFile creates two Binary files either in the same directory as the current working\n");\r
printf (" directory or in the specified directory.\n");\r
}\r
{\r
CHAR8* temp = *FullFileName;\r
CHAR8* start = temp;\r
{\r
CHAR8* temp = *FullFileName;\r
CHAR8* start = temp;\r
UINT64 index = 0;\r
\r
for (;index < strlen(temp); ++index) {\r
if (temp[index] == '\\' || temp[index] == '/') {\r
UINT64 index = 0;\r
\r
for (;index < strlen(temp); ++index) {\r
if (temp[index] == '\\' || temp[index] == '/') {\r
- temp[index] = 0;\r
- if (chdir(start)) {\r
- if (mkdir(start, S_IRWXU | S_IRWXG | S_IRWXO) != 0) {\r
- return EFI_ABORTED;\r
+ if (temp[index + 1] != '\0') {\r
+ tempchar = temp[index + 1];\r
+ temp[index + 1] = 0;\r
+ if (chdir(start)) {\r
+ if (mkdir(start, S_IRWXU | S_IRWXG | S_IRWXO) != 0) {\r
+ return EFI_ABORTED;\r
+ }\r
+ chdir(start);\r
+ start = temp + index + 1;\r
+ temp[index] = '/';\r
+ temp[index + 1] = tempchar;\r
+ }\r
- start = temp + index + 1;\r
- temp[index] = '/';\r
- }\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
return EFI_SUCCESS;\r