diff --git a/ChangeLog b/ChangeLog
index 4f1989037907a96ba92fc3d831c1b8d9113283cb..26551145c79d0ec6e3bdae7192c0a8d84052d414 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -151,7 +151,7 @@ CVS code -
 	  get_totals(), and do_cursorpos(). (DLR)
 	- Overhaul the tab completion code, the file browser code, and
 	  related functions to increase efficiency and support multibyte
-	  characters.  New functions strrchrn() and is_dir(); changes to
+	  characters.  New function is_dir(); changes to
 	  get_full_path(), check_writable_directory(), safe_tempnam(),
 	  diralphasort(), username_tab_completion(),
 	  cwd_tab_completion(), input_tab(), tail(), striponedir(),
diff --git a/src/chars.c b/src/chars.c
index 64e568bccf54845ab86344fa33b2f7f738e98768..311208a960061bac630f1f4c13b2747c525a1bfa 100644
--- a/src/chars.c
+++ b/src/chars.c
@@ -591,7 +591,7 @@ const char *mbstrcasestr(const char *haystack, const char *needle)
 #endif
 }
 
-#ifndef NANO_SMALL
+#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
 /* This function is equivalent to strstr(), except in that it scans the
  * string in reverse, starting at rev_start. */
 const char *revstrstr(const char *haystack, const char *needle, const
@@ -611,7 +611,9 @@ const char *revstrstr(const char *haystack, const char *needle, const
 
     return NULL;
 }
+#endif
 
+#ifndef NANO_SMALL
 /* This function is equivalent to strcasestr(), except in that it scans
  * the string in reverse, starting at rev_start. */
 const char *revstrcasestr(const char *haystack, const char *needle,
@@ -750,19 +752,3 @@ size_t mbstrnlen(const char *s, size_t maxlen)
 		nstrnlen(s, maxlen);
 #endif
 }
-
-#ifndef DISABLE_TABCOMP
-/* Find the one-based position of the last occurrence of character c in
- * the first n characters of s.  Return 0 if c is not found. */
-size_t strrchrn(const char *s, int c, size_t n)
-{
-    assert(n <= strlen(s));
-
-    for (s += n - 1; n >= 1; n--, s--) {
-	if (c == *s)
-	    return n;
-    }
-
-    return 0;
-}
-#endif
diff --git a/src/files.c b/src/files.c
index 96d8ab5ce5c6a720cefe4c61250146f4dc139d76..a80249cc8cf13db2b4c7dd3d42ce645776ce82b2 100644
--- a/src/files.c
+++ b/src/files.c
@@ -2157,8 +2157,10 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list)
 	beep();
     else {
 	size_t match, common_len = 0;
-	size_t lastslash = strrchrn(buf, '/', *place);
 	char *mzero;
+	const char *lastslash = revstrstr(buf, "/", buf + *place);
+	size_t lastslash_len = (lastslash == NULL) ? 0 :
+		lastslash - buf + 1;
 
 	while (TRUE) {
 	    for (match = 1; match < num_matches; match++) {
@@ -2173,11 +2175,11 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list)
 	    common_len++;
 	}
 
-	mzero = charalloc(lastslash + common_len + 1);
-	sprintf(mzero, "%.*s%.*s", lastslash, buf, common_len,
+	mzero = charalloc(lastslash_len + common_len + 1);
+	sprintf(mzero, "%.*s%.*s", lastslash_len, buf, common_len,
 		matches[0]);
 
-	common_len += lastslash;
+	common_len += lastslash_len;
 
 	assert(common_len >= *place);
 
diff --git a/src/global.c b/src/global.c
index 7d5ce48f23a1a91cd8081905b28ac5629de8fe37..54556f78887564e637615a6749aa9fa54f278599 100644
--- a/src/global.c
+++ b/src/global.c
@@ -356,7 +356,7 @@ void shortcut_init(bool unjustify)
     const char *nano_backup_msg = N_("Back up original file when saving");
     const char *nano_execute_msg = N_("Execute external command");
 #endif
-#if defined(ENABLE_MULTIBUFFER) && !defined(NANO_SMALL)
+#if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
     const char *nano_multibuffer_msg = N_("Insert into new buffer");
 #endif
 #ifndef DISABLE_BROWSER
diff --git a/src/proto.h b/src/proto.h
index b7897cd3bf9d506ca19b04c2332680b7c5b7fa47..7618c12db4dc29416a5cba0e775d705bcfb58023 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -203,9 +203,6 @@ size_t mbstrlen(const char *s);
 size_t nstrnlen(const char *s, size_t maxlen);
 #endif
 size_t mbstrnlen(const char *s, size_t maxlen);
-#ifndef DISABLE_TABCOMP
-size_t strrchrn(const char *s, int c, size_t n);
-#endif
 
 /* Public functions in color.c. */
 #ifdef ENABLE_COLOR
diff --git a/src/utils.c b/src/utils.c
index 7739cec126a4c5685e3c9fe356653c49a60169e0..cf0bed4ba9537a797c678edc36f775879ab72425 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -249,7 +249,7 @@ const char *strstrwrapper(const char *haystack, const char *needle,
 	return NULL;
     }
 #endif /* HAVE_REGEX_H */
-#if !defined(DISABLE_SPELLER) || !defined(NANO_SMALL)
+#if !defined(NANO_SMALL) || !defined(DISABLE_SPELLER)
     if (ISSET(CASE_SENSITIVE)) {
 #ifndef NANO_SMALL
 	if (ISSET(REVERSE_SEARCH))
diff --git a/src/winio.c b/src/winio.c
index b976000ba87e48023487a7ed904f1b3c37729af1..131505de4b7a7c909e62b74cd69d62ac904787ab 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -3026,7 +3026,7 @@ void reset_cursor(void)
 void edit_add(const filestruct *fileptr, const char *converted, int
 	yval, size_t start)
 {
-#if defined(ENABLE_COLOR) || !defined(NANO_SMALL)
+#if !defined(NANO_SMALL) || defined(ENABLE_COLOR)
     size_t startpos = actual_x(fileptr->data, start);
 	/* The position in fileptr->data of the leftmost character
 	 * that displays at least partially on the window. */