summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2007-06-02 12:05:08 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2007-06-02 12:05:08 -0700
commit86eff8c512b96ce3ee0ae5818edfa035b98cdf08 (patch)
tree0d562bf2e10356ca6b085787dd726c430e680436 /commit.c
parentFix git-am(1) synopsis formatting (diff)
parentUse =20 when rfc2047 encoding spaces. (diff)
downloadtgif-86eff8c512b96ce3ee0ae5818edfa035b98cdf08.tar.xz
Merge branch 'maint'
* maint: Use =20 when rfc2047 encoding spaces. Create a new manpage for the gitignore format, and reference it elsewhere Documentation: robustify asciidoc GIT_VERSION replacement
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/commit.c b/commit.c
index bee066fa32..5632e32685 100644
--- a/commit.c
+++ b/commit.c
@@ -511,12 +511,16 @@ static int add_rfc2047(char *buf, const char *line, int len,
bp += i;
for (i = 0; i < len; i++) {
unsigned ch = line[i] & 0xFF;
- if (is_rfc2047_special(ch)) {
+ /*
+ * We encode ' ' using '=20' even though rfc2047
+ * allows using '_' for readability. Unfortunately,
+ * many programs do not understand this and just
+ * leave the underscore in place.
+ */
+ if (is_rfc2047_special(ch) || ch == ' ') {
sprintf(bp, "=%02X", ch);
bp += 3;
}
- else if (ch == ' ')
- *bp++ = '_';
else
*bp++ = ch;
}