findnextstr() - Fixed check for string that only occurs on the same line failing

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@189 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2000-08-30 13:49:33 +00:00
parent 340d6e50c2
commit 9babaf3b38
3 changed files with 19 additions and 22 deletions

View File

@ -18,6 +18,8 @@ CVS Code
ugliness bug (reported by Ken Tyler). ugliness bug (reported by Ken Tyler).
findnextstr(): findnextstr():
- Added reset for placewewant (Ben Roberts). - Added reset for placewewant (Ben Roberts).
- Fixed check for string that only occurs on the same line failing
(discovered by Ken Tyler).
nano-0.9.16 - 08/09/2000 nano-0.9.16 - 08/09/2000
- cut.c: - cut.c:

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-08-28 23:58-0400\n" "POT-Creation-Date: 2000-08-30 09:55-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -32,7 +32,7 @@ msgstr ""
msgid "Read %d lines" msgid "Read %d lines"
msgstr "" msgstr ""
#: files.c:217 search.c:174 search.c:192 #: files.c:217 search.c:174
#, c-format #, c-format
msgid "\"%s\" not found" msgid "\"%s\" not found"
msgstr "" msgstr ""
@ -691,47 +691,47 @@ msgstr ""
msgid "Search Wrapped" msgid "Search Wrapped"
msgstr "" msgstr ""
#: search.c:244 #: search.c:239
#, c-format #, c-format
msgid "Replaced %d occurences" msgid "Replaced %d occurences"
msgstr "" msgstr ""
#: search.c:246 #: search.c:241
msgid "Replaced 1 occurence" msgid "Replaced 1 occurence"
msgstr "" msgstr ""
#: search.c:381 search.c:402 search.c:425 #: search.c:376 search.c:397 search.c:420
msgid "Replace Cancelled" msgid "Replace Cancelled"
msgstr "" msgstr ""
#: search.c:398 #: search.c:393
#, c-format #, c-format
msgid "Replace with [%s]" msgid "Replace with [%s]"
msgstr "" msgstr ""
#. last_search is empty #. last_search is empty
#: search.c:423 #: search.c:418
msgid "Replace with" msgid "Replace with"
msgstr "" msgstr ""
#: search.c:464 #: search.c:459
msgid "Replace this instance?" msgid "Replace this instance?"
msgstr "" msgstr ""
#. Ask for it #. Ask for it
#: search.c:515 #: search.c:510
msgid "Enter line number" msgid "Enter line number"
msgstr "" msgstr ""
#: search.c:517 #: search.c:512
msgid "Aborted" msgid "Aborted"
msgstr "" msgstr ""
#: search.c:537 #: search.c:532
msgid "Come on, be reasonable" msgid "Come on, be reasonable"
msgstr "" msgstr ""
#: search.c:542 #: search.c:537
#, c-format #, c-format
msgid "Only %d lines available, skipping to last line" msgid "Only %d lines available, skipping to last line"
msgstr "" msgstr ""

View File

@ -131,7 +131,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
char *searchstr, *found = NULL, *tmp; char *searchstr, *found = NULL, *tmp;
int past_editbot = 0; int past_editbot = 0;
fileptr = current; fileptr = begin;
searchstr = &current->data[current_x + 1]; searchstr = &current->data[current_x + 1];
/* Look for searchstr until EOF */ /* Look for searchstr until EOF */
@ -165,17 +165,17 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
fileptr = fileage; fileptr = fileage;
while (fileptr != current && fileptr != begin && while (fileptr != begin->next &&
(found = strstrwrapper(fileptr->data, needle)) == NULL) (found = strstrwrapper(fileptr->data, needle)) == NULL)
fileptr = fileptr->next; fileptr = fileptr->next;
if (fileptr == begin) { if (fileptr == begin->next) {
if (!quiet) if (!quiet)
statusbar(_("\"%s\" not found"), needle); statusbar(_("\"%s\" not found"), needle);
return NULL; return NULL;
} }
if (fileptr != current) { /* We found something */ else { /* We found something */
current = fileptr; current = fileptr;
current_x = 0; current_x = 0;
for (tmp = fileptr->data; tmp != found; tmp++) for (tmp = fileptr->data; tmp != found; tmp++)
@ -186,11 +186,6 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
if (!quiet) if (!quiet)
statusbar(_("Search Wrapped")); statusbar(_("Search Wrapped"));
} else { /* Nada */
if (!quiet)
statusbar(_("\"%s\" not found"), needle);
return NULL;
} }
} }