Discussion:
[edk2] [Patch] BaseTools: Convert ".\\" to "" in FilePath
Liming Gao
2015-06-19 01:29:31 UTC
Permalink
Convert ".\\" to "", because it doesn't work with WINDOWS_EXTENSION_PATH.
WINDOWS_EXTENSION_PATH can support the file path larger than 260 length.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <***@intel.com>
---
BaseTools/Source/C/Common/CommonLib.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/Common/CommonLib.c b/BaseTools/Source/C/Common/CommonLib.c
index aa89115..2d07dfc 100644
--- a/BaseTools/Source/C/Common/CommonLib.c
+++ b/BaseTools/Source/C/Common/CommonLib.c
@@ -669,19 +669,27 @@ Returns:
//
if ((PathPointer = strstr (mCommonLibFullPath, ":\\\\")) != NULL) {
*(PathPointer + 2) = '\0';
strcat (mCommonLibFullPath, PathPointer + 3);
}
+
+ //
+ // Convert ".\\" to "", because it doesn't work with WINDOWS_EXTENSION_PATH.
+ //
+ while ((PathPointer = strstr (mCommonLibFullPath, ".\\")) != NULL) {
+ *PathPointer = '\0';
+ strcat (mCommonLibFullPath, PathPointer + 2);
+ }

//
// Convert "\\.\\" to "\\", because it doesn't work with WINDOWS_EXTENSION_PATH.
//
while ((PathPointer = strstr (mCommonLibFullPath, "\\.\\")) != NULL) {
*PathPointer = '\0';
strcat (mCommonLibFullPath, PathPointer + 2);
}
-
+
//
// Convert "\\..\\" to last directory, because it doesn't work with WINDOWS_EXTENSION_PATH.
//
while ((PathPointer = strstr (mCommonLibFullPath, "\\..\\")) != NULL) {
NextPointer = PathPointer + 3;
--
1.9.5.msysgit.0


------------------------------------------------------------------------------
Liu, Yingke D
2015-06-19 05:32:33 UTC
Permalink
Reviewed-by: Yingke Liu <***@intel.com>

Dennis

-----Original Message-----
From: Liming Gao [mailto:***@intel.com]
Sent: Friday, June 19, 2015 9:30
To: edk2-***@lists.sourceforge.net
Subject: [edk2] [Patch] BaseTools: Convert ".\\" to "" in FilePath

Convert ".\\" to "", because it doesn't work with WINDOWS_EXTENSION_PATH.
WINDOWS_EXTENSION_PATH can support the file path larger than 260 length.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <***@intel.com>
---
BaseTools/Source/C/Common/CommonLib.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/Common/CommonLib.c b/BaseTools/Source/C/Common/CommonLib.c
index aa89115..2d07dfc 100644
--- a/BaseTools/Source/C/Common/CommonLib.c
+++ b/BaseTools/Source/C/Common/CommonLib.c
@@ -669,19 +669,27 @@ Returns:
//
if ((PathPointer = strstr (mCommonLibFullPath, ":\\\\")) != NULL) {
*(PathPointer + 2) = '\0';
strcat (mCommonLibFullPath, PathPointer + 3);
}
+
+ //
+ // Convert ".\\" to "", because it doesn't work with WINDOWS_EXTENSION_PATH.
+ //
+ while ((PathPointer = strstr (mCommonLibFullPath, ".\\")) != NULL) {
+ *PathPointer = '\0';
+ strcat (mCommonLibFullPath, PathPointer + 2);
+ }

//
// Convert "\\.\\" to "\\", because it doesn't work with WINDOWS_EXTENSION_PATH.
//
while ((PathPointer = strstr (mCommonLibFullPath, "\\.\\")) != NULL) {
*PathPointer = '\0';
strcat (mCommonLibFullPath, PathPointer + 2);
}
-
+
//
// Convert "\\..\\" to last directory, because it doesn't work with WINDOWS_EXTENSION_PATH.
//
while ((PathPointer = strstr (mCommonLibFullPath, "\\..\\")) != NULL) {
NextPointer = PathPointer + 3;
--
1.9.5.msysgit.0
Carsey, Jaben
2015-06-19 14:43:22 UTC
Permalink
Dennis,

I notice that after this ".\\", the code looks for "\\.\\" and "\\..\\". I think that the order may be wrong wince if you remove all the ".\\", then none of the "\\.\\" and "\\..\\" will ever get found... either that or we are doing extra checks that are unnecessary...

-Jaben
Post by Liu, Yingke D
-----Original Message-----
Sent: Thursday, June 18, 2015 10:33 PM
Subject: Re: [edk2] [Patch] BaseTools: Convert ".\\" to "" in FilePath
Dennis
-----Original Message-----
Sent: Friday, June 19, 2015 9:30
Subject: [edk2] [Patch] BaseTools: Convert ".\\" to "" in FilePath
Convert ".\\" to "", because it doesn't work with
WINDOWS_EXTENSION_PATH.
WINDOWS_EXTENSION_PATH can support the file path larger than 260 length.
Contributed-under: TianoCore Contribution Agreement 1.0
---
BaseTools/Source/C/Common/CommonLib.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/BaseTools/Source/C/Common/CommonLib.c
b/BaseTools/Source/C/Common/CommonLib.c
index aa89115..2d07dfc 100644
--- a/BaseTools/Source/C/Common/CommonLib.c
+++ b/BaseTools/Source/C/Common/CommonLib.c
//
if ((PathPointer = strstr (mCommonLibFullPath, ":\\\\")) != NULL) {
*(PathPointer + 2) = '\0';
strcat (mCommonLibFullPath, PathPointer + 3);
}
+
+ //
+ // Convert ".\\" to "", because it doesn't work with
WINDOWS_EXTENSION_PATH.
+ //
+ while ((PathPointer = strstr (mCommonLibFullPath, ".\\")) != NULL) {
+ *PathPointer = '\0';
+ strcat (mCommonLibFullPath, PathPointer + 2);
+ }
//
// Convert "\\.\\" to "\\", because it doesn't work with
WINDOWS_EXTENSION_PATH.
//
while ((PathPointer = strstr (mCommonLibFullPath, "\\.\\")) != NULL) {
*PathPointer = '\0';
strcat (mCommonLibFullPath, PathPointer + 2);
}
-
+
//
// Convert "\\..\\" to last directory, because it doesn't work with
WINDOWS_EXTENSION_PATH.
//
while ((PathPointer = strstr (mCommonLibFullPath, "\\..\\")) != NULL) {
NextPointer = PathPointer + 3;
--
1.9.5.msysgit.0
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Loading...