diff options
Diffstat (limited to 'firmware/common')
-rw-r--r-- | firmware/common/file_internal.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/common/file_internal.c b/firmware/common/file_internal.c index e5b43cd19d..b66aafd61e 100644 --- a/firmware/common/file_internal.c +++ b/firmware/common/file_internal.c | |||
@@ -505,8 +505,12 @@ walk_path(struct pathwalk *walkp, struct pathwalk_component *compp, | |||
505 | /* check for "." and ".." */ | 505 | /* check for "." and ".." */ |
506 | if (name[0] == '.') | 506 | if (name[0] == '.') |
507 | { | 507 | { |
508 | if (len == 2 && name[1] == '.') | 508 | if (len == 1) |
509 | break; /* is "." */ | ||
510 | |||
511 | if (name[1] == '.') | ||
509 | { | 512 | { |
513 | /* is ".." */ | ||
510 | struct pathwalk_component *parentp = compp->nextp; | 514 | struct pathwalk_component *parentp = compp->nextp; |
511 | if (!parentp) | 515 | if (!parentp) |
512 | return WALK_RC_CONT_AT_ROOT; | 516 | return WALK_RC_CONT_AT_ROOT; |
@@ -514,9 +518,8 @@ walk_path(struct pathwalk *walkp, struct pathwalk_component *compp, | |||
514 | compp->nextp = freep; | 518 | compp->nextp = freep; |
515 | freep = compp; | 519 | freep = compp; |
516 | compp = parentp; | 520 | compp = parentp; |
521 | break; | ||
517 | } | 522 | } |
518 | |||
519 | break; | ||
520 | } | 523 | } |
521 | 524 | ||
522 | /* fallthrough */ | 525 | /* fallthrough */ |