- // Skip past leading slashes, which are sometimes (but not always) included
- // in SelfDirPath, to get a path that's known to never include this feature.
- while ((SelfDirPath != NULL) && (SelfDirPath[i] == L'\\')) {
- i++;
- }
- SelfPath = &SelfDirPath[i]; // NOTE: *DO NOT* call FreePool() on SelfPath!!!
-
- if (!SelfPath || !Path || ((StriCmp(Path, SelfPath) == 0) && Volume != SelfVolume) ||
- (StriCmp(Path, SelfPath) != 0)) {
+ FileName = AllocateZeroPool(256 * sizeof(CHAR16));
+ if ((!SelfDirPath || !Path || ((StriCmp(Path, SelfDirPath) == 0) && Volume != SelfVolume) ||
+ (StriCmp(Path, SelfDirPath) != 0)) && FileName) {