diff options
| author | Junio C Hamano <gitster@pobox.com> | 2009-08-16 04:13:18 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2009-08-16 04:13:18 -0700 |
| commit | 228f9c9a9f66ca9c5b9adb2d2bffc19de25a8d85 (patch) | |
| tree | cee1dddcf4af2135fbd6b8f8389523374f9f088b /pretty.c | |
| parent | 14683af812ee0b19c416223287c6e330dbdc9ffc (diff) | |
| parent | 0a7f448355f38b8a626ec3c120ad7118690897fe (diff) | |
| download | git-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.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 == '_')); |
