aboutsummaryrefslogtreecommitdiff
path: root/src/bind-lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/bind-lex.l')
-rw-r--r--src/bind-lex.l17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/bind-lex.l b/src/bind-lex.l
index 12dddf7..a5cf644 100644
--- a/src/bind-lex.l
+++ b/src/bind-lex.l
@@ -194,3 +194,16 @@ grecs_bind_new_source(const char *name)
struct stat st;
- FILE *fp = fopen(name, "r");
+ FILE *fp;
+
+ if (access(name, F_OK)) {
+ int ec = errno;
+ char *tmp = grecs_find_include_file(name, 0);
+ if (!tmp) {
+ grecs_error(loc, ec, _("cannot open `%s'"), name);
+ return 1;
+ }
+ name = grecs_install_text(tmp);
+ free(tmp);
+ }
+
+ fp = fopen(name, "r");
if (!fp) {
@@ -198,3 +211,3 @@ grecs_bind_new_source(const char *name)
return 1;
- }
+ }
if (fstat(fileno(fp), &st)) {

Return to:

Send suggestions and report system problems to the System administrator.