Author: aandrejevic Date: Sun Aug 11 21:07:09 2013 New Revision: 59701
URL: http://svn.reactos.org/svn/reactos?rev=59701&view=rev Log: [NTVDM] Fix bug in DosChangeDirectory.
Modified: branches/ntvdm/subsystems/ntvdm/dos.c
Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?rev... ============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Sun Aug 11 21:07:09 2013 @@ -892,10 +892,16 @@ }
/* Get the directory part of the path */ - Path = strchr(Directory, '\') + 1; + Path = strchr(Directory, '\'); + if (Path != NULL) + { + /* Skip the backslash */ + Path++; + }
/* Set the directory for the drive */ - strcpy(CurrentDirectories[DriveNumber], Path); + if (Path != NULL) strcpy(CurrentDirectories[DriveNumber], Path); + else strcpy(CurrentDirectories[DriveNumber], "");
/* Return success */ return TRUE;