diff --git a/ChangeLog b/ChangeLog
index 0b227a00893e591f510771a83c50f687e3b12c49..f13f9a792d8b1096082b426b4009b1f3528e3965 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,29 @@
 CVS code -
+- General:
+	- Minor comment cleanups. (DLR)
+- files.c:
+  add_open_file()
+	- Rearrange the NANO_SMALL #ifdef so that the code to set the
+	  MODIFIED flag in open_files->flags is included only once.
+	  (DLR)
+- search.c:
+  not_found_msg()
+	- Convert to properly handle strings generated by
+	  display_string() that have been used in the search prompt
+	  since 1.3.0. (David Benbennick)
+  do_replace_loop()
+	- Convert more ints used as boolean values to use TRUE and
+	  FALSE. (David Benbennick)
+- utils.c:
+  nstricmp(), nstrnicmp()
+	- Add extra blank lines for greater readability, and remove
+	  unneeded test for n's being less than zero (since it's already
+	  been tested for being greater than zero or equal to zero at
+	  that point) from nstrnicmp(). (DLR)
+  stristr()
+	- Rename to nstristr() to avoid a potential conflict with an
+	  existing stristr() function, and move up to just after
+	  nstrnicmp(). (DLR)  David Benbennick: Tweak for efficiency.
 
 GNU nano 1.3.2 - 2004.03.31
 - General:
diff --git a/src/files.c b/src/files.c
index eb2adfc89ed0914ac658efe8103a5f4dfffa5b2b..b534d22a97006f9a304a38002b4185f4bce3c2ce 100644
--- a/src/files.c
+++ b/src/files.c
@@ -785,17 +785,14 @@ int add_open_file(int update)
     /* if we're updating, save current modification status (and marking
        status, if available) */
     if (update) {
-#ifndef NANO_SMALL
 	if (ISSET(MODIFIED))
 	    open_files->file_flags |= MODIFIED;
+#ifndef NANO_SMALL
 	if (ISSET(MARK_ISSET)) {
 	    open_files->file_mark_beginbuf = mark_beginbuf;
 	    open_files->file_mark_beginx = mark_beginx;
 	    open_files->file_flags |= MARK_ISSET;
 	}
-#else
-	if (ISSET(MODIFIED))
-	    open_files->file_flags |= MODIFIED;
 #endif
     }
 
