From 1a5766fbd3edc4feaddb4b3554b88dae54d0c28a Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Thu, 17 Aug 2006 13:49:59 +0000 Subject: [PATCH] entryFromPath doesn't look for "" anymore - use "." to refer to the current directory --- source/directory.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/directory.c b/source/directory.c index d2d72da..7c94bf8 100644 --- a/source/directory.c +++ b/source/directory.c @@ -28,6 +28,9 @@ 2006-08-14 - Chishm * entryFromPath correctly finds "" and "." now + + 2006-08-17 - Chishm + * entryFromPath doesn't look for "" anymore - use "." to refer to the current directory */ #include @@ -431,16 +434,15 @@ bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const while (pathPosition[0] == DIR_SEPARATOR) { pathPosition++; } + // If the path is only specifying a directory in the form of "" or ".", return it + if ((pathPosition >= pathEnd) || (strncasecmp(".", pathPosition, 2) == 0)) { + _FAT_directory_getRootEntry (partition, entry); + found = true; + } } else { // Start in current working directory dirCluster = partition->cwdCluster; } - - // If the path is only specifying a directory in the form of "" or ".", return it - if ((pathPosition >= pathEnd) || (strncasecmp(".", pathPosition, 2) == 0)) { - _FAT_directory_getRootEntry (partition, entry); - found = true; - } while (!found && !notFound) { // Get the name of the next required subdirectory within the path