On Thu, Nov 3, 2016 at 10:27 AM, Bert Huijben <b...@qqmail.nl> wrote:

> I’m not sure about the perl rules applied around this function, but
> perhaps we should just copy the string instead of changing memory that we
> receive as constant. We might also have a different api function that
> behaves in a cleaner way.


Well, the code to parse a "{DATE}" looks like it was lifted from
subversion/libsvn_subr/opt.c :)
Of course, it would be cleaner to copy the substring between the braces,
but that would involve allocating some memory, either the SVN way (using
the passed-in pool) or the Perl way (which needs to get the lifetime, ie.
ref count, right). For bonus credit, we could do it with a Perl regex
(using the perlguts C API for the extra thrill). But I think the approach
of temporarily substituting a NUL byte is OK, no Perl code (callbacks) can
run during this timespan, so it should be safe.

Cheers, Roderich

Reply via email to