[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extra empty line in Unformatted
From: |
Lars Henriksen |
Subject: |
Re: Extra empty line in Unformatted |
Date: |
Wed, 8 Jan 2003 21:18:39 +0100 |
User-agent: |
Mutt/1.4i |
On Wed, Jan 08, 2003 at 08:14:59PM +0100, Lars Henriksen wrote:
> Have you ever pondered over this comment in parsepr() in gnatsweb 4?
>
> # 3/30/99 kenstir: For some reason Unformatted always ends up with an
> # extra newline here.
> $fields{$UNFORMATTED_FIELD} ||= ''; # Default to empty value
> $fields{$UNFORMATTED_FIELD} =~ s/\n$//;
>
> I have, and now I've found the reason for the extra newline. The bug is in
> GNATS: a query with format 'full' returns an extra, empty line after each PR.
> Try "query-pr --format=full <PR>" and compare with the PR file in the
> database. The command "pr-edit --lock <user> <PR>" also returns the full PR,
> but without the extra newline.
>
[snip]
> Index: cmds.c
> ===================================================================
> RCS file: /cvsroot/gnats/gnats/gnats/cmds.c,v
> retrieving revision 1.70
> diff -u -p -r1.70 cmds.c
> --- cmds.c 14 Oct 2002 11:42:25 -0000 1.70
> +++ cmds.c 8 Jan 2003 19:01:00 -0000
> @@ -281,7 +281,7 @@ server_print_query (int which, PR *pr, Q
> }
> else
> {
> - printf ("\r\n.\r\n");
> + printf (".\r\n");
> }
> }
> }
My "fix" breaks things hopelessly. A closer look at server_print_query()
reveals that it prints the "\r\n" sequence after every single query result.
If individual query results have no terminating newline, the results are
nicely broken into lines; if they have, they are separated by empty lines.
So maybe the problem is that gnatsweb doesn't take the separator line into
account?
Lars Henriksen