SZEDER Gábor writes:
> ... And that function must be able to handle multiple path
> components, becase there is this callsite:
>
> exec-cmd.c: !(prefix = strip_path_suffix(executable_dirname,
> GIT_EXEC_PATH)) &&
>
> and the build sets '-DGIT_EXEC_PATH="libexec/git-core"' by default.
"brian m. carlson" writes:
> Well, I split it out from a function that handles multiple path
> components, mostly so that I could leverage existing work (and not have
> to worry about getting it wrong). It wasn't explicitly intended that it
> support multiple components, since I don't require tha
On Mon, Aug 12, 2019 at 09:49:20AM -0700, Junio C Hamano wrote:
> "brian m. carlson" writes:
>
> > On 2019-08-12 at 00:32:26, Junio C Hamano wrote:
> >> "brian m. carlson" writes:
> >> > +static ssize_t stripped_path_suffix_offset(const char *path, const char
> >> > *suffix)
> >>
> >> Perhaps
On Mon, Aug 12, 2019 at 10:40:21PM +, brian m. carlson wrote:
> I think "ends_with_path_components" might be the way forward, unless
> you think something else would be better.
FWIW, having read the rest of the thread, that was the name that clicked
for me.
-Peff
On 2019-08-12 at 16:49:20, Junio C Hamano wrote:
> "brian m. carlson" writes:
>
> > On 2019-08-12 at 00:32:26, Junio C Hamano wrote:
> >> "brian m. carlson" writes:
> >> > +static ssize_t stripped_path_suffix_offset(const char *path, const char
> >> > *suffix)
> >>
> >> Perhaps
> >>
> >>
"brian m. carlson" writes:
> On 2019-08-12 at 00:32:26, Junio C Hamano wrote:
>> "brian m. carlson" writes:
>> > +static ssize_t stripped_path_suffix_offset(const char *path, const char
>> > *suffix)
>>
>> Perhaps
>>
>> static ssize_t last_path_component_offset(const char *path, const cha
On Mon, Aug 12, 2019 at 01:10:54AM +, brian m. carlson wrote:
> On 2019-08-12 at 00:32:26, Junio C Hamano wrote:
> > "brian m. carlson" writes:
> > > +static ssize_t stripped_path_suffix_offset(const char *path, const char
> > > *suffix)
> >
> > Perhaps
> >
> > static ssize_t last_path_
On 2019-08-12 at 00:32:26, Junio C Hamano wrote:
> "brian m. carlson" writes:
> > +static ssize_t stripped_path_suffix_offset(const char *path, const char
> > *suffix)
>
> Perhaps
>
> static ssize_t last_path_component_offset(const char *path, const char
> *name)
>
> I am tempted to also
"brian m. carlson" writes:
> We have a function to strip the path suffix from a commit, but we don't
> have one to check for a path suffix. For a plain filename, we can use
> basename, but that requires an allocation, since POSIX allows it to
> modify its argument. Refactor strip_path_suffix into
9 matches
Mail list logo