nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] wrapping, etc.


From: David Lawrence Ramsey
Subject: Re: [Nano-devel] wrapping, etc.
Date: Sun, 31 Mar 2002 17:17:36 -0800 (PST)

On Sun, 31 Mar 2002 17:05:52 -0500 (EST), David Benbennick
<address@hidden> wrote:

>Thanks for bringing this up again!  I was afraid everyone
>had forgotten about it.  You say there was an off-by-one
>error in the totsize calculation.  I haven't been able to
>find it: can you point out where it was, or how to
>demonstrate it?  Thanks.

I'm not in front of my box right now, but IIRC, the bug
could be reproduced as follows using the following
instructions (and, of course, your original wrapping
patch).  It's easy to see if you turn on constant cursor
position display before doing this.

1. start with a blank buffer
2. type in "one two three"
3. move the cursor to the space between "one" and "two"
4. hold down the spacebar until "two three" has wrapped
onto the next line

>Your new totsize calculation in do_wrap() assumes that
>inptr->next != NULL.  I have added an assert to document
>that condition.  (My original patch did not make that
>assumption, though I agree it should always be true.)

Oh, good.

>>      * D. B.'s fix to allow get_next_filename() to
>> return INT_MAX
>
>Um, I think you broke my patch.  Assume that every save
>file before INT_MAX already exists.  What I sent made it
>possible for get_next_filename() to return name.INT_MAX if
>there was not already a save file by that name.  Your
>patch makes it return name.INT_MAX if there is already
>such a file, and not otherwise!  I have changed things
>back.

I don't know how the breakage happened, but it's a good
thing you caught it; thanks.

>Also, I added a fix for the seg fault I pointed out on
>13-Mar at 11:54 EST, about cutting the first line of a file
>when in multibuffer mode, closing the file, then uncutting
>in another buffer.  The fix is different from the one I sent
>before, and better.  It turns out the only place the fileage
>needs to be synchronized is in files.c:close_open_file(),
>just *before* the call to open_nextfile().

That'll definitely work.


_____________________________________________________________
Sluggy.Net: The Sluggy Freelance Community!

_____________________________________________________________
Run a small business? Then you need professional email like address@hidden from 
Everyone.net  http://www.everyone.net?tag
--- Begin Message --- Subject: Re: [Nano-devel] wrapping, etc. Date: Sun, 31 Mar 2002 17:05:52 -0500 (EST)
Hi.  There are two patches attached.  The first contains the patch DLR
sent yesterday, with the changes described below.  The second is a diff
between DLR's patch and mine, so you can easily see what I am changing.


On Sat, 30 Mar 2002, David Lawrence Ramsey wrote:
> The attached patch contains the following:                    <snip>
> * David Benbennick's overhaul of the wrapping code from a
> patch he sent awhile ago                                      <snip>

Thanks for bringing this up again!  I was afraid everyone had forgotten
about it.  You say there was an off-by-one error in the totsize
calculation.  I haven't been able to find it: can you point out where it
was, or how to demonstrate it?  Thanks.

Your new totsize calculation in do_wrap() assumes that inptr->next !=
NULL.  I have added an assert to document that condition.  (My original
patch did not make that assumption, though I agree it should always be
true.)


>      * D. B.'s fix to allow get_next_filename() to return
> INT_MAX

Um, I think you broke my patch.  Assume that every save file before
INT_MAX already exists.  What I sent made it possible for
get_next_filename() to return name.INT_MAX if there was not already a save
file by that name.  Your patch makes it return name.INT_MAX if there is
already such a file, and not otherwise!  I have changed things back.



Also, I added a fix for the seg fault I pointed out on 13-Mar at 11:54
EST, about cutting the first line of a file when in multibuffer mode,
closing the file, then uncutting in another buffer.  The fix is different
from the one I sent before, and better.  It turns out the only place the
fileage needs to be syncronized is in files.c:close_open_file(), just
*before* the call to open_nextfile().


I also added the change to global.c:shortcut_init, allowing ENABLE_BUFFER
to coexist with NANO_SMALL.  I included the changes to configure.ac that
DLR sent.  Also, I made configure.ac define NDEBUG, to turn off assert
testing.  [I haven't tested either of these configure.ac changes.]


Finally, I fixed a typo in nano.1 and nano.1.html.


By the way, this patch includes all patches I have sent before that have
not been applied.  So the previous ones can be ignored.

Attachment: 31mar-DLR.diff
Description: Text document

Attachment: 31mar16:50.diff.bz2
Description: BZip2 compressed data


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]