<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/utf8.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-09T23:57:24Z</updated>
<entry>
<title>cleanup: fix possible overflow errors in binary search</title>
<updated>2017-10-09T23:57:24Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2017-10-08T18:29:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19716b21a4255ecc7148b54ab2c78039c59f25bf'/>
<id>urn:sha1:19716b21a4255ecc7148b54ab2c78039c59f25bf</id>
<content type='text'>
A common mistake when writing binary search is to allow possible
integer overflow by using the simple average:

	mid = (min + max) / 2;

Instead, use the overflow-safe version:

	mid = min + (max - min) / 2;

This translation is safe since the operation occurs inside a loop
conditioned on "min &lt; max". The included changes were found using
the following git grep:

	git grep '/ *2;' '*.c'

Making this cleanup will prevent future review friction when a new
binary search is contructed based on existing code.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8: release strbuf on error return in strbuf_utf8_replace()</title>
<updated>2017-09-06T23:49:28Z</updated>
<author>
<name>Rene Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-08-30T18:20:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a012bf32a3b21648ab96f2bd234a563c22e0ae7'/>
<id>urn:sha1:9a012bf32a3b21648ab96f2bd234a563c22e0ae7</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8: accept "latin-1" as ISO-8859-1</title>
<updated>2016-09-27T01:16:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-27T01:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df3755888b9a54e69ab70881738d431587c57951'/>
<id>urn:sha1:df3755888b9a54e69ab70881738d431587c57951</id>
<content type='text'>
Even though latin-1 is still seen in e-mail headers, some platforms
only install ISO-8859-1.  "iconv -f ISO-8859-1" succeeds, while
"iconv -f latin-1" fails on such a system.

Using the same fallback_encoding() mechanism factored out in the
previous step, teach ourselves that "ISO-8859-1" has a better chance
of being accepted than "latin-1".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8: refactor code to decide fallback encoding</title>
<updated>2016-09-27T01:16:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-27T01:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3270741ea8c2a225183d272bf19ea19d5b3c05d8'/>
<id>urn:sha1:3270741ea8c2a225183d272bf19ea19d5b3c05d8</id>
<content type='text'>
The codepath we use to call iconv_open() has a provision to use a
fallback encoding when it fails, hoping that "UTF-8" being spelled
differently could be the reason why the library function did not
like the encoding names we gave it.  Essentially, we turn what we
have observed to be used as variants of "UTF-8" (e.g. "utf8") into
the most official spelling and use that as a fallback.

We do the same thing for input and output encoding.  Introduce a
helper function to do just one side and call that twice.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8: add function to align a string into given strbuf</title>
<updated>2015-09-17T17:02:48Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-09-10T15:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=110dcda50d5ddaf3557666eea3b012a6ccc74dce'/>
<id>urn:sha1:110dcda50d5ddaf3557666eea3b012a6ccc74dce</id>
<content type='text'>
Add strbuf_utf8_align() which will align a given string into a strbuf
as per given align_type and width. If the width is greater than the
string length then no alignment is performed.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Matthieu Moy &lt;matthieu.moy@grenoble-inp.fr&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8-bom: introduce skip_utf8_bom() helper</title>
<updated>2015-04-16T18:35:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-04-16T17:45:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dde843e7378f65004415bd108038659de9ce2abd'/>
<id>urn:sha1:dde843e7378f65004415bd108038659de9ce2abd</id>
<content type='text'>
With the recent change to ignore the UTF8 BOM at the beginning of
.gitignore files, we now have two codepaths that do such a skipping
(the other one is for reading the configuration files).

Introduce utf8_bom[] constant string and skip_utf8_bom() helper
and teach .gitignore code how to use it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint-2.1' into maint</title>
<updated>2015-01-07T21:28:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7ba46269a04de20032bd2dd614be6290cd65caab'/>
<id>urn:sha1:7ba46269a04de20032bd2dd614be6290cd65caab</id>
<content type='text'>
* maint-2.1:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
<entry>
<title>Merge branch 'maint-2.0' into maint-2.1</title>
<updated>2015-01-07T21:27:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c84ac86fc896c108b789b8eb26b169cc0e8088a'/>
<id>urn:sha1:3c84ac86fc896c108b789b8eb26b169cc0e8088a</id>
<content type='text'>
* maint-2.0:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.9' into maint-2.0</title>
<updated>2015-01-07T21:27:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=282616c72d1d08a77ca4fe1186cb708c38408d87'/>
<id>urn:sha1:282616c72d1d08a77ca4fe1186cb708c38408d87</id>
<content type='text'>
* maint-1.9:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.8.5' into maint-1.9</title>
<updated>2015-01-07T21:27:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-07T21:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64a03e970ab3ef0ce45d6bd3c1de1bff1de2beee'/>
<id>urn:sha1:64a03e970ab3ef0ce45d6bd3c1de1bff1de2beee</id>
<content type='text'>
* maint-1.8.5:
  is_hfs_dotgit: loosen over-eager match of \u{..47}
</content>
</entry>
</feed>
