]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg BaseLib: API PathRemoveLastItem not handle root paths properly
authorHao Wu <hao.a.wu@intel.com>
Thu, 17 Nov 2016 06:07:54 +0000 (14:07 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 21 Nov 2016 01:23:25 +0000 (09:23 +0800)
commit6a62309459e36d59e4cfe14885fa3ed807841c62
treeafe1c242b874577667ba9d38061fc22e8fa80c4f
parent632dcfd6857b6211ce3fe9755d3c11e74ef5d447
MdePkg BaseLib: API PathRemoveLastItem not handle root paths properly

https://bugzilla.tianocore.org/show_bug.cgi?id=239

When the input path for API PathRemoveLastItem() is a root path like
'fs0:\', the API will return TRUE (indicating a directory or file was
removed from the path) and modifies the path to 'fs0:'. In fact, there's
no directory or file removed in the above case.

This commit adds additional check to resolve this issue and modifies the
API's description to make it more straightforward.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
MdePkg/Include/Library/BaseLib.h
MdePkg/Library/BaseLib/FilePaths.c