summaryrefslogtreecommitdiff
path: root/ws.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-08-07 20:44:49 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-08-07 20:44:49 -0700
commit7ecc9b153c89aeec7470256f7b121fd845101b57 (patch)
tree0bf662b5dd1ffe642756f5cb168902a89b60506a /ws.c
parentverify-pack: migrate to parse-options (diff)
parentMerge branch 'maint-1.6.3' into maint (diff)
downloadtgif-7ecc9b153c89aeec7470256f7b121fd845101b57.tar.xz
Merge branch 'maint' into jc/verify-pack-stat
* maint: (95 commits) verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used gitweb/README: Document $base_url Documentation: git submodule: add missing options to synopsis Better usage string for reflog. hg-to-git: don't import the unused popen2 module send-email: remove debug trace config: Keep inner whitespace verbatim GIT 1.6.4 GIT 1.6.3.4 config.txt: document add.ignore-errors request-pull: allow ls-remote to notice remote.$nickname.uploadpack Update the documentation of the raw diff output format git-rerere.txt: Clarify ambiguity of the config variable t9143: do not fail if Compress::Zlib is missing Trivial path quoting fixes in git-instaweb GIT 1.6.4-rc3 Documentation/config.txt: a variable can be defined on the section header line git svn: make minimize URL more reliable over http(s) Disable asciidoc 8.4.1+ semantics for `{plus}` and friends ...
Diffstat (limited to 'ws.c')
-rw-r--r--ws.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ws.c b/ws.c
index 819c797cf6..59d0883c1f 100644
--- a/ws.c
+++ b/ws.c
@@ -261,12 +261,11 @@ int ws_fix_copy(char *dst, const char *src, int len, unsigned ws_rule, int *erro
/*
* Strip trailing whitespace
*/
- if ((ws_rule & WS_TRAILING_SPACE) &&
- (2 <= len && isspace(src[len-2]))) {
- if (src[len - 1] == '\n') {
+ if (ws_rule & WS_TRAILING_SPACE) {
+ if (0 < len && src[len - 1] == '\n') {
add_nl_to_tail = 1;
len--;
- if (1 < len && src[len - 1] == '\r') {
+ if (0 < len && src[len - 1] == '\r') {
add_cr_to_tail = !!(ws_rule & WS_CR_AT_EOL);
len--;
}