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
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 ("
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");
> +
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
4 matches
Mail list logo