summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJan H. Schönherr <schnhrr@cs.tu-berlin.de>2012-10-18 14:43:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-10-18 21:23:34 (GMT)
commit0fcec2ce5467740eb613da6a977deca3e7e866ba (patch)
tree3a0b51bfe88f482780fca5ba5689e0bde40f3bb0 /git-compat-util.h
parentf9b7204b6d10a1429271fde8cbcdee56beb0e035 (diff)
downloadgit-0fcec2ce5467740eb613da6a977deca3e7e866ba.zip
git-0fcec2ce5467740eb613da6a977deca3e7e866ba.tar.gz
git-0fcec2ce5467740eb613da6a977deca3e7e866ba.tar.bz2
format-patch: make rfc2047 encoding more strict
RFC 2047 requires more characters to be encoded than it is currently done. Especially, RFC 2047 distinguishes between allowed remaining characters in encoded words in addresses (From, To, etc.) and other headers, such as Subject. Make add_rfc2047() and is_rfc2047_special() location dependent and include all non-allowed characters to hopefully be RFC 2047 conformant. This especially fixes a problem, where RFC 822 specials (e. g. ".") were left unencoded in addresses, which was solved with a non-standard-conforming workaround in the past (which is going to be removed in a follow-up patch). Signed-off-by: Jan H. Schönherr <schnhrr@cs.tu-berlin.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 5bd9ad7..f011a8d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -466,6 +466,7 @@ extern const char tolower_trans_tbl[256];
#undef isdigit
#undef isalpha
#undef isalnum
+#undef isprint
#undef islower
#undef isupper
#undef tolower
@@ -483,6 +484,7 @@ extern unsigned char sane_ctype[256];
#define isdigit(x) sane_istest(x,GIT_DIGIT)
#define isalpha(x) sane_istest(x,GIT_ALPHA)
#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
+#define isprint(x) ((x) >= 0x20 && (x) <= 0x7e)
#define islower(x) sane_iscase(x, 1)
#define isupper(x) sane_iscase(x, 0)
#define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL)