diff src/misc2.c @ 3257:75217982ea46 v7.3.397

updated for version 7.3.397 Problem: ":helpgrep" does not work properly when 'encoding' is not utf-8 or latin1. Solution: Convert non-ascii lines to 'encoding'. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Tue, 10 Jan 2012 16:28:45 +0100
parents e757e1127d21
children 320cc46d0eb0
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -6541,3 +6541,23 @@ put_time(fd, the_time)
 #endif
 
 #endif
+
+#if (defined(FEAT_MBYTE) && defined(FEAT_QUICKFIX)) \
+	|| defined(FEAT_SPELL) || defined(PROTO)
+/*
+ * Return TRUE if string "s" contains a non-ASCII character (128 or higher).
+ * When "s" is NULL FALSE is returned.
+ */
+    int
+has_non_ascii(s)
+    char_u	*s;
+{
+    char_u	*p;
+
+    if (s != NULL)
+	for (p = s; *p != NUL; ++p)
+	    if (*p >= 128)
+		return TRUE;
+    return FALSE;
+}
+#endif