- Add a trailing '\' if the path is only a drive (RtlpEatPath).

svn path=/trunk/; revision=4411
This commit is contained in:
Hartmut Birr 2003-03-23 10:49:19 +00:00
parent 52b9204b29
commit 457a70030c

View file

@ -1,4 +1,4 @@
/* $Id: path.c,v 1.16 2003/02/15 20:25:03 phreak Exp $ /* $Id: path.c,v 1.17 2003/03/23 10:49:19 hbirr Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -104,6 +104,11 @@ static VOID RtlpEatPath (PWSTR Path)
} }
} }
} }
if (Path[2] == 0)
{
Path[2] = L'\\';
Path[3] = 0;
}
} }
@ -252,9 +257,9 @@ RtlGetCurrentDirectory_U(ULONG MaximumLength,
DPRINT ("RtlGetCurrentDirectory %lu %p\n", MaximumLength, Buffer); DPRINT ("RtlGetCurrentDirectory %lu %p\n", MaximumLength, Buffer);
cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectoryName);
RtlAcquirePebLock(); RtlAcquirePebLock();
cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectoryName);
Length = cd->DosPath.Length / sizeof(WCHAR); Length = cd->DosPath.Length / sizeof(WCHAR);
if (cd->DosPath.Buffer[Length - 1] == L'\\' && if (cd->DosPath.Buffer[Length - 1] == L'\\' &&
cd->DosPath.Buffer[Length - 2] != L':') cd->DosPath.Buffer[Length - 2] != L':')