]> git.sven.stormbind.net Git - sven/exfat-utils.git/blobdiff - libexfat/node.c
New upstream version 1.2.8
[sven/exfat-utils.git] / libexfat / node.c
index b544bd966d1cd7ff8f3733b89909e3cc588b0e68..1ccb1c9eda0d41ddb70f64496563cd9f5e3a1472 100644 (file)
@@ -3,7 +3,7 @@
        exFAT file system implementation library.
 
        Free exFAT implementation.
-       Copyright (C) 2010-2017  Andrew Nayenko
+       Copyright (C) 2010-2018  Andrew Nayenko
 
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
@@ -855,7 +855,8 @@ static int find_slot(struct exfat* ef, struct exfat_node* dir,
                                        free(dmap);
                                        return -EIO;
                                case -EINVAL:
-                                       /* slot is occupied, continue searching */
+                                       /* slot at (i-n) is occupied, go back and check (i-n+1) */
+                                       i -= contiguous - 1;
                                        contiguous = 0;
                                        break;
                                }