[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Applying the GPL (or any license) to your code
From: |
John W. Eaton |
Subject: |
Re: Applying the GPL (or any license) to your code |
Date: |
Wed, 2 Mar 2005 12:42:11 -0500 |
On 2-Mar-2005, Stefan van der Walt <address@hidden> wrote:
| On Wed, Mar 02, 2005 at 11:30:49AM -0500, John W. Eaton wrote:
| > But perhaps when deciding whether a block of comments is a copyright
| > notice, we should just see if the first word matches "[Cc]opyright"
| > and that is all?
|
| Was this code ever meant to warn the users if they use scripts with a
| different license than the GPL?
No, because there is no restriction on the license of M-files. The
intent was to allow copyright notices to come first in the file,
followed by the help text.
| If not, the above solution sounds great.
OK, please try the following patch.
Thanks,
jwe
2005-03-02 John W. Eaton <address@hidden>
* parse.y (looks_like_copyright):
Rename from looks_like_octave_copyright. Change all uses.
Simply match "Copyright".
Index: src/parse.y
===================================================================
RCS file: /cvs/octave/src/parse.y,v
retrieving revision 1.228
diff -u -r1.228 parse.y
--- src/parse.y 23 Feb 2005 16:44:59 -0000 1.228
+++ src/parse.y 2 Mar 2005 17:34:03 -0000
@@ -2969,34 +2969,12 @@
}
static bool
-looks_like_octave_copyright (const std::string& s)
+looks_like_copyright (const std::string& s)
{
- bool retval = false;
+ // Perhaps someday we will want to do more here, so leave this as a
+ // separate function.
- std::string t = s.substr (0, 14);
-
- if (t == "Copyright (C) ")
- {
- size_t pos = s.find ('\n');
-
- if (pos != NPOS)
- {
- pos = s.find ('\n', pos + 1);
-
- if (pos != NPOS)
- {
- pos++;
-
- t = s.substr (pos, 28);
-
- if (t == "This file is part of Octave."
- || t == "This program is free softwar")
- retval = true;
- }
- }
- }
-
- return retval;
+ return (s.substr (0, 14) == "Copyright");
}
static int
@@ -3146,7 +3124,7 @@
if (! help_txt.empty ())
{
- if (looks_like_octave_copyright (help_txt))
+ if (looks_like_copyright (help_txt))
{
if (save_copyright)
octave_comment_buffer::append (help_txt);
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------