summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5dc36a5)
raw | patch | inline | side by side (parent: 5dc36a5)
author | Johannes Schindelin <johannes.schindelin@gmx.de> | |
Mon, 10 Aug 2009 16:22:18 +0000 (18:22 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 10 Aug 2009 21:39:39 +0000 (14:39 -0700) |
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>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.h | patch | blob | history | |
log-tree.c | patch | blob | history | |
pretty.c | patch | blob | history |
diff --git a/commit.h b/commit.h
index ba9f63813eba004ae409eba8741266a074161239..4886544b631bd6b79ad8410fa369e41975c0ff23 100644 (file)
--- a/commit.h
+++ b/commit.h
};
extern int non_ascii(int);
+extern int has_non_ascii(const char *text);
struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
extern char *reencode_commit_message(const struct commit *commit,
const char **encoding_p);
diff --git a/log-tree.c b/log-tree.c
index 6f73c17d74bee326a40505b29bba762bade2451e..a3b4c0692c6a46a0642cf1cb42e60eee59110d60 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
return result;
}
-static 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;
-}
-
void get_patch_filename(struct commit *commit, int nr, const char *suffix,
struct strbuf *buf)
{
diff --git a/pretty.c b/pretty.c
index e5328dab5b2978d90d20f47ed799782e7b2fb63b..3b2ecdd20e6f5bdca61ee5e605deac7b8239c70d 100644 (file)
--- a/pretty.c
+++ b/pretty.c
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 == '_'));