summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-08-10 16:22:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-08-10 21:39:39 (GMT)
commit28e9cf6512cae1b50a2d2003bb59da4392d99e2e (patch)
tree7481792b7321e263437c6fe3650244db607de6ef /pretty.c
parent5dc36a5888a7063ff4536c9ea50eb0557bfef627 (diff)
downloadgit-28e9cf6512cae1b50a2d2003bb59da4392d99e2e.zip
git-28e9cf6512cae1b50a2d2003bb59da4392d99e2e.tar.gz
git-28e9cf6512cae1b50a2d2003bb59da4392d99e2e.tar.bz2
Expose the has_non_ascii() function
This function is useful outside of log-tree.c, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 e5328da..3b2ecdd 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 == '_'));