summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-11 21:08:37 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-11 21:08:37 (GMT)
commitd68899aee5937b3d2cd8ab35b1e7011a7b2e4070 (patch)
tree737acd445679009fb0fce0ef55fe1e8815975e66 /kicad
parent31e61ae51b50efbf23c836ae47a556b6eedb2555 (diff)
downloadeeshow-d68899aee5937b3d2cd8ab35b1e7011a7b2e4070.zip
eeshow-d68899aee5937b3d2cd8ab35b1e7011a7b2e4070.tar.gz
eeshow-d68899aee5937b3d2cd8ab35b1e7011a7b2e4070.tar.bz2
kicad/lib-parse.c, pl-parse.c: defer error messages for search paths
Diffstat (limited to 'kicad')
-rw-r--r--kicad/lib-parse.c14
-rw-r--r--kicad/pl-parse.c6
2 files changed, 18 insertions, 2 deletions
diff --git a/kicad/lib-parse.c b/kicad/lib-parse.c
index dc17cef..8c3e62d 100644
--- a/kicad/lib-parse.c
+++ b/kicad/lib-parse.c
@@ -392,7 +392,7 @@ bool lib_parse(struct lib *lib, const char *name, const struct file *related)
}
-bool lib_find_file(struct file *file, const char *name,
+static bool do_find_file(struct file *file, const char *name,
const struct file_names *fn, const struct file *related)
{
if (file_open(file, name, related))
@@ -404,6 +404,18 @@ bool lib_find_file(struct file *file, const char *name,
}
+bool lib_find_file(struct file *file, const char *name,
+ const struct file_names *fn, const struct file *related)
+{
+ bool res;
+
+ diag_defer_begin();
+ res = do_find_file(file, name, fn, related);
+ diag_defer_end(!res);
+ return res;
+}
+
+
bool lib_parse_search(struct lib *lib, const char *name,
const struct file_names *fn, const struct file *related)
{
diff --git a/kicad/pl-parse.c b/kicad/pl-parse.c
index c22e171..7a09dd8 100644
--- a/kicad/pl-parse.c
+++ b/kicad/pl-parse.c
@@ -543,9 +543,13 @@ struct pl_ctx *pl_parse_search(const char *name, const struct file *related)
{
struct file file;
struct pl_ctx *pl;
+ bool res;
if (name) {
- if (!pl_find_file(&file, name, related))
+ diag_defer_begin();
+ res = pl_find_file(&file, name, related);
+ diag_defer_end(!res);
+ if (!res)
return NULL;
pl = pl_parse(&file);
file_close(&file);