nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] yet another patch


From: David Lawrence Ramsey
Subject: [Nano-devel] yet another patch
Date: Thu, 16 Jan 2003 06:55:02 -0800 (PST)

The attached patch makes a few last cosmetic cleanups (put a Changelog
entry in the right place, change a few instances of "if (strcmp(x, ""))"
to "if (x[0] != 0)", put in a few needed references to NULL) and fixes
two minor bugs.  First, if the cursor is in the middle of a search
string and a search toggle is pressed, the cursor will now stay where it
was instead of moving to the end of the string.  Second, in one case the
last item in the history would be in the history twice at the bottom.
To reproduce this:

1. Make sure there is at least one word in the search history.

2. Go to the search prompt, scroll as far up as you can go, scroll as
far down as you can go, and then do both again (all without leaving the
search prompt).  The second time, scrolling down will stop on the last
string entered instead of on a blank string, and you'll need to press Up
twice to get to a different string.

The problem was in nanogetstr() where if there was no more history
available, the last string entered would be "regurgitated" (to quote
from the comment surrounding it).  nano would do that more than once
since currentbuf would not be NULL both before and after that point.  I
fixed it by free()ing currentbuf and setting it to NULL afterward; the
next time Up is pressed, it's restored anyway.


_____________________________________________________________
Sluggy.Net: The Sluggy Freelance Community!

_____________________________________________________________
Select your own custom email address for FREE! Get address@hidden w/No Ads, 
6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag

Attachment: nanominor.patch
Description: Binary data


reply via email to

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