aboutsummaryrefslogtreecommitdiffstats
path: root/libexfat/lookup.c
diff options
context:
space:
mode:
authorrelan <relan@users.noreply.github.com>2010-02-10 18:16:39 +0000
committerrelan <relan@users.noreply.github.com>2015-08-24 08:26:12 +0300
commitbc9153214199dabe763b2784de5319ee483702ea (patch)
tree583d084836ff4301c8f86bb91502dfe15c1fa6fa /libexfat/lookup.c
parenta4b68c2515bed6a3f8e04bd66c986a0ba9a67afe (diff)
downloadandroid_external_exfat-bc9153214199dabe763b2784de5319ee483702ea.tar.gz
android_external_exfat-bc9153214199dabe763b2784de5319ee483702ea.tar.bz2
android_external_exfat-bc9153214199dabe763b2784de5319ee483702ea.zip
Pass actual return code from lookup_name() instead of -ENOENT.
Diffstat (limited to 'libexfat/lookup.c')
-rw-r--r--libexfat/lookup.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libexfat/lookup.c b/libexfat/lookup.c
index 1841082..2e85322 100644
--- a/libexfat/lookup.c
+++ b/libexfat/lookup.c
@@ -125,6 +125,7 @@ int exfat_lookup(struct exfat* ef, struct exfat_node** node,
struct exfat_node* parent;
const char* p;
size_t n;
+ int rc;
/* start from the root directory */
parent = *node = exfat_get_node(ef->root);
@@ -132,10 +133,11 @@ int exfat_lookup(struct exfat* ef, struct exfat_node** node,
{
if (n == 1 && *p == '.') /* skip "." component */
continue;
- if (lookup_name(ef, parent, node, p, n) != 0)
+ rc = lookup_name(ef, parent, node, p, n);
+ if (rc != 0)
{
exfat_put_node(ef, parent);
- return -ENOENT;
+ return rc;
}
exfat_put_node(ef, parent);
parent = *node;
@@ -160,6 +162,7 @@ int exfat_split(struct exfat* ef, struct exfat_node** parent,
{
const char* p;
size_t n;
+ int rc;
*parent = *node = exfat_get_node(ef->root);
for (p = path; (n = get_comp(p, &p)); p += n)
@@ -168,8 +171,6 @@ int exfat_split(struct exfat* ef, struct exfat_node** parent,
continue;
if (is_last_comp(p, n))
{
- int rc;
-
if (!is_allowed(p, n))
{
/* contains characters that are not allowed */
@@ -191,10 +192,11 @@ int exfat_split(struct exfat* ef, struct exfat_node** parent,
}
return 0;
}
- if (lookup_name(ef, *parent, node, p, n) != 0)
+ rc = lookup_name(ef, *parent, node, p, n);
+ if (rc != 0)
{
exfat_put_node(ef, *parent);
- return -ENOENT;
+ return rc;
}
exfat_put_node(ef, *parent);
*parent = *node;