]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
fix '..' and '.'
authorLeo C <erbl259-lmu@yahoo.de>
Sun, 27 May 2018 01:02:43 +0000 (03:02 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Sun, 27 May 2018 01:02:43 +0000 (03:02 +0200)
avr/cmd_fat.c

index 039ec9039d753deb63cefc9c3bc7b2eb942f093f..77ef28fe731187b527b6180eeffdce1baa3bf9f6 100644 (file)
@@ -203,6 +203,15 @@ static char *path_skip_heading(char *p)
 {
        if ((p[0] & 0x38) == '0' &&  p[1] == ':') {
                p += 2;
+       } else {
+               char *q = p;
+               if (*q++ == '.') {
+                       if (*q == '.')
+                               ++q;
+                       if (*q == '\0' || *q == '/')
+                               p = q;
+               }
+               return p;
        }
        if (*p == '/')
                ++p;