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, | |||
375 | char const *arg) | 375 | char const *arg) |
376 | { | 376 | { |
377 | char *p; | 377 | char *p; |
378 | struct locus locus = { "<command line>", 1, 0 }; | 378 | struct mu_locus_range locus = {{ "<command line>", 1, 0 }}; |
379 | 379 | ||
380 | p = strchr(arg, '='); | 380 | p = strchr(arg, '='); |
381 | if (!p) { | 381 | if (!p) { |
@@ -421,7 +421,6 @@ static void | |||
421 | opt_set_milter_timeout(struct mu_parseopt *po, struct mu_option *op, | 421 | opt_set_milter_timeout(struct mu_parseopt *po, struct mu_option *op, |
422 | char const *arg) | 422 | char const *arg) |
423 | { | 423 | { |
424 | int rc; | ||
425 | time_t v; | 424 | time_t v; |
426 | 425 | ||
427 | if (mu_str_to_c(arg, mu_c_time, &v, NULL)) { | 426 | 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) | |||
676 | { | 675 | { |
677 | const char *value; | 676 | const char *value; |
678 | char *alloc_str = NULL; | 677 | char *alloc_str = NULL; |
679 | struct mu_locus mloc; | 678 | struct mu_locus_range locus = MU_LOCUS_RANGE_INITIALIZER; |
680 | struct locus locus; | ||
681 | 679 | ||
682 | if (mu_cfg_assert_value_type(arg, MU_CFG_ARRAY)) | 680 | if (mu_cfg_assert_value_type(arg, MU_CFG_ARRAY)) |
683 | return 1; | 681 | return 1; |
@@ -712,24 +710,10 @@ cb_set_variable(void *data, mu_config_value_t *arg) | |||
712 | abort(); | 710 | abort(); |
713 | } | 711 | } |
714 | 712 | ||
715 | locus.leng = 0; | 713 | mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, |
716 | if (mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, | 714 | MU_IOCTL_LOGSTREAM_GET_LOCUS_RANGE, &locus); |
717 | MU_IOCTL_LOGSTREAM_GET_LOCUS, &mloc)) { | ||
718 | locus.file = "<unknown>"; | ||
719 | locus.line = 0; | ||
720 | locus.point = 0; | ||
721 | } else { | ||
722 | if (mloc.mu_file) { | ||
723 | struct literal *lit = string_alloc(mloc.mu_file, | ||
724 | strlen(mloc.mu_file)); | ||
725 | free(mloc.mu_file); | ||
726 | locus.file = lit->text; | ||
727 | } else | ||
728 | locus.file = "<unknown>"; | ||
729 | locus.line = mloc.mu_line; | ||
730 | locus.point = mloc.mu_col; | ||
731 | } | ||
732 | defer_initialize_variable(arg->v.arg.v[0].v.string, value, &locus); | 715 | defer_initialize_variable(arg->v.arg.v[0].v.string, value, &locus); |
716 | mu_locus_range_deinit(&locus); | ||
733 | free(alloc_str); | 717 | free(alloc_str); |
734 | return 0; | 718 | return 0; |
735 | } | 719 | } |
@@ -1119,7 +1103,6 @@ static int | |||
1119 | args_in_order(int argc, char **argv) | 1103 | args_in_order(int argc, char **argv) |
1120 | { | 1104 | { |
1121 | int i; | 1105 | int i; |
1122 | int flag = 0; | ||
1123 | for (i = 0; i < argc; i++) { | 1106 | for (i = 0; i < argc; i++) { |
1124 | size_t len = strcspn(argv[i], "="); | 1107 | size_t len = strcspn(argv[i], "="); |
1125 | if (len > 3 | 1108 | if (len > 3 |
@@ -1244,7 +1227,6 @@ struct mu_cli_setup cli = { | |||
1244 | int | 1227 | int |
1245 | main(int argc, char **argv) | 1228 | main(int argc, char **argv) |
1246 | { | 1229 | { |
1247 | int rc; | ||
1248 | prog_counter_t entry_point; | 1230 | prog_counter_t entry_point; |
1249 | int stderr_is_closed = stderr_closed_p(); | 1231 | int stderr_is_closed = stderr_closed_p(); |
1250 | 1232 | ||