Re: [PATCH v3 3/4] setup: Add 'abspath_part_inside_repo' function

2014-01-31 Thread Duy Nguyen
On Sat, Feb 1, 2014 at 3:22 AM, Martin Erik Werner wrote: > diff --git a/setup.c b/setup.c > index 5432a31..e606846 100644 > --- a/setup.c > +++ b/setup.c > @@ -77,6 +77,69 @@ int path_inside_repo(const char *prefix, const char *path) > return 0; > } > > +/* > + * It is ok if dst == src,

Re: [PATCH v3 3/4] setup: Add 'abspath_part_inside_repo' function

2014-01-31 Thread Martin Erik Werner
On Fri, Jan 31, 2014 at 11:37:29PM +0100, Torsten Bögershausen wrote: > On 2014-01-31 21.22, Martin Erik Werner wrote: > > In order to extract the part of an absolute path which lies inside the > > repo, it is not possible to directly use real_path, since that would > > dereference symlinks both ou

Re: [PATCH v3 3/4] setup: Add 'abspath_part_inside_repo' function

2014-01-31 Thread Torsten Bögershausen
On 2014-01-31 21.22, Martin Erik Werner wrote: > In order to extract the part of an absolute path which lies inside the > repo, it is not possible to directly use real_path, since that would > dereference symlinks both outside and inside the work tree. > > Add an 'abspath_part_inside_repo' function

[PATCH v3 3/4] setup: Add 'abspath_part_inside_repo' function

2014-01-31 Thread Martin Erik Werner
In order to extract the part of an absolute path which lies inside the repo, it is not possible to directly use real_path, since that would dereference symlinks both outside and inside the work tree. Add an 'abspath_part_inside_repo' function which incrementally checks each path level by temporari