aboutsummaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-16 04:13:18 -0700
committerJunio C Hamano <gitster@pobox.com>2009-08-16 04:13:18 -0700
commit228f9c9a9f66ca9c5b9adb2d2bffc19de25a8d85 (patch)
treecee1dddcf4af2135fbd6b8f8389523374f9f088b /pretty.c
parent14683af812ee0b19c416223287c6e330dbdc9ffc (diff)
parent0a7f448355f38b8a626ec3c120ad7118690897fe (diff)
downloadgit-228f9c9a9f66ca9c5b9adb2d2bffc19de25a8d85.tar.xz
Merge branch 'js/maint-cover-letter-non-ascii'
* js/maint-cover-letter-non-ascii: Correctly mark cover letters' encodings if they are not pure ASCII Expose the has_non_ascii() function
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index e5328dab5b..3b2ecdd20e 100644
--- a/pretty.c
+++ b/pretty.c
@@ -86,6 +86,18 @@ int non_ascii(int ch)
return !isascii(ch) || ch == '\033';
}
+int has_non_ascii(const char *s)
+{
+ int ch;
+ if (!s)
+ return 0;
+ while ((ch = *s++) != '\0') {
+ if (non_ascii(ch))
+ return 1;
+ }
+ return 0;
+}
+
static int is_rfc2047_special(char ch)
{
return (non_ascii(ch) || (ch == '=') || (ch == '?') || (ch == '_'));