diff --git a/src/chars.c b/src/chars.c
index 506ad1d4bd0917337d8267864269591fe8d01a2d..ea80c2faf6960e8bdff1e8c76ea9a47416dff87c 100644
--- a/src/chars.c
+++ b/src/chars.c
@@ -753,6 +753,52 @@ size_t mbstrnlen(const char *s, size_t maxlen)
 }
 
 #ifndef DISABLE_JUSTIFY
+/* This function is equivalent to strchr() for multibyte strings. */
+char *mbstrchr(const char *s, char *c)
+{
+    assert(s != NULL && c != NULL);
+
+#ifdef ENABLE_UTF8
+    if (ISSET(USE_UTF8)) {
+	bool bad_c_mb = FALSE, bad_s_mb = FALSE;
+	char *s_mb = charalloc(MB_CUR_MAX);
+	const char *q = s;
+	wchar_t ws, wc;
+	int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
+
+	if (c_mb_len <= 0) {
+	    mbtowc(NULL, NULL, 0);
+	    wc = (unsigned char)*c;
+	    bad_c_mb = TRUE;
+	}
+
+	while (*s != '\0') {
+	    int s_mb_len = parse_mbchar(s, s_mb, NULL, NULL);
+
+	    if (mbtowc(&ws, s_mb, s_mb_len) <= 0) {
+		mbtowc(NULL, NULL, 0);
+		ws = (unsigned char)*s;
+		bad_s_mb = TRUE;
+	    }
+
+	    if (bad_s_mb == bad_c_mb && ws == wc)
+		break;
+
+	    s += s_mb_len;
+	    q += s_mb_len;
+	}
+
+	free(s_mb);
+
+	if (ws != wc)
+	    q = NULL;
+
+	return (char *)q;
+    } else
+#endif
+	return strchr(s, *c);
+}
+
 #ifdef ENABLE_NANORC
 /* Return TRUE if the string s contains one or more blank characters,
  * and FALSE otherwise. */
@@ -800,52 +846,6 @@ bool has_blank_mbchars(const char *s)
 	return has_blank_chars(s);
 }
 #endif /* ENABLE_NANORC */
-
-/* This function is equivalent to strchr() for multibyte strings. */
-char *mbstrchr(const char *s, char *c)
-{
-    assert(s != NULL && c != NULL);
-
-#ifdef ENABLE_UTF8
-    if (ISSET(USE_UTF8)) {
-	bool bad_c_mb = FALSE, bad_s_mb = FALSE;
-	char *s_mb = charalloc(MB_CUR_MAX);
-	const char *q = s;
-	wchar_t ws, wc;
-	int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
-
-	if (c_mb_len <= 0) {
-	    mbtowc(NULL, NULL, 0);
-	    wc = (unsigned char)*c;
-	    bad_c_mb = TRUE;
-	}
-
-	while (*s != '\0') {
-	    int s_mb_len = parse_mbchar(s, s_mb, NULL, NULL);
-
-	    if (mbtowc(&ws, s_mb, s_mb_len) <= 0) {
-		mbtowc(NULL, NULL, 0);
-		ws = (unsigned char)*s;
-		bad_s_mb = TRUE;
-	    }
-
-	    if (bad_s_mb == bad_c_mb && ws == wc)
-		break;
-
-	    s += s_mb_len;
-	    q += s_mb_len;
-	}
-
-	free(s_mb);
-
-	if (ws != wc)
-	    q = NULL;
-
-	return (char *)q;
-    } else
-#endif
-	return strchr(s, *c);
-}
 #endif /* !DISABLE_JUSTIFY */
 
 #ifdef ENABLE_NANORC
diff --git a/src/proto.h b/src/proto.h
index 1adbdfdecdbe84b8e35274bea0e46729ce909a77..ad44218901902e73968eda7576b3636a667b4f79 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -197,11 +197,11 @@ size_t nstrnlen(const char *s, size_t maxlen);
 #endif
 size_t mbstrnlen(const char *s, size_t maxlen);
 #ifndef DISABLE_JUSTIFY
+char *mbstrchr(const char *s, char *c);
 #ifdef ENABLE_NANORC
 bool has_blank_chars(const char *s);
 bool has_blank_mbchars(const char *s);
 #endif
-char *mbstrchr(const char *s, char *c);
 #endif
 #ifdef ENABLE_NANORC
 bool is_valid_mbstring(const char *s);