Re: [PATCH 2/5] path.c: Don't discard the return value of vsnpath()

2012-09-07 Thread Ramsay Jones
Junio C Hamano wrote: > cleanup_path() is a quick-and-dirty hack that only deals with > leading ".///" (e.g. "foo//bar" is not reduced to "foo/bar"), and > the callers that allocate 4 bytes for buf to hold "foo" may not be > able to fit it if for some reason there are some bytes that must be > clea

Re: [PATCH 2/5] path.c: Don't discard the return value of vsnpath()

2012-09-04 Thread Junio C Hamano
Ramsay Jones writes: > The git_snpath() and git_pathdup() functions both use the (static) > function vsnpath() in their implementation. Also, they both discard > the return value of vsnpath(), which has the effect of ignoring the > side effect of calling cleanup_path() in the non-error return pat

[PATCH 2/5] path.c: Don't discard the return value of vsnpath()

2012-09-04 Thread Ramsay Jones
The git_snpath() and git_pathdup() functions both use the (static) function vsnpath() in their implementation. Also, they both discard the return value of vsnpath(), which has the effect of ignoring the side effect of calling cleanup_path() in the non-error return path. In order to ensure that th