You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@corinthia.apache.org by Gabriela Gibson <ga...@gmail.com> on 2015/03/08 13:25:07 UTC

xstrdup and gnu licence

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?

This may be a trite example (and I'm pretty sure that nothing bad will
happen), but the general point does somewhat confuse me --- with music it's
8 similar notes IIRC.

G
-- 
Visit my Coding Diary: http://gabriela-gibson.blogspot.com/

Re: xstrdup and gnu licence

Posted by Peter Kelly <pm...@apache.org>.
> On 8 Mar 2015, at 7:25 pm, Gabriela Gibson <ga...@gmail.com> 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
pmkelly@apache.org

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)


Re: xstrdup and gnu licence

Posted by jan i <ja...@apache.org>.
On 8 March 2015 at 13:25, Gabriela Gibson <ga...@gmail.com> 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?
>
> This may be a trite example (and I'm pretty sure that nothing bad will
> happen), but the general point does somewhat confuse me --- with music it's
> 8 similar notes IIRC.
>
I would not go out add add a library just to do xstrdup. Either we do it
simple by just using strdup(), or a bit more complicated by using xmalloc()
and strcpy(), I prefer the latter.

rgds
jan I.


>
> G
> --
> Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
>