mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-01 08:15:05 +01:00
entryFromPath correctly finds "" and "." now
This commit is contained in:
parent
11eb212459
commit
247b640036
@ -25,6 +25,9 @@
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
2006-08-14 - Chishm
|
||||
* entryFromPath correctly finds "" and "." now
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -428,14 +431,16 @@ bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const
|
||||
while (pathPosition[0] == DIR_SEPARATOR) {
|
||||
pathPosition++;
|
||||
}
|
||||
if (pathPosition >= pathEnd) {
|
||||
_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
|
||||
|
Loading…
Reference in New Issue
Block a user