1
0
Fork 0
forked from len0rd/rockbox

Fix a small late creep-in goof in path parsing on native targets

Anything of one dot and one character (e.g. ".a") would get treated as
"." because I left out a condition when converting to recursionless
parsing of relative components. Git 'er fixed up.

Change-Id: Id5603ce0858b419dc08b1d496b4b187a573595f9
This commit is contained in:
Michael Sevakis 2014-09-01 00:00:19 -04:00
parent 5b08f1a5b9
commit 802e0110db

View file

@ -505,8 +505,12 @@ walk_path(struct pathwalk *walkp, struct pathwalk_component *compp,
/* check for "." and ".." */ /* check for "." and ".." */
if (name[0] == '.') if (name[0] == '.')
{ {
if (len == 2 && name[1] == '.') if (len == 1)
break; /* is "." */
if (name[1] == '.')
{ {
/* is ".." */
struct pathwalk_component *parentp = compp->nextp; struct pathwalk_component *parentp = compp->nextp;
if (!parentp) if (!parentp)
return WALK_RC_CONT_AT_ROOT; return WALK_RC_CONT_AT_ROOT;
@ -514,9 +518,8 @@ walk_path(struct pathwalk *walkp, struct pathwalk_component *compp,
compp->nextp = freep; compp->nextp = freep;
freep = compp; freep = compp;
compp = parentp; compp = parentp;
break;
} }
break;
} }
/* fallthrough */ /* fallthrough */