]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes for include.
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 9 Oct 2011 23:01:58 +0000 (01:01 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 9 Oct 2011 23:41:08 +0000 (01:41 +0200)
conf/cf-lex.l
conf/conf.h
nest/cli.c
sysdep/unix/main.c

index 79dbab29ccefc51ccabc0ec280b32dea586a3655..02ba4b3945cb3ab92217d7f218764cb0d090b42f 100644 (file)
@@ -75,6 +75,7 @@ linpool *cfg_mem;
 
 int (*cf_read_hook)(byte *buf, unsigned int max, int fd);
 int (*cf_open_hook)(char *filename);
+struct include_file_stack *ifs;
 
 #define YY_INPUT(buf,result,max) result = cf_read_hook(buf, max, ifs->conf_fd);
 #define YY_NO_UNPUT
index df772681a34760506cbe65114fe4bd4003e7e54e..142c6adeabc221f0295592bc0ab38b6c71709c01 100644 (file)
@@ -120,7 +120,7 @@ struct include_file_stack {
         struct include_file_stack *next;
 };
 
-struct include_file_stack *ifs;
+extern struct include_file_stack *ifs;
 
 
 int cf_lex(void);
index c83a54fee8c24dd8c9ff56fab728a69a2fc56f7e..f9cc0f47e5cf389e82fddfbccca83e1d6413c716 100644 (file)
@@ -224,7 +224,7 @@ static int cli_rh_trick_flag;
 struct cli *this_cli;
 
 static int
-cli_cmd_read_hook(byte *buf, unsigned int max)
+cli_cmd_read_hook(byte *buf, unsigned int max, UNUSED int fd)
 {
   if (!cli_rh_trick_flag)
     {
index 72f7e852a1d93e7c2009a88b471ed86d196314a1..d6176841a5658a788ddbd59fd1f84d87168ebe91 100644 (file)
@@ -171,11 +171,14 @@ cf_open(char *filename)
 
   if (*filename != '/') {
     snprintf(full_name, sizeof(full_name), "%s/%s", dirname(config_name), filename);
+    full_name[sizeof(full_name)-1] = 0;
     cur = full_name;
   }
 
   if ((ret = open(cur, O_RDONLY)) == -1)
     cf_error("Unable to open included configuration file: %s", cur);
+
+  return ret;
 }