(extfs_find_entry_int): minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2019-01-02 10:25:27 +03:00
parent 533cbbd971
commit 445b427d37

View File

@ -287,12 +287,12 @@ extfs_find_entry_int (extfs_entry_t * dir, const char *name, GSList * list, int
p = name;
name_end = name + strlen (name);
q = strchr (p, PATH_SEP);
if (q == NULL)
q = strchr (p, '\0');
while ((pent != NULL) && (c != '\0') && (*p != '\0'))
{
q = strchr (p, PATH_SEP);
if (q == NULL)
q = (char *) name_end;
c = *q;
*q = '\0';
@ -341,12 +341,8 @@ extfs_find_entry_int (extfs_entry_t * dir, const char *name, GSList * list, int
}
/* Next iteration */
*q = c;
if (c == '\0')
break;
p = q + 1;
q = strchr (p, PATH_SEP);
if (q == NULL)
q = strchr (p, '\0');
if (c != '\0')
p = q + 1;
}
if (pent == NULL)
my_errno = ENOENT;