<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/compat/basename.c, branch origin/maint</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=origin%2Fmaint</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=origin%2Fmaint'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2024-06-07T17:30:52Z</updated>
<entry>
<title>compat/win32: fix const-correctness with string constants</title>
<updated>2024-06-07T17:30:52Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-06-07T06:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e7b40195ae0082d04ea8c0d1769d90ea700b76f2'/>
<id>urn:sha1:e7b40195ae0082d04ea8c0d1769d90ea700b76f2</id>
<content type='text'>
Adjust various places in our Win32 compatibility layer where we are not
assigning string constants to `const char *` variables.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>compat/basename.c: provide a dirname() compatibility function</title>
<updated>2016-01-12T18:40:54Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-01-12T07:57:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=824682ab51e3510817f7a7303decc9f9df38ee9a'/>
<id>urn:sha1:824682ab51e3510817f7a7303decc9f9df38ee9a</id>
<content type='text'>
When there is no `libgen.h` to our disposal, we miss the `dirname()`
function.  Earlier we added basename() compatibility function for
the same reason at e1c06886 (compat: add a basename() compatibility
function, 2009-05-31).

So far, we only had one user of that function: credential-cache--daemon
(which was only compiled when Unix sockets are available, anyway). But
now we also have `builtin/am.c` as user, so we need it.

Since `dirname()` is a sibling of `basename()`, we simply put our very
own `gitdirname()` implementation next to `gitbasename()` and use it
if `NO_LIBGEN_H` has been set.

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>compat/basename: make basename() conform to POSIX</title>
<updated>2016-01-12T18:40:27Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-01-12T07:57:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=61725be349b44f15b0239182c859553d5c547ba0'/>
<id>urn:sha1:61725be349b44f15b0239182c859553d5c547ba0</id>
<content type='text'>
According to POSIX, basename("/path/") should return "path", not
"path/". Likewise, basename(NULL) and basename("") should both
return "." to conform.

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>Refactor skipping DOS drive prefixes</title>
<updated>2016-01-12T18:39:40Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-01-12T07:57:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2f36eed936f70105e80681aafac645ff34acc667'/>
<id>urn:sha1:2f36eed936f70105e80681aafac645ff34acc667</id>
<content type='text'>
Junio noticed that there is an implicit assumption in pretty much
all the code calling has_dos_drive_prefix(): it forces all of its
callsites to hardcode the knowledge that the DOS drive prefix is
always two bytes long.

While this assumption is pretty safe, we can still make the code
more readable and less error-prone by introducing a function that
skips the DOS drive prefix safely.

While at it, we change the has_dos_drive_prefix() return value: it
now returns the number of bytes to be skipped if there is a DOS
drive prefix.

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>compat: add a basename() compatibility function</title>
<updated>2009-06-01T00:57:59Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2009-05-31T08:35:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e1c068869216c8c231c1585bbfa9fda42b4756f8'/>
<id>urn:sha1:e1c068869216c8c231c1585bbfa9fda42b4756f8</id>
<content type='text'>
Some systems such as Windows lack libgen.h so provide a
basename() implementation for cross-platform use.

This introduces the NO_LIBGEN_H construct to the Makefile
and autoconf scripts.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
