mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-22 18:09:17 +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
|
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,
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
2006-08-14 - Chishm
|
||||||
|
* entryFromPath correctly finds "" and "." now
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -428,15 +431,17 @@ bool _FAT_directory_entryFromPath (PARTITION* partition, DIR_ENTRY* entry, const
|
|||||||
while (pathPosition[0] == DIR_SEPARATOR) {
|
while (pathPosition[0] == DIR_SEPARATOR) {
|
||||||
pathPosition++;
|
pathPosition++;
|
||||||
}
|
}
|
||||||
if (pathPosition >= pathEnd) {
|
|
||||||
_FAT_directory_getRootEntry (partition, entry);
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Start in current working directory
|
// Start in current working directory
|
||||||
dirCluster = partition->cwdCluster;
|
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) {
|
while (!found && !notFound) {
|
||||||
// Get the name of the next required subdirectory within the path
|
// Get the name of the next required subdirectory within the path
|
||||||
nextPathPosition = strchr (pathPosition, DIR_SEPARATOR);
|
nextPathPosition = strchr (pathPosition, DIR_SEPARATOR);
|
||||||
|
Loading…
Reference in New Issue
Block a user