FreeLoader version 1.0!
[reactos.git] / freeldr / freeldr / fs / fat.c
index c11be24..88fc00b 100644 (file)
@@ -576,9 +576,9 @@ BOOL FatLookupFile(PUCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
        memset(FatFileInfoPointer, 0, sizeof(FAT_FILE_INFO));
 
        //
-       // Check and see if the first character is '\' and remove it if so
+       // Check and see if the first character is '\' or '/' and remove it if so
        //
-       while (*FileName == '\\')
+       while ((*FileName == '\\') || (*FileName == '/'))
        {
                FileName++;
        }
@@ -601,7 +601,7 @@ BOOL FatLookupFile(PUCHAR FileName, PFAT_FILE_INFO FatFileInfoPointer)
                //
                // Advance to the next part of the path
                //
-               for (; (*FileName != '\\') && (*FileName != '\0'); FileName++)
+               for (; (*FileName != '\\') && (*FileName != '/') && (*FileName != '\0'); FileName++)
                {
                }
                FileName++;
@@ -654,7 +654,7 @@ ULONG FatGetNumPathParts(PUCHAR Path)
 
        for (i=0,num=0; i<(int)strlen(Path); i++)
        {
-               if (Path[i] == '\\')
+               if ((Path[i] == '\\') || (Path[i] == '/'))
                {
                        num++;
                }
@@ -681,7 +681,7 @@ VOID FatGetFirstNameFromPath(PUCHAR Buffer, PUCHAR Path)
        // and put them in Buffer
        for (i=0; i<(int)strlen(Path); i++)
        {
-               if (Path[i] == '\\')
+               if ((Path[i] == '\\') || (Path[i] == '/'))
                {
                        break;
                }
@@ -1217,8 +1217,8 @@ BOOL FatReadFile(FILE *FileHandle, ULONG BytesToRead, PULONG BytesRead, PVOID Bu
                {
                        *BytesRead += BytesToRead;
                }
-               BytesToRead -= BytesToRead;
                FatFileInfo->FilePointer += BytesToRead;
+               BytesToRead -= BytesToRead;
                Buffer += BytesToRead;
        }