> However, here is your problem in a nutshell. > > I write this > int x = 1; > int y = 2; > if (x = y) printf("%d", x); > > woops assignment inside of an if, you come along and change it to this > if (x == y) printf("%d", x); > > Who 'owns' it? The answer is we both do under the eyes of the law.
Well, it's actually not so simple.
In cases where there is a clear, obvious way of doing something (like your example), or in cases where there really is only one way to write the code, the answers come down to the fine details of copyright law. See http://www.ifosslr.org/ifosslr/article/view/30/64 for some interesting analysis, specifically the "Software Code Not Subject To Copyright" section.