commit 74bb31b15a603b270eb3ad47d0ff4ab615eeba10
parent 94a78b8fb3ef45886349374b4c2001f42b2c771e
Author: Chris Allegretta <chrisa@asty.org>
Date: Wed, 14 Mar 2001 09:08:14 +0000
Fix BUG #56 found on SourceForge
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@559 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/BUGS b/BUGS
@@ -99,6 +99,8 @@
higuita@cadernoverde.com) (54) [FIXED].
- When using autoindent (-i), wrapped text does not get auto-indented
(55, discovered by Mark Senior) [FIXED].
+- When using -R (regex) and -p (pico mode), subsequent searches after
+ the first fail if no string is entered (56) [FIXED].
** Open BUGS **
diff --git a/ChangeLog b/ChangeLog
@@ -5,7 +5,11 @@ CVS code -
- Added SAMELINE case to above. Added checks to cases 1b and
2b for placement of cursor.
- search.c:
+ print_replaced()
- s/occurence/occurrence typos (Jordi).
+ search_init()
+ - If using Pico mode and regex and same answer is entered, use
+ last_search string instead of answer (fixes BUG #56).
- nano.texi:
- Meta-Z correction and grammar in --enable-tiny desc (Neil Parks).
diff --git a/search.c b/search.c
@@ -81,7 +81,6 @@ int search_init(int replacing)
buf = nmalloc(strlen(last_search) + 5);
buf[0] = 0;
-
/* Okay, fun time. backupstring is our holder for what is being
returned from the statusq call. Using answer for this would be tricky.
Here, if we're using PICO_MODE, we only want nano to put the
@@ -140,8 +139,14 @@ int search_init(int replacing)
return -1;
} else if (i == -2) { /* Same string */
#ifdef HAVE_REGEX_H
- if (ISSET(USE_REGEXP))
- regexp_init(answer);
+ if (ISSET(USE_REGEXP)) {
+
+ /* If we're in pico mode, answer is "", use last_search! */
+ if (ISSET(PICO_MODE))
+ regexp_init(last_search);
+ else
+ regexp_init(answer);
+ }
#else
;
#endif