diff options
Diffstat (limited to 'cmd-source-file.c')
-rw-r--r-- | cmd-source-file.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cmd-source-file.c b/cmd-source-file.c index 9c3a5641..c97eff63 100644 --- a/cmd-source-file.c +++ b/cmd-source-file.c @@ -1,4 +1,4 @@ -/* $Id: cmd-source-file.c,v 1.11 2009-11-28 14:50:36 tcunha Exp $ */ +/* $Id: cmd-source-file.c,v 1.12 2010-02-08 18:10:07 tcunha Exp $ */ /* * Copyright (c) 2008 Tiago Cunha <me@tiagocunha.org> @@ -89,12 +89,18 @@ int cmd_source_file_exec(struct cmd *self, struct cmd_ctx *ctx) { struct cmd_source_file_data *data = self->data; - char *cause; + char **causes; + u_int i, ncauses; - if (load_cfg(data->path, ctx, &cause) != 0) { - ctx->error(ctx, "%s", cause); - xfree(cause); - return (-1); + causes = NULL; + ncauses = 0; + + if (load_cfg(data->path, ctx, &ncauses, &causes) != 0) { + for (i = 0; i < ncauses; i++) { + ctx->print(ctx, "%s", causes[i]); + xfree(causes[i]); + } + xfree(causes); } return (0); |