Re: [Cgdb-devel] Patch: Searching & entering :ex commands
Brought to you by:
bobbybrasko,
crouchingturbo
From: Bob R. <bob...@co...> - 2008-05-28 13:49:20
|
On Tue, May 20, 2008 at 11:24:03PM -0400, Mike Mueller wrote: > Bob, > > When you get a chance, I'd like you to review the attached patch. > It does the following things: > > 1. Bug fix: If you start searching for something, but abort (hit ESC), > the regex_line variable was obliterated, so 'n' or 'N' no longer finds > the last searched regex. I renamed regex_line to regex_last, and > created a regex_cur for the currently-being-typed regex. Now if you > give up searching, you can still 'n' for the last searched string. Excellent bug fix. I did not a small bug in the new functionality however while testing it. Here is the test case I used, 39| long_func(); 40| 41| fprintf(stderr, "HAHAAHA\n"); 42| fprintf(stderr, "AHAAHA\n"); 43| fprintf(stderr, "HAAHA\n"); 44| fprintf(stderr, "AAHA\n"); put the cursor above line 39. - search for stderr. - hit 'n', 'n', 'n'. (now you should be on line 44) - reverse search for long_, and then hit <ESC> to cancel out - hit 'N', you end up on line 41, instead of 43. This bug only occurs if you do the reverse search step, otherwise it successfully takes you to line 43. Can you reproduce this? Do you mind fixing it? > 2. Bug fix: Start cgdb, hit ESC, start searching for something, hit ESC, > hit ':' and the status bar displays :(null). Fixed this. Whoa, nasty bug. That would certainly cause a crash on some system! Good find. > 3. Feature: If you are typing a :ex command or a regex search, and you > backspace when the command/regex is empty, the command or search is > aborted (like vim does). Excellent. > 4. Fixed a warning about casting pointer to int of different size > compiling on a 64-bit platform. > > I tried to test this well, but I wanted your input before I commit it. Other than that one use case I found, everything looks great. Bob Rossi |