public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: <Jim.Dailey@dell.com>
To: <liming.gao@intel.com>, <michael.d.kinney@intel.com>
Cc: <edk2-devel@lists.01.org>
Subject: Re: [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix
Date: Mon, 3 Dec 2018 22:06:06 +0000	[thread overview]
Message-ID: <0d1c0527e4b24d34b4d99a8fa3c18689@ausx13mps335.AMER.DELL.COM> (raw)
In-Reply-To: <7a2851948cc24393879f9aa7318bffc6@ausx13mps335.AMER.DELL.COM>

Liming and Mike,

I don't feel there is any logical issue with this proposed fix.

However, there is some shell code that fails when the fix is in place.
I think that shell code probably should be changed; I'll see if I can
make an acceptable change there first.

Please disregard this patch; I'll likely resubmit some version of it
later on.

Regards,
Jim

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dailey, Jim
Sent: Friday, November 30, 2018 9:43 AM
To: liming.gao@intel.com; michael.d.kinney@intel.com
Cc: edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix


[EXTERNAL EMAIL] 

Oops!  I think this change may have an issue.

Hold off and I'll let you know if that's the case.

--Jim

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dailey, Jim
Sent: Friday, November 30, 2018 9:12 AM
To: liming.gao@intel.com; michael.d.kinney@intel.com
Cc: edk2-devel@lists.01.org
Subject: [edk2] [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix


PathCleanUpDirectories does not handle "<dir>\..\<file>" properly; it
returns "<dir>\<file>" instead of "<file>".  This change fixes that
problem so that "<file>" is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
---
 MdePkg/Library/BaseLib/FilePaths.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseLib/FilePaths.c b/MdePkg/Library/BaseLib/FilePaths.c
index 92e4c350ff..69e46dd135 100644
--- a/MdePkg/Library/BaseLib/FilePaths.c
+++ b/MdePkg/Library/BaseLib/FilePaths.c
@@ -110,7 +110,12 @@ PathCleanUpDirectories(
          ((*(TempString + 3) == L'\\') || (*(TempString + 3) == CHAR_NULL))
         ) {
     *(TempString + 1) = CHAR_NULL;
-    PathRemoveLastItem(Path);
+    if (!PathRemoveLastItem(Path)) {
+      //
+      // We had "<somedir>\.."
+      //
+      *Path = CHAR_NULL;
+    }
     if (*(TempString + 3) != CHAR_NULL) {
       CopyMem (Path + StrLen (Path), TempString + 4, StrSize (TempString + 4));
     }
-- 
2.17.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2018-12-03 22:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 15:11 [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix Jim.Dailey
2018-11-30 15:43 ` Jim.Dailey
2018-12-03 22:06   ` Jim.Dailey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d1c0527e4b24d34b4d99a8fa3c18689@ausx13mps335.AMER.DELL.COM \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox