> On 8 Mar 2015, at 7:25 pm, Gabriela Gibson <[email protected]> wrote: > > Hi, > > This: > http://www.opensource.apple.com/source/texinfo/texinfo-4/texinfo/lib/xstrdup.c > and this: > http://ctan.mackichan.com/systems/luatex/base/source/texk/kpathsea/xstrdup.c > > are two of the many copies of the same thing on the web out there. > > So, I (idly) wonder about the following technicalities: > > a) is the GNU licence a problem? That is, could someone claim that > Corinthia is now GNU? > > b) What actually is copyrighted here -- the entire file, the name, or just > this particular shape of xstrdup? > > c) do I need to 'invent' a new way of making xstrdup?
No. Just do what you did with xmalloc. If you wrote it yourself, it’s not copying. This case is especially trivial. Just call strdup, check the result as you did in xmalloc, and abort if it’s NULL, returning the result if otherwise. My approach to this kind of thing is that if I’m going to implement something, then I don’t look at alternative implementations (esp. GNU-licensed code when writing for a non-GNU project). That way I’m not “tainting” myself and can genuinely claim not to know how others have implemented it. I would recommend you take a similar approach. — Dr Peter M. Kelly [email protected] PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key> (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)
