diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-06 14:54:07 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-06 14:54:07 -0800 |
commit | 169c9c0169a00876f699678ac66ebe9563b0c29f (patch) | |
tree | 5344fd15a9134aa92eaf79ff5959f616cceffa17 /imap-send.c | |
parent | Merge branch 'rs/strbuf-read-file-or-whine' (diff) | |
parent | replace: rename 'new' variables (diff) | |
download | tgif-169c9c0169a00876f699678ac66ebe9563b0c29f.tar.xz |
Merge branch 'bw/c-plus-plus'
Avoid using identifiers that clash with C++ keywords. Even though
it is not a goal to compile Git with C++ compilers, changes like
this help use of code analysis tools that targets C++ on our
codebase.
* bw/c-plus-plus: (37 commits)
replace: rename 'new' variables
trailer: rename 'template' variables
tempfile: rename 'template' variables
wrapper: rename 'template' variables
environment: rename 'namespace' variables
diff: rename 'template' variables
environment: rename 'template' variables
init-db: rename 'template' variables
unpack-trees: rename 'new' variables
trailer: rename 'new' variables
submodule: rename 'new' variables
split-index: rename 'new' variables
remote: rename 'new' variables
ref-filter: rename 'new' variables
read-cache: rename 'new' variables
line-log: rename 'new' variables
imap-send: rename 'new' variables
http: rename 'new' variables
entry: rename 'new' variables
diffcore-delta: rename 'new' variables
...
Diffstat (limited to 'imap-send.c')
-rw-r--r-- | imap-send.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/imap-send.c b/imap-send.c index 36c7c1b4f6..ffb0a6eca8 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1189,11 +1189,11 @@ bail: */ static void lf_to_crlf(struct strbuf *msg) { - char *new; + char *new_msg; size_t i, j; 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++) { if (msg->buf[i] == '\n' && lastc != '\r') j++; /* a CR will need to be added here */ @@ -1201,18 +1201,18 @@ static void lf_to_crlf(struct strbuf *msg) 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. */ for (i = j = 0, lastc = '\0'; i < msg->len; i++) { if (msg->buf[i] == '\n' && lastc != '\r') - new[j++] = '\r'; - lastc = new[j++] = msg->buf[i]; + new_msg[j++] = '\r'; + lastc = new_msg[j++] = msg->buf[i]; } - strbuf_attach(msg, new, j, j + 1); + strbuf_attach(msg, new_msg, j, j + 1); } /* |