diff --git a/src/nano.c b/src/nano.c
index 3b1c1eb6b928c8c91ce61816d8e4285d10d9afdf..7174462c920008c4ad135903173c7ee6e29440bc 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -125,7 +125,7 @@ void die(const char *msg, ...)
 
 	while (open_files->next != NULL) {
 
-	    /* if we already saved the file above (i. e. if it was the
+	    /* if we already saved the file above (i.e, if it was the
 	       currently loaded file), don't save it again */
 	    if (tmp != open_files) {
 		/* make sure open_files->fileage and fileage, and
diff --git a/src/nano.h b/src/nano.h
index 2649ed3f27e187465c20c66fbf21966c17257514..0d259a52005ef76d2208a8a8aa11dccf86fe9001 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -91,7 +91,7 @@
 # endif
 #endif
 
-/* If no strcasecmp()/strncasecmp(), use the versions we have. */
+/* If no strcasecmp() or strncasecmp(), use the versions we have. */
 #ifndef HAVE_STRCASECMP
 #define strcasecmp nstricmp
 #endif
diff --git a/src/proto.h b/src/proto.h
index 70556739e7a767465e490e36cd197a4dc040103b..53817ed3a4b717d5aa192759e4d301df21031340 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -428,13 +428,13 @@ int nstricmp(const char *s1, const char *s2);
 #ifndef HAVE_STRNCASECMP
 int nstrnicmp(const char *s1, const char *s2, size_t n);
 #endif
+const char *nstristr(const char *haystack, const char *needle);
 #ifndef NANO_SMALL
-const char *revstrstr(const char *haystack, const char *needle,
-			const char *rev_start);
-const char *revstristr(const char *haystack, const char *needle,
-			const char *rev_start);
+const char *revstrstr(const char *haystack, const char *needle, const
+	char *rev_start);
+const char *revstristr(const char *haystack, const char *needle, const
+	char *rev_start);
 #endif
-const char *stristr(const char *haystack, const char *needle);
 const char *strstrwrapper(const char *haystack, const char *needle,
 	const char *start);
 void nperror(const char *s);
diff --git a/src/rcfile.c b/src/rcfile.c
index 5749c28887698f33025fca7c84cba170f5d0fac6..43c204f1bd319dfa6b235c4881d0744d57dfaba5 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -326,7 +326,7 @@ void parse_syntax(char *ptr)
 	ptr = parse_next_regex(ptr);
 
 	newext = (exttype *)nmalloc(sizeof(exttype));
-	if (nregcomp(&newext->val, fileregptr, REG_NOSUB))
+	if (nregcomp(&newext->val, fileregptr, REG_NOSUB) != 0)
 	    free(newext);
 	else {
 	    if (endext == NULL)
@@ -413,7 +413,7 @@ void parse_colors(char *ptr)
 	newcolor = (colortype *)nmalloc(sizeof(colortype));
 	fgstr = ptr;
 	ptr = parse_next_regex(ptr);
-	if (nregcomp(&newcolor->start, fgstr, 0)) {
+	if (nregcomp(&newcolor->start, fgstr, 0) != 0) {
 	    free(newcolor);
 	    cancelled = 1;
 	} else {
@@ -464,7 +464,7 @@ void parse_colors(char *ptr)
 	    if (cancelled)
 		continue;
 	    newcolor->end = (regex_t *)nmalloc(sizeof(regex_t));
-	    if (nregcomp(newcolor->end, fgstr, 0)) {
+	    if (nregcomp(newcolor->end, fgstr, 0) != 0) {
 		free(newcolor->end);
 		newcolor->end = NULL;
 	    }
diff --git a/src/search.c b/src/search.c
index 7575d584e7e93b65754cc43655bb756211875fd7..03d30e06d7f6ba0d16d7a0f40004d9f83b2d8fd3 100644
--- a/src/search.c
+++ b/src/search.c
@@ -56,15 +56,11 @@ void regexp_cleanup(void)
 
 void not_found_msg(const char *str)
 {
-    if (strlen(str) <= COLS / 2)
-	statusbar(_("\"%s\" not found"), str);
-    else {
-	char *foo = mallocstrcpy(NULL, str);
-
-	foo[COLS / 2] = '\0';
-	statusbar(_("\"%s...\" not found"), foo);
-	free(foo);
-    }
+    int numchars = actual_x(str, COLS / 2);
+
+    assert(str != NULL);
+    statusbar(_("\"%.*s%s\" not found"), numchars, str, str[numchars] ==
+	'\0' ? "" : "...");
 }
 
 void search_abort(void)
@@ -580,7 +576,7 @@ int do_replace_loop(const char *needle, const filestruct *real_current,
     size_t current_x_save = current_x;
 #ifdef HAVE_REGEX_H
     /* The starting-line match and bol/eol regex flags. */
-    int begin_line = 0, bol_or_eol = 0;
+    int begin_line = FALSE, bol_or_eol = FALSE;
 #endif
 #ifndef NANO_SMALL
     int mark_set = ISSET(MARK_ISSET);
@@ -617,8 +613,8 @@ int do_replace_loop(const char *needle, const filestruct *real_current,
 	 * continue. */
 	else {
 	    if (current == real_current)
-		begin_line = 1;
-	    bol_or_eol = 0;
+		begin_line = TRUE;
+	    bol_or_eol = FALSE;
 	}
 #endif
 
@@ -660,7 +656,7 @@ int do_replace_loop(const char *needle, const filestruct *real_current,
 	 * replace ("^", "$", or "^$"). */
 	if (ISSET(USE_REGEXP) && regexp_bol_or_eol(&search_regexp,
 		needle))
-	    bol_or_eol = 1;
+	    bol_or_eol = TRUE;
 #endif
 
 	if (i > 0 || replaceall) {	/* Yes, replace it!!!! */
diff --git a/src/utils.c b/src/utils.c
index 5110fdb1ebe886f0992e809ebce09595b5af7c13..da414305c451240acab8b5fd0a297db4c6028179 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -116,10 +116,12 @@ void sunder(char *str)
 int nstricmp(const char *s1, const char *s2)
 {
     assert(s1 != NULL && s2 != NULL);
+
     for (; *s1 != '\0' && *s2 != '\0'; s1++, s2++) {
 	if (tolower(*s1) != tolower(*s2))
 	    break;
     }
+
     return (tolower(*s1) - tolower(*s2));
 }
 #endif
@@ -129,23 +131,45 @@ int nstricmp(const char *s1, const char *s2)
 int nstrnicmp(const char *s1, const char *s2, size_t n)
 {
     assert(s1 != NULL && s2 != NULL);
+
     for (; n > 0 && *s1 != '\0' && *s2 != '\0'; n--, s1++, s2++) {
 	if (tolower(*s1) != tolower(*s2))
 	    break;
     }
+
     if (n > 0)
 	return (tolower(*s1) - tolower(*s2));
     else if (n == 0)
 	return 0;
-    else if (n < 0)
+    else
 	return -1;
 }
 #endif
 
+/* This function is equivalent to strcasestr().  It was adapted from
+ * mutt's mutt_stristr() function. */
+const char *nstristr(const char *haystack, const char *needle)
+{
+    assert(haystack != NULL && needle != NULL);
+
+    for (; *haystack != '\0'; haystack++) {
+	const char *p = haystack;
+	const char *q = needle;
+
+	for (; tolower(*p) == tolower(*q) && *q != '\0'; p++, q++)
+	    ;
+
+	if (*q == '\0')
+	    return haystack;
+    }
+
+    return NULL;
+}
+
 /* None of this is needed if we're using NANO_SMALL! */
 #ifndef NANO_SMALL
-const char *revstrstr(const char *haystack, const char *needle,
-			const char *rev_start)
+const char *revstrstr(const char *haystack, const char *needle, const
+	char *rev_start)
 {
     for (; rev_start >= haystack; rev_start--) {
 	const char *r, *q;
@@ -158,8 +182,8 @@ const char *revstrstr(const char *haystack, const char *needle,
     return NULL;
 }
 
-const char *revstristr(const char *haystack, const char *needle,
-			const char *rev_start)
+const char *revstristr(const char *haystack, const char *needle, const
+	char *rev_start)
 {
     for (; rev_start >= haystack; rev_start--) {
 	const char *r = rev_start, *q = needle;
@@ -173,27 +197,6 @@ const char *revstristr(const char *haystack, const char *needle,
 }
 #endif /* !NANO_SMALL */
 
-/* This is now mutt's version (called mutt_stristr) because it doesn't
- * use memory allocation to do a simple search (yuck). */
-const char *stristr(const char *haystack, const char *needle)
-{
-    const char *p, *q;
-
-    if (haystack == NULL)
-	return NULL;
-    if (needle == NULL)
-	return haystack;
-    
-    while (*(p = haystack) != '\0') {
-	for (q = needle; *p != 0 && *q != 0 && tolower(*p) == tolower(*q); p++, q++)
-	    ;
-	if (*q == 0)
-	    return haystack;
-	haystack++;
-    }
-    return NULL;
-}
-
 /* If we are searching backwards, we will find the last match that
  * starts no later than start.  Otherwise we find the first match
  * starting no earlier than start.  If we are doing a regexp search, we
@@ -253,7 +256,7 @@ const char *strstrwrapper(const char *haystack, const char *needle,
     else if (ISSET(REVERSE_SEARCH))
 	return revstristr(haystack, needle, start);
 #endif
-    return stristr(start, needle);
+    return nstristr(start, needle);
 }
 
 /* This is a wrapper for the perror() function.  The wrapper takes care
diff --git a/src/winio.c b/src/winio.c
index d42521862d233c8762cf7ab7e6093d766ee21283..27317dc1ce8796ade7a1ff1bf5524b359b2ea3ef 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -905,7 +905,7 @@ size_t actual_x(const char *str, size_t xplus)
     return i;
 }
 
-/* A strlen with tabs factored in, similar to xplustabs().  How many
+/* A strlen() with tabs factored in, similar to xplustabs().  How many
  * columns wide are the first size characters of buf? */
 size_t strnlenpt(const char *buf, size_t size)
 {