git.droids-corp.org
/
protos
/
libecoli.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use helper in cmd node
[protos/libecoli.git]
/
lib
/
ecoli_node_file.c
diff --git
a/lib/ecoli_node_file.c
b/lib/ecoli_node_file.c
index
ab772dc
..
001dcb6
100644
(file)
--- a/
lib/ecoli_node_file.c
+++ b/
lib/ecoli_node_file.c
@@
-17,7
+17,7
@@
#include <ecoli_strvec.h>
#include <ecoli_string.h>
#include <ecoli_node.h>
#include <ecoli_strvec.h>
#include <ecoli_string.h>
#include <ecoli_node.h>
-#include <ecoli_parse
d
.h>
+#include <ecoli_parse.h>
#include <ecoli_complete.h>
#include <ecoli_node_file.h>
#include <ecoli_complete.h>
#include <ecoli_node_file.h>
@@
-38,14
+38,14
@@
struct ec_node_file {
static int
ec_node_file_parse(const struct ec_node *gen_node,
static int
ec_node_file_parse(const struct ec_node *gen_node,
- struct ec_parse
d
*state,
+ struct ec_parse *state,
const struct ec_strvec *strvec)
{
(void)gen_node;
(void)state;
if (ec_strvec_len(strvec) == 0)
const struct ec_strvec *strvec)
{
(void)gen_node;
(void)state;
if (ec_strvec_len(strvec) == 0)
- return EC_PARSE
D
_NOMATCH;
+ return EC_PARSE_NOMATCH;
return 1;
}
return 1;
}
@@
-161,13
+161,17
@@
ec_node_file_complete(const struct ec_node *gen_node,
bname_len = strlen(bname);
while (1) {
bname_len = strlen(bname);
while (1) {
+ int save_errno = errno;
+
errno = 0;
de = node->readdir(dir);
if (de == NULL) {
errno = 0;
de = node->readdir(dir);
if (de == NULL) {
- if (errno == 0)
+ if (errno == 0) {
+ errno = save_errno;
goto out;
goto out;
- else
+ } else {
goto fail;
goto fail;
+ }
}
if (!ec_str_startswith(de->d_name, bname))
}
if (!ec_str_startswith(de->d_name, bname))