]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_fat.c
fix '..' and '.'
[z180-stamp.git] / 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;