diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 28 |
1 files changed, 5 insertions, 23 deletions
@@ -375,7 +375,7 @@ opt_variable(struct mu_parseopt *po, struct mu_option *op, char const *arg) { char *p; - struct locus locus = { "<command line>", 1, 0 }; + struct mu_locus_range locus = {{ "<command line>", 1, 0 }}; p = strchr(arg, '='); if (!p) { @@ -421,7 +421,6 @@ static void opt_set_milter_timeout(struct mu_parseopt *po, struct mu_option *op, char const *arg) { - int rc; time_t v; if (mu_str_to_c(arg, mu_c_time, &v, NULL)) { @@ -676,8 +675,7 @@ cb_set_variable(void *data, mu_config_value_t *arg) { const char *value; char *alloc_str = NULL; - struct mu_locus mloc; - struct locus locus; + struct mu_locus_range locus = MU_LOCUS_RANGE_INITIALIZER; if (mu_cfg_assert_value_type(arg, MU_CFG_ARRAY)) return 1; @@ -712,24 +710,10 @@ cb_set_variable(void *data, mu_config_value_t *arg) abort(); } - locus.leng = 0; - if (mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, - MU_IOCTL_LOGSTREAM_GET_LOCUS, &mloc)) { - locus.file = "<unknown>"; - locus.line = 0; - locus.point = 0; - } else { - if (mloc.mu_file) { - struct literal *lit = string_alloc(mloc.mu_file, - strlen(mloc.mu_file)); - free(mloc.mu_file); - locus.file = lit->text; - } else - locus.file = "<unknown>"; - locus.line = mloc.mu_line; - locus.point = mloc.mu_col; - } + mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, + MU_IOCTL_LOGSTREAM_GET_LOCUS_RANGE, &locus); defer_initialize_variable(arg->v.arg.v[0].v.string, value, &locus); + mu_locus_range_deinit(&locus); free(alloc_str); return 0; } @@ -1119,7 +1103,6 @@ static int args_in_order(int argc, char **argv) { int i; - int flag = 0; for (i = 0; i < argc; i++) { size_t len = strcspn(argv[i], "="); if (len > 3 @@ -1244,7 +1227,6 @@ struct mu_cli_setup cli = { int main(int argc, char **argv) { - int rc; prog_counter_t entry_point; int stderr_is_closed = stderr_closed_p(); |