Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Denis PILAT <denis.pilat@st.com>, Chet Ramey <chet.ramey@case.edu>
Cc: Eli Zaretskii <eliz@gnu.org>,
	gdb-patches@sources.redhat.com, 	bash-maintainers@gnu.org
Subject: Re: [patch-readline] history file reading
Date: Tue, 21 Mar 2006 15:38:00 -0000	[thread overview]
Message-ID: <20060321145842.GA25689@nevyn.them.org> (raw)
In-Reply-To: <44201202.3010001@case.edu> <441FD3C7.1090504@st.com>

On Tue, Mar 21, 2006 at 09:47:30AM -0500, Chet Ramey wrote:
> Denis PILAT wrote:
> 
> >>
> > This new version of my patch changes the way we read history files to
> > allow "\r\n" in end-of-line.
> > I don't change any more the way we write history files.
> 
> I don't see any problem with including this, or a variant.

Fine by me too.

Denis, if you plan to continue submitting GDB patches, I think this is
the point where I talk about coding style :-)

On Tue, Mar 21, 2006 at 11:21:59AM +0100, Denis PILAT wrote:
> 2006-03-21  Denis Pilat <denis.pilat@st.com>
> 
>    * histfile.c (read_history_range): remove '\r' character from 
> history lines
>    to allow reading files with Windows like end-of-line on unix host.

Our ChangeLog entries have two spaces between date and name, and two
between name and date.  The indented portion starts with a tab on every
line.  The first character should usually be capitalized.  Also, they
cover only "what" and not "why".

2006-03-21  Denis Pilat  <denis.pilat@st.com>
 
	* histfile.c (read_history_range): Remove '\r' character from
	history lines.

> Index: histfile.c
> ===================================================================
> --- histfile.c	(revision 386)
> +++ histfile.c	(working copy)
> @@ -228,7 +228,11 @@
>    for (line_end = line_start; line_end < bufend; line_end++)
>      if (*line_end == '\n')
>        {
> -	*line_end = '\0';
> +	/* allow reading files with Windows like end-of-line */

Comments start with a capital, and end with a period and two spaces.
	/* Allow reading files with Windows-like end-of-line.  */

> +	if ( line_end - 1 >= line_start && *( line_end - 1 ) =='\r' )
> +	  *( line_end - 1 )  = '\0';

And you don't need the spaces inside the parentheses, but do usually
need spaces around operators:

	if (line_end - 1 >= line_start && *(line_end - 1) == '\r')
	  *(line_end - 1)  = '\0';

> +	else
> +	  *line_end = '\0';
>  
>  	if (*line_start)
>  	  add_history (line_start);

I've checked this in with formatting fixes.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-03-21 14:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-17  0:15 [patch-readline] history file generation on minGW host Denis PILAT
2006-03-17  0:26 ` Daniel Jacobowitz
2006-03-17  0:31   ` Denis PILAT
2006-03-17 16:07 ` Eli Zaretskii
2006-03-17 19:12   ` Denis PILAT
2006-03-17 19:37     ` Chet Ramey
2006-03-21 15:30   ` [patch-readline] history file reading Denis PILAT
2006-03-21 15:32     ` Chet Ramey
2006-03-21 15:38       ` Daniel Jacobowitz [this message]
2006-03-21 16:29         ` Andreas Schwab
2006-03-21 16:42           ` Bob Rossi
2006-03-21 16:46             ` Daniel Jacobowitz
2006-03-23  4:55             ` Eli Zaretskii
2006-03-21 19:52         ` Brian J. Fox
2006-03-21 19:55           ` Daniel Jacobowitz
2006-03-21 20:02           ` Andreas Schwab
2006-03-23  5:15             ` Eli Zaretskii
2006-03-23  4:37         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060321145842.GA25689@nevyn.them.org \
    --to=drow@false.org \
    --cc=bash-maintainers@gnu.org \
    --cc=chet.ramey@case.edu \
    --cc=denis.pilat@st.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox