Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: [PATCH] Use PATH_MAX rather than a hardwired constant maximum length.

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:07

On 4/26/07, koreth@midwinter.com [off-list ref] wrote:
Signed-off-by: Steven Grimm <redacted>
---

Is the +1 really needed? The existing code is doing this in other places
No, not according SUSv3, where PATH_MAX is defined as
"Maximum number of bytes in a pathname, including the terminating null
character."
http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html#tag_13_24

getcwd expects the size of the buffer, so it can store the cwd _and_ NUL.
See ERANGE in in SUSv3:
http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html
but I'm not sure it's necessary since we're also doing sizeof(buffer)-1
The -1 is wrong too.
in the getcwd() call. I figured it was best to be consistent with the
existing code, e.g. setup_git_directory_gently().
setup_git_directory_gently is wrong. But it does not really
matter in practice.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help