summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-08 00:00:37 -0300
committerWerner Almesberger <werner@almesberger.net>2016-09-08 00:00:37 -0300
commitf69451c8188aaab89c5dcbce2207f2e9ac94d734 (patch)
tree64b464225986cbff61e3ebc9c1a61de85340b1b2
parent325eabdfe3a97e253862d731ad9604ffda819e6e (diff)
downloadeeshow-f69451c8188aaab89c5dcbce2207f2e9ac94d734.tar.gz
eeshow-f69451c8188aaab89c5dcbce2207f2e9ac94d734.tar.bz2
eeshow-f69451c8188aaab89c5dcbce2207f2e9ac94d734.zip
main/eeplot.c, gui/gui.c: use pl_parse_search
This also relaxes the error handling of eeshow: it no longer rejects a revision if it is unable to find the page layout file. the page layout file no longer causes
-rw-r--r--gui/gui.c16
-rw-r--r--main/eeplot.c13
2 files changed, 8 insertions, 21 deletions
diff --git a/gui/gui.c b/gui/gui.c
index b5668c9..00ce8a1 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -223,7 +223,6 @@ static const struct sheet *parse_files(struct gui_hist *hist,
{
char *rev = NULL;
struct file pro_file, sch_file;
- struct file pl_file;
const struct file *leader = NULL;
unsigned libs_open, i;
bool libs_cached = 0;
@@ -271,16 +270,11 @@ static const struct sheet *parse_files(struct gui_hist *hist,
fn, leader))
goto fail;
- if (fn->pl) {
- if (!file_open(&pl_file, fn->pl, leader))
- goto fail;
- hist->pl = pl_parse(&pl_file);
- file_close(&pl_file);
- /*
- * We treat failing to parse the page layout as a "minor"
- * failure and don't reject the revision just because of it.
- */
- }
+ hist->pl = pl_parse_search(fn->pl, leader);
+ /*
+ * We treat failing to load or parse the page layout as a "minor"
+ * failure and don't reject the revision just because of it.
+ */
if (hist->vcs_hist) {
hist->oids = alloc_type_n(void *, libs_open);
diff --git a/main/eeplot.c b/main/eeplot.c
index e39394c..86bc4e7 100644
--- a/main/eeplot.c
+++ b/main/eeplot.c
@@ -222,16 +222,9 @@ int main(int argc, char **argv)
if (file_names.pro)
file_close(&pro_file);
- if (fn->pl) {
- struct file file;
-
- if (!file_open(&file, fn->pl, &sch_file))
- return 1;
- pl = pl_parse(&file);
- file_close(&file);
- if (!pl)
- return 1;
- }
+ pl = pl_parse_search(fn->pl, &sch_file);
+ if (!pl)
+ return 1;
if (fn != &file_names) {
free_file_names(fn);