From 0d1dbf4df56a5d2689366be6e0883a1b6ffc42e4 Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Thu, 10 Aug 2006 08:40:48 +0000 Subject: [PATCH] Fixed problem when openning files starting with "fat" --- source/partition.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/partition.c b/source/partition.c index 11283b8..ae750d9 100644 --- a/source/partition.c +++ b/source/partition.c @@ -28,6 +28,9 @@ 2006-07-11 - Chishm * Original release + + 2006-08-10 - Chishm + * Fixed problem when openning files starting with "fat" */ @@ -424,7 +427,10 @@ PARTITION* _FAT_partition_getPartitionFromPath (const char* path) { // Device name extraction code taken from DevKitPro namelen = strlen(DEVICE_NAME); - if( strncmp(DEVICE_NAME, path, namelen) == 0 ) { + if (strchr (path, ':') == NULL) { + // No device specified + partitionNumber = PI_DEFAULT; + } else if( strncmp(DEVICE_NAME, path, namelen) == 0 ) { if ( path[namelen] == ':' ) { // Only the device name is specified partitionNumber = PI_DEFAULT; @@ -435,9 +441,6 @@ PARTITION* _FAT_partition_getPartitionFromPath (const char* path) { // Incorrect device name return NULL; } - } else if (strchr (path, ':') == NULL) { - // No device specified - partitionNumber = PI_DEFAULT; } else { // Incorrect device name return NULL;