imap-send: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams
2018-02-14 10:59:43 -08:00
committed by Junio C Hamano
parent ee6e065351
commit 5925631597

View File

@ -1189,11 +1189,11 @@ bail:
*/ */
static void lf_to_crlf(struct strbuf *msg) static void lf_to_crlf(struct strbuf *msg)
{ {
char *new; char *new_msg;
size_t i, j; size_t i, j;
char lastc; char lastc;
/* First pass: tally, in j, the size of the new string: */ /* First pass: tally, in j, the size of the new_msg string: */
for (i = j = 0, lastc = '\0'; i < msg->len; i++) { for (i = j = 0, lastc = '\0'; i < msg->len; i++) {
if (msg->buf[i] == '\n' && lastc != '\r') if (msg->buf[i] == '\n' && lastc != '\r')
j++; /* a CR will need to be added here */ j++; /* a CR will need to be added here */
@ -1201,18 +1201,18 @@ static void lf_to_crlf(struct strbuf *msg)
j++; j++;
} }
new = xmallocz(j); new_msg = xmallocz(j);
/* /*
* Second pass: write the new string. Note that this loop is * Second pass: write the new_msg string. Note that this loop is
* otherwise identical to the first pass. * otherwise identical to the first pass.
*/ */
for (i = j = 0, lastc = '\0'; i < msg->len; i++) { for (i = j = 0, lastc = '\0'; i < msg->len; i++) {
if (msg->buf[i] == '\n' && lastc != '\r') if (msg->buf[i] == '\n' && lastc != '\r')
new[j++] = '\r'; new_msg[j++] = '\r';
lastc = new[j++] = msg->buf[i]; lastc = new_msg[j++] = msg->buf[i];
} }
strbuf_attach(msg, new, j, j + 1); strbuf_attach(msg, new_msg, j, j + 1);
} }
/* /*