aboutsummaryrefslogtreecommitdiff
path: root/src/bind-lex.l
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-16 19:31:53 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-16 19:31:53 +0300
commitc8865a0d524f3d545836bd4581329089a357661e (patch)
tree4fc437a07086c4304e7ec2446be2a504a3dbd507 /src/bind-lex.l
parent50e703a9a92e755f928699b705612cd4153ffb9f (diff)
downloadgrecs-c8865a0d524f3d545836bd4581329089a357661e.tar.gz
grecs-c8865a0d524f3d545836bd4581329089a357661e.tar.bz2
Add bind testsuite.
* README.submodule: Update URL. * src/bind-lex.l (grecs_bind_new_source): Scan include path. * src/grecs.h (grecs_find_include_file): new proto. * src/preproc.c (try_file): Rename to grecs_find_include_file. Change signature and return type. All uses updated. * tests/Makefile.am (EXTRA_DIST): Add new configs. (TESTSUITE_AT): Add parser-bind.at. * tests/gcffmt.c: Add -I (-include) option. * tests/testsuite.at: Include parser-bind.at. * tests/bind.conf: New file. * tests/bind.dlz: New file. * tests/bind.ext.conf: New file. * tests/bind.int.conf: New file. * tests/bind.keys: New file. * tests/parser-bind.at: New file.
Diffstat (limited to 'src/bind-lex.l')
-rw-r--r--src/bind-lex.l15
1 files changed, 14 insertions, 1 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) {

Return to:

Send suggestions and report system problems to the System administrator.