<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/mailmap.c, branch v2.7.0-rc2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.7.0-rc2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.7.0-rc2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2015-09-25T17:18:18Z</updated>
<entry>
<title>mailmap: replace strcpy with xstrdup</title>
<updated>2015-09-25T17:18:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T21:07:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c978610dc841efe300bf4d1ee61b24d78b13c4f4'/>
<id>urn:sha1:c978610dc841efe300bf4d1ee61b24d78b13c4f4</id>
<content type='text'>
We want to make a copy of a string without any leading
whitespace. To do so, we allocate a buffer large enough to
hold the original, skip past the whitespace, then copy that.
It's much simpler to just allocate after we've skipped, in
which case we can just copy the remainder of the string,
leaving no question of whether "len" is large enough.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailmap: use higher level string list functions</title>
<updated>2014-12-04T23:10:21Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2014-11-25T03:44:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=63226218ba39e971c8a75d9419a7668b075ad85e'/>
<id>urn:sha1:63226218ba39e971c8a75d9419a7668b075ad85e</id>
<content type='text'>
No functional changes intended. This commit makes use of higher level
and better documented functions of the string list API, so the code is
more understandable.

Note that also the required computational amount should not change
in principal as we need to look up the item no matter if it is already
part of the list or not. Once looked up, insertion comes for free.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/strcasecmp-pure-inline'</title>
<updated>2013-09-25T06:28:13Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2013-09-25T06:28:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a301889980237b4d1cba9d07e48bdaf67064af83'/>
<id>urn:sha1:a301889980237b4d1cba9d07e48bdaf67064af83</id>
<content type='text'>
* jc/strcasecmp-pure-inline:
  mailmap: work around implementations with pure inline strcasecmp
</content>
</entry>
<entry>
<title>mailmap: work around implementations with pure inline strcasecmp</title>
<updated>2013-09-12T19:05:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-12T15:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=de2f95ebed260b5fb31942d6315994829fb6fc63'/>
<id>urn:sha1:de2f95ebed260b5fb31942d6315994829fb6fc63</id>
<content type='text'>
On some systems (e.g. MinGW 4.0), string.h has only inline
definition of strcasecmp and no non-inline implementation is
supplied anywhere, which is, eh, "unusual".  We cannot take an
address of such a function to store it in namemap.cmp.

Work it around by introducing our own level of indirection.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/mailmap-freeing-NULL-is-ok'</title>
<updated>2013-09-11T22:00:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-11T22:00:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e5229b6a61fefcacd63d11afd49f0cdafaa60801'/>
<id>urn:sha1:e5229b6a61fefcacd63d11afd49f0cdafaa60801</id>
<content type='text'>
* sb/mailmap-freeing-NULL-is-ok:
  mailmap: remove redundant check for freeing memory
</content>
</entry>
<entry>
<title>Merge branch 'jk/mailmap-incomplete-line'</title>
<updated>2013-09-09T21:50:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-09T21:50:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=af226bf01e99043f5f3d8bc09ad302d17e0de757'/>
<id>urn:sha1:af226bf01e99043f5f3d8bc09ad302d17e0de757</id>
<content type='text'>
* jk/mailmap-incomplete-line:
  mailmap: handle mailmap blobs without trailing newlines
</content>
</entry>
<entry>
<title>mailmap: handle mailmap blobs without trailing newlines</title>
<updated>2013-08-28T19:33:32Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-08-28T01:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f972a1658a30809db113a3c486b1fe95b56633bf'/>
<id>urn:sha1:f972a1658a30809db113a3c486b1fe95b56633bf</id>
<content type='text'>
The read_mailmap_buf function reads each line of the mailmap
using strchrnul, like:

    const char *end = strchrnul(buf, '\n');
    unsigned long linelen = end - buf + 1;

But that's off-by-one when we actually hit the NUL byte; our
line does not have a terminator, and so is only "end - buf"
bytes long. As a result, when we subtract the linelen from
the total len, we end up with (unsigned long)-1 bytes left
in the buffer, and we start reading random junk from memory.

We could fix it with:

    unsigned long linelen = end - buf + !!*end;

but let's take a step back for a moment. It's questionable
in the first place for a function that takes a buffer and
length to be using strchrnul. But it works because we only
have one caller (and are only likely to ever have this one),
which is handing us data from read_sha1_file. Which means
that it's always NUL-terminated.

Instead of tightening the assumptions to make the
buffer/length pair work for a caller that doesn't actually
exist, let's let loosen the assumptions to what the real
caller has: a modifiable, NUL-terminated string.

This makes the code simpler and shorter (because we don't
have to correlate strchrnul with the length calculation),
correct (because the code with the off-by-one just goes
away), and more efficient (we can drop the extra allocation
we needed to create NUL-terminated strings for each line,
and just terminate in place).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailmap: remove redundant check for freeing memory</title>
<updated>2013-08-20T17:10:37Z</updated>
<author>
<name>Stefan Beller</name>
<email>stefanbeller@googlemail.com</email>
</author>
<published>2013-08-20T14:18:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c9ba31f592ccf23dc2aa78a705a790341ea72cfd'/>
<id>urn:sha1:c9ba31f592ccf23dc2aa78a705a790341ea72cfd</id>
<content type='text'>
The condition as it is written in that line has already been checked
in the beginning of the function, which was introduced in
8503ee4 (2007-05-01, Fix read_mailmap to handle a caller uninterested
in repo abbreviation)

Helped-by: Jeff King &lt;peff@peff.net&gt;
Helped-by: Thomas Rast &lt;trast@inf.ethz.ch&gt;
Signed-off-by: Stefan Beller &lt;stefanbeller@googlemail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailmap: style fixes</title>
<updated>2013-07-15T15:23:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-07-15T06:54:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=bd23794552a9d344ddda9fac20d7ee9b7607f6b1'/>
<id>urn:sha1:bd23794552a9d344ddda9fac20d7ee9b7607f6b1</id>
<content type='text'>
Wrap overlong lines and format the multi-line comments to match our
coding style.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mailmap: debug: avoid passing NULL to fprintf() '%s' conversion specification</title>
<updated>2013-07-15T15:20:32Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2013-07-15T06:54:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=fbfba7ade0dde36d8911973b1dac248b81ce1375'/>
<id>urn:sha1:fbfba7ade0dde36d8911973b1dac248b81ce1375</id>
<content type='text'>
POSIX does not state the behavior of '%s' conversion when passed a
NULL pointer. Some implementations interpolate literal "(null)";
others may crash.

Callers of debug_mm() often pass NULL as indication of either a
missing name or email address.  Instead, let's always supply a
proper string pointer, and make it a bit more descriptive: "(none)"

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
