X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fecoli_node_file.c;h=001dcb6bf1ce0d2d57ab09c8c8955b6c4399ed9d;hb=51028779e0a8772091aec5ab96bcf2519cf2f1ad;hp=ab772dc3625d4b51642c1380c1c3043b1df8ab72;hpb=539a859dde94b304e93f44a52b7e7fc0734e3a5d;p=protos%2Flibecoli.git diff --git a/lib/ecoli_node_file.c b/lib/ecoli_node_file.c index ab772dc..001dcb6 100644 --- a/lib/ecoli_node_file.c +++ b/lib/ecoli_node_file.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -38,14 +38,14 @@ struct ec_node_file { static int ec_node_file_parse(const struct ec_node *gen_node, - struct ec_parsed *state, + struct ec_parse *state, const struct ec_strvec *strvec) { (void)gen_node; (void)state; if (ec_strvec_len(strvec) == 0) - return EC_PARSED_NOMATCH; + return EC_PARSE_NOMATCH; return 1; } @@ -161,13 +161,17 @@ ec_node_file_complete(const struct ec_node *gen_node, bname_len = strlen(bname); while (1) { + int save_errno = errno; + errno = 0; de = node->readdir(dir); if (de == NULL) { - if (errno == 0) + if (errno == 0) { + errno = save_errno; goto out; - else + } else { goto fail; + } } if (!ec_str_startswith(de->d_name, bname))