diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-12-08 19:46:44 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-12-08 19:53:37 +0200 |
commit | e20d435c8e310046c15acbdf47fa458fe7ead1ae (patch) | |
tree | fa645bf3e86c9f9dc0168c13724893731b185524 /comsat | |
parent | 06fb6b02b42973f8a036cd7288fe7e1f609801b7 (diff) | |
download | mailutils-e20d435c8e310046c15acbdf47fa458fe7ead1ae.tar.gz mailutils-e20d435c8e310046c15acbdf47fa458fe7ead1ae.tar.bz2 |
Minor improvements in logstream and related code.
* include/mailutils/stream.h (MU_IOCTL_LOGSTREAM_SET_LOCUS_LINE)
(MU_IOCTL_LOGSTREAM_SET_LOCUS_COL): New subcodes.
* libmailutils/stream/logstream.c (_log_ctl): Handle two new subcodes.
* comsat/action.c (eval_biffrc): Use new ioctl subcode to update the
line number.
Diffstat (limited to 'comsat')
-rw-r--r-- | comsat/action.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/comsat/action.c b/comsat/action.c index 28ac348e2..2d9aa3979 100644 --- a/comsat/action.c +++ b/comsat/action.c @@ -522,12 +522,12 @@ eval_biffrc (struct biffrc_environ *env) ws.ws_comment = "#"; wsflags = MU_WRDSF_DEFFLAGS | MU_WRDSF_COMMENT; + mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, + MU_IOCTL_LOGSTREAM_SET_LOCUS, &env->locus); + mu_stream_ioctl (env->logstr, MU_IOCTL_LOGSTREAM, + MU_IOCTL_LOGSTREAM_SET_LOCUS, &env->locus); while (mu_stream_getline (env->input, &stmt, &size, &n) == 0 && n > 0) { - mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, - MU_IOCTL_LOGSTREAM_SET_LOCUS, &env->locus); - mu_stream_ioctl (env->logstr, MU_IOCTL_LOGSTREAM, - MU_IOCTL_LOGSTREAM_SET_LOCUS, &env->locus); if (strncmp (stmt, "#line ", 6) == 0) { char *p; @@ -540,9 +540,11 @@ eval_biffrc (struct biffrc_environ *env) else { mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, - MU_IOCTL_LOGSTREAM_SET_LOCUS, &env->locus); + MU_IOCTL_LOGSTREAM_SET_LOCUS_LINE, + &env->locus.mu_line); mu_stream_ioctl (env->logstr, MU_IOCTL_LOGSTREAM, - MU_IOCTL_LOGSTREAM_SET_LOCUS, &env->locus); + MU_IOCTL_LOGSTREAM_SET_LOCUS_LINE, + &env->locus.mu_line); } continue; } @@ -553,7 +555,10 @@ eval_biffrc (struct biffrc_environ *env) if (ws.ws_wordc == 0) { - env->locus.mu_line++; + mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, + MU_IOCTL_LOGSTREAM_ADVANCE_LOCUS_LINE, NULL); + mu_stream_ioctl (env->logstr, MU_IOCTL_LOGSTREAM, + MU_IOCTL_LOGSTREAM_ADVANCE_LOCUS_LINE, NULL); continue; } @@ -591,7 +596,10 @@ eval_biffrc (struct biffrc_environ *env) report_error (env, "%s", mu_wordsplit_strerror (&ws)); wsflags |= MU_WRDSF_REUSE; - env->locus.mu_line++; + mu_stream_ioctl (mu_strerr, MU_IOCTL_LOGSTREAM, + MU_IOCTL_LOGSTREAM_ADVANCE_LOCUS_LINE, NULL); + mu_stream_ioctl (env->logstr, MU_IOCTL_LOGSTREAM, + MU_IOCTL_LOGSTREAM_ADVANCE_LOCUS_LINE, NULL); } free (stmt); mu_wordsplit_free (&ws); |