When I am using some code licensed with the MIT license, but it's not in seperate files, is it OK mark it like this?
/* Here starts code licensed under the MIT License (../MIT.txt) */
// code
/* Here is the end of code licensed under the MIT License (../MIT.txt) */
Where in ../MIT.txt file, it would contain the MIT License text and the original author's copyright notices.
Also, when most of code is MIT licensed and I'm only changing some sections of the functions can I mark those parts with the same method as above but with my own license? Yes, it's going to be a lot of kilobytes of comments.
Best Answer
When you use MIT-licensed code in a non-MIT-licensed project, simply marking the MIT-licensed parts of the source code is not a good strategy. The license allows you to do just about anything with the code – including sublicensing the code –, under this one restriction:
Note that the MIT license should also be displayed to the end user of your software. Where you display your copyright to the user, you should also add something like
In addition, you might want to explicitly mark the sections in the code that were taken from an MIT-licensed source. From my understanding, this is not required, but it would be ethical.
When you modify an MIT-licensed source, you should not mark your contributions with a separate license, because this requires an user of the source to follow both the original license and your license. Instead, choose one of the following options:
Notes: