summaryrefslogtreecommitdiffabout
path: root/src/main.c
authorSergey Poznyakoff <gray@gnu.org>2017-06-18 11:00:02 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2017-06-18 11:17:41 (GMT)
commitffb02f79f0381f296e73add258f87ecb2456fba3 (patch) (side-by-side diff)
tree5d074c615fb42e58ae03145c4ad4a35da63dd9db /src/main.c
parent565ff017ae9e52bbe41ccfb90668a642a2704afe (diff)
downloadmailfromd-ffb02f79f0381f296e73add258f87ecb2456fba3.tar.gz
mailfromd-ffb02f79f0381f296e73add258f87ecb2456fba3.tar.bz2
Switch to detailed source locations from Mailutils 3.2.92
* configure.ac: Version 8.1.92 * NEWS: Update. * src/builtin/debug.bi (debug): Use mu_locus_range * src/builtin/from.bi: Likewise. * src/builtin/header.bi: Likewise. * src/builtin/progress.bi: Likewise. * src/builtin/qrnt.bi: Likewise. * src/builtin/rcpt.bi: Likewise. * src/exclist.c: Likewise. * src/builtin/sieve.bi: Use mu_locus_range (sieve): Accept new optional argument "col". * src/drivers.c: Use mu_locus_range (MARK_LOCUS): Rewrite as inline function. * src/gram.y: Use mu_locus_range and location macros from mailutils/yyloc.h Improve error diagnostics (parse_program): Prepare mu_strerr for locus-aware diagnostics. * src/lex.l: Use mu_linetrack_t to track locations. * src/mailfromd.h: Use mu_locus_range * src/main.c: Likewise. * src/pp.c: Likewise. * src/prog.c: Likewise. * src/prog.h: Likewise. * src/symbols.c: Likewise. * tests/ashadow.at: Expect detailed error locations. * tests/bctx00.at: Likewise. * tests/fctx00.at: Likewise. * tests/invcidr.at: Likewise. * tests/invcidr2.at: Likewise. * tests/module04.at: Likewise. * tests/module06.at: Likewise. * tests/poll04.at: Likewise. * tests/setvar.at: Likewise. * tests/shadow.at: Likewise. * tests/static02.at: Likewise.
Diffstat (limited to 'src/main.c') (more/less context) (show whitespace changes)
-rw-r--r--src/main.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/main.c b/src/main.c
index 49d0217..66a9780 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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();

Return to:

Send suggestions and report system problems to the System administrator.