Re: [PATCH 1/8] Introduce new static function real_path_internal()

2012-09-28 Thread Junio C Hamano
Michael Haggerty writes: >> The patch makes sense, but while you are touching this code, I have >> to wonder if there is an easy way to tell, before entering the loop, >> if we have to chdir() around in the loop. That would allow us to >> hoist the getcwd() that is done only so that we can come

Re: [PATCH 1/8] Introduce new static function real_path_internal()

2012-09-28 Thread Michael Haggerty
On 09/27/2012 11:27 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> @@ -54,20 +73,36 @@ const char *real_path(const char *path) >> } >> >> if (*buf) { >> -if (!*cwd && !getcwd(cwd, sizeof(cwd))) >> -die_errno ("

Re: [PATCH 1/8] Introduce new static function real_path_internal()

2012-09-27 Thread Junio C Hamano
Michael Haggerty writes: > @@ -54,20 +73,36 @@ const char *real_path(const char *path) > } > > if (*buf) { > - if (!*cwd && !getcwd(cwd, sizeof(cwd))) > - die_errno ("Could not get current working > directory"); > +

[PATCH 1/8] Introduce new static function real_path_internal()

2012-09-26 Thread Michael Haggerty
It accepts a new parameter, die_on_error. If die_on_error is false, it simply cleans up after itself and returns NULL rather than dying. Signed-off-by: Michael Haggerty --- abspath.c | 93 --- 1 file changed, 72 insertions(+), 21 delet