Commit d7e898c0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Fix up a couple of straggling issues with include "./xxx"; If we

know the filename of the -f argument, it should be possible to
include "./" relative to it.

The footnote is that the include is resolved at lower privlevel
than the -f file is read, so in really obscure cases you could
have really obscure error messages.
parent 298dc444
......@@ -165,8 +165,8 @@ char *mgt_VccCompile(struct cli *, const char *vclname, const char *vclsrc,
void mgt_vcc_init(void);
void mgt_vcl_init(void);
void mgt_vcc_default(struct cli *, const char *b_arg, const char *vclsrc,
int Cflag);
void mgt_vcc_startup(struct cli *, const char *b_arg, const char *f_arg,
const char *vclsrc, int Cflag);
int mgt_push_vcls_and_start(unsigned *status, char **p);
int mgt_has_vcl(void);
extern char *mgt_cc_cmd;
......
......@@ -752,7 +752,7 @@ main(int argc, char * const *argv)
mgt_vcl_init();
if (b_arg != NULL || f_arg != NULL) {
mgt_vcc_default(cli, b_arg, vcl, C_flag);
mgt_vcc_startup(cli, b_arg, f_arg, vcl, C_flag);
if (C_flag && cli->result == CLIS_OK) {
AZ(VSB_finish(cli->sb));
fprintf(stderr, "%s\n", VSB_data(cli->sb));
......
......@@ -201,14 +201,15 @@ mgt_new_vcl(struct cli *cli, const char *vclname, const char *vclsrc,
/*--------------------------------------------------------------------*/
void
mgt_vcc_default(struct cli *cli, const char *b_arg, const char *vclsrc,
int C_flag)
mgt_vcc_startup(struct cli *cli, const char *b_arg, const char *f_arg,
const char *vclsrc, int C_flag)
{
char buf[BUFSIZ];
if (b_arg == NULL) {
AN(vclsrc);
mgt_new_vcl(cli, "boot", vclsrc, NULL, NULL, C_flag);
AN(f_arg);
mgt_new_vcl(cli, "boot", vclsrc, f_arg, NULL, C_flag);
return;
}
......@@ -218,7 +219,7 @@ mgt_vcc_default(struct cli *cli, const char *b_arg, const char *vclsrc,
"backend default {\n"
" .host = \"%s\";\n"
"}\n", b_arg);
mgt_new_vcl(cli, "boot", buf, NULL, NULL, C_flag);
mgt_new_vcl(cli, "boot", buf, "<-b argument>", NULL, C_flag);
}
/*--------------------------------------------------------------------*/
......@@ -262,7 +263,7 @@ mcf_vcl_inline(struct cli *cli, const char * const *av, void *priv)
return;
}
mgt_new_vcl(cli, av[2], av[3], NULL, av[4], 0);
mgt_new_vcl(cli, av[2], av[3], "<vcl.inline>", av[4], 0);
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment