<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/compat, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-06-05T00:03:15Z</updated>
<entry>
<title>Merge branch 'js/bs-is-a-dir-sep-on-windows' into maint</title>
<updated>2017-06-05T00:03:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-05T00:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6f80aee299f530c9565b520aa76e6ff2e5649bc'/>
<id>urn:sha1:e6f80aee299f530c9565b520aa76e6ff2e5649bc</id>
<content type='text'>
"foo\bar\baz" in "git fetch foo\bar\baz", even though there is no
slashes in it, cannot be a nickname for a remote on Windows, as
that is likely to be a pathname on a local filesystem.

* js/bs-is-a-dir-sep-on-windows:
  Windows: do not treat a path with backslashes as a remote's nick name
  mingw.h: permit arguments with side effects for is_dir_sep
</content>
</entry>
<entry>
<title>mingw.h: permit arguments with side effects for is_dir_sep</title>
<updated>2017-05-23T12:42:14Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2017-05-22T18:58:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e20b5b59099a960d59f20276ae37353870e714de'/>
<id>urn:sha1:e20b5b59099a960d59f20276ae37353870e714de</id>
<content type='text'>
Taking git-compat-util.h's cue (which uses an inline function to back
is_dir_sep()), let's use an inline function to back also the Windows
version of is_dir_sep(). This avoids problems when calling the function
with arguments that do more than just provide a single character, e.g.
incrementing a pointer. Example:

    is_dir_sep(*p++)

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>winansi: avoid buffer overrun</title>
<updated>2017-05-08T03:18:19Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-05-04T13:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6b066adf9e1e970a6d8295db630ab1e1f3bc71c'/>
<id>urn:sha1:b6b066adf9e1e970a6d8295db630ab1e1f3bc71c</id>
<content type='text'>
When we could not convert the UTF-8 sequence into Unicode for writing to
the Console, we should not try to write an insanely-long sequence of
invalid wide characters (mistaking the negative return value for an
unsigned length).

Reported by Coverity.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>winansi: avoid use of uninitialized value</title>
<updated>2017-05-08T03:18:19Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-05-04T13:55:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3057da5ad51b3256a6f6b94d034e6a5571ce5ece'/>
<id>urn:sha1:3057da5ad51b3256a6f6b94d034e6a5571ce5ece</id>
<content type='text'>
To initialize the foreground color attributes of "plain text", our ANSI
emulation tries to infer them from the currently attached console while
running the is_console() function. This function first tries to detect any
console attached to stdout, then it is called with stderr.

If neither stdout nor stderr has any console attached, it does not
actually matter what we use for "plain text" attributes, as we never need
to output any text to any console in that case.

However, after working on stdout and stderr, is_console() is called with
stdin, and it still tries to initialize the "plain text" attributes if
they had not been initialized earlier. In this case, we cannot detect any
attributes, and we used an uninitialized value for them.

Naturally, Coverity complained about this use case because it could not
reason about the code deeply enough to figure out that we do not even use
those attributes in that case.

Let's just initialize the value to 0 in that case, both to avoid future
Coverity reports, and to help catch future regressions in case anybody
changes the order of the is_console() calls (which would make the text
black on black).

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mingw: avoid memory leak when splitting PATH</title>
<updated>2017-05-08T03:18:19Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-05-04T13:55:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a845a2c88e5b72acce33c9719ec36fcd0f9c877'/>
<id>urn:sha1:1a845a2c88e5b72acce33c9719ec36fcd0f9c877</id>
<content type='text'>
In the (admittedly, concocted) case that PATH consists only of path
delimiters, we would leak the duplicated string.

Reported by Coverity.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/mingw-isatty'</title>
<updated>2017-02-16T22:45:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-02-16T22:45:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e048a257bfe66e6eead5e212b5449ffd108de707'/>
<id>urn:sha1:e048a257bfe66e6eead5e212b5449ffd108de707</id>
<content type='text'>
A hotfix for a topic already in 'master'.

* js/mingw-isatty:
  mingw: make stderr unbuffered again
</content>
</entry>
<entry>
<title>mingw: make stderr unbuffered again</title>
<updated>2017-02-14T18:54:21Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-02-13T22:34:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a4d92d579f792e8eac4f7cf590bfffc522bf3da9'/>
<id>urn:sha1:a4d92d579f792e8eac4f7cf590bfffc522bf3da9</id>
<content type='text'>
When removing the hack for isatty(), we actually removed more than just
an isatty() hack: we removed the hack where internal data structures of
the MSVC runtime are modified in order to redirect stdout/stderr.

Instead of using that hack (that does not work with newer versions of
the runtime, anyway), we replaced it by reopening the respective file
descriptors.

What we forgot was to mark stderr as unbuffered again.

Reported by Hannes Sixt. Fixed with Jeff Hostetler's assistance.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Tested-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/qsort-s'</title>
<updated>2017-01-31T21:15:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-31T21:15:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6ad8b8e98faa5a301a98a2997da162dea060672e'/>
<id>urn:sha1:6ad8b8e98faa5a301a98a2997da162dea060672e</id>
<content type='text'>
A few codepaths had to rely on a global variable when sorting
elements of an array because sort(3) API does not allow extra data
to be passed to the comparison function.  Use qsort_s() when
natively available, and a fallback implementation of it when not,
to eliminate the need, which is a prerequisite for making the
codepath reentrant.

* rs/qsort-s:
  ref-filter: use QSORT_S in ref_array_sort()
  string-list: use QSORT_S in string_list_sort()
  perf: add basic sort performance test
  add QSORT_S
  compat: add qsort_s()
</content>
</entry>
<entry>
<title>Merge branch 'js/mingw-isatty'</title>
<updated>2017-01-31T21:14:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-31T21:14:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d515fe08fc188ed5a23537a8218a32caf716ff49'/>
<id>urn:sha1:d515fe08fc188ed5a23537a8218a32caf716ff49</id>
<content type='text'>
An update to a topic that is already in 'master'.

* js/mingw-isatty:
  mingw: follow-up to "replace isatty() hack"
</content>
</entry>
<entry>
<title>compat: add qsort_s()</title>
<updated>2017-01-23T19:02:34Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-01-22T17:51:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=04ee8b875b96c096c479132adca02fa734c3fa96'/>
<id>urn:sha1:04ee8b875b96c096c479132adca02fa734c3fa96</id>
<content type='text'>
The function qsort_s() was introduced with C11 Annex K; it provides the
ability to pass a context pointer to the comparison function, supports
the convention of using a NULL pointer for an empty array and performs a
few safety checks.

Add an implementation based on compat/qsort.c for platforms that lack a
native standards-compliant qsort_s() (i.e. basically everyone).  It
doesn't perform the full range of possible checks: It uses size_t
instead of rsize_t and doesn't check nmemb and size against RSIZE_MAX
because we probably don't have the restricted size type defined.  For
the same reason it returns int instead of errno_t.

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>
</feed>
