summaryrefslogtreecommitdiff
path: root/blob.h
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2013-01-15 09:06:32 +0100
committerJunio C Hamano <gitster@pobox.com>2013-01-15 14:50:23 -0800
commit3691031cb33922ce49448518aa06e33eded3368e (patch)
treed121fd0f000eddec28091fd7a9b0878a0e74b68b /blob.h
parent636fd66bc18d7563b9260485a9974da67a805514 (diff)
downloadgit-3691031cb33922ce49448518aa06e33eded3368e.tar.gz
imap-send.c: simplify logic in lf_to_crlf()
* The first character in the string used to be special-cased to get around the fact that msg->buf[i - 1] is not defined for i == 0. Instead, keep track of the previous character in a separate variable, "lastc", initialized in such a way to let the loop handle i == 0 correctly. * Make the two loops over the string look as similar as possible to make it more obvious that the count computed in the first pass agrees with the true length of the new string written in the second pass. As a side effect, this makes it possible to use the "j" counter in place of lfnum and new_len. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'blob.h')
0 files changed, 0 insertions, 0 deletions