[PATCH v3 01/25] path.c: make get_pathname() return strbuf instead of static buffer

2014-02-18 Thread Nguyễn Thái Ngọc Duy
We've been avoiding PATH_MAX whenever possible. This patch makes get_pathname() return a strbuf and updates the callers to take advantage of this. The code is simplified as we no longer need to worry about buffer overflow. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 119

Re: [PATCH v3 01/25] path.c: make get_pathname() return strbuf instead of static buffer

2014-03-03 Thread Junio C Hamano
Duy Nguyen writes: > On Thu, Feb 20, 2014 at 6:26 AM, Junio C Hamano wrote: >> Is there a reason not to do just an equivalent of >> >> #define git_pathdup mkpathdup >> >> and be done with it? Am I missing something? > > They have a subtle difference: mkpathdup() calls cleanup_path() while >

Re: [PATCH v3 01/25] path.c: make get_pathname() return strbuf instead of static buffer

2014-02-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: (Only nitpicks during this round of review). > -static char *get_pathname(void) > +static struct strbuf *get_pathname() static struct strbuf *get_pathname(void) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@

Re: [PATCH v3 01/25] path.c: make get_pathname() return strbuf instead of static buffer

2014-02-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > We've been avoiding PATH_MAX whenever possible. This patch makes > get_pathname() return a strbuf and updates the callers to take > advantage of this. The code is simplified as we no longer need to > worry about buffer overflow. > > Signed-off-by: Nguyễn Thái Ngọc

Re: [PATCH v3 01/25] path.c: make get_pathname() return strbuf instead of static buffer

2014-02-28 Thread Duy Nguyen
On Thu, Feb 20, 2014 at 6:26 AM, Junio C Hamano wrote: > Is there a reason not to do just an equivalent of > > #define git_pathdup mkpathdup > > and be done with it? Am I missing something? > They have a subtle difference: mkpathdup() calls cleanup_path() while git_pathdup() does not. Withou