1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Stop copying the licence text into C source code.

Now all the uses of the licence text or the short copyright notice get
it from a new header "licence.h", which in turn is built by a Perl
script licence.pl invoked by mkfiles.pl, using LICENCE itself as the
source.

Hence, I can completely remove a whole section from the list of
licence locations in CHECKLST.txt :-)

(cherry picked from commit 9ddd071ec2)

Conflicts:
	unix/gtkdlg.c
	windows/winpgnt.c

(cherry-picker's notes: one conflict was just changed context, the
other was deleting a copy of the licence that wasn't quite the same
between branches)
This commit is contained in:
Simon Tatham
2016-02-25 20:43:54 +00:00
parent 4327fe71fe
commit 442627408f
9 changed files with 83 additions and 147 deletions

View File

@ -7,6 +7,7 @@
*/
#include "version.h"
#include "licence.h"
/*
* The actual VERSIONINFO resource.
@ -44,7 +45,7 @@ BEGIN
VALUE "OriginalFilename", APPNAME
VALUE "FileVersion", TEXTVER
VALUE "ProductVersion", TEXTVER
VALUE "LegalCopyright", "Copyright \251 1997-2015 Simon Tatham."
VALUE "LegalCopyright", "Copyright \251 " SHORT_COPYRIGHT_DETAILS "."
#if (!defined SNAPSHOT) && (!defined RELEASE) && (!defined PRERELEASE)
/* Only if VS_FF_PRIVATEBUILD. */
VALUE "PrivateBuild", TEXTVER /* NBI */

View File

@ -14,6 +14,7 @@
#include "win_res.h"
#include "storage.h"
#include "dialog.h"
#include "licence.h"
#include <commctrl.h>
#include <commdlg.h>
@ -170,37 +171,7 @@ static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
char *str = dupprintf("%s Licence", appname);
SetWindowText(hwnd, str);
sfree(str);
SetDlgItemText(hwnd, IDA_TEXT,
"Copyright 1997-2015 Simon Tatham.\r\n\r\n"
"Portions copyright Robert de Bath, Joris van Rantwijk, Delian "
"Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas "
"Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, "
"Markus Kuhn, Colin Watson, Christopher Staite, and CORE SDI S.A.\r\n\r\n"
"Permission is hereby granted, free of charge, to any person "
"obtaining a copy of this software and associated documentation "
"files (the ""Software""), to deal in the Software without restriction, "
"including without limitation the rights to use, copy, modify, merge, "
"publish, distribute, sublicense, and/or sell copies of the Software, "
"and to permit persons to whom the Software is furnished to do so, "
"subject to the following conditions:\r\n\r\n"
"The above copyright notice and this permission notice shall be "
"included in all copies or substantial portions of the Software.\r\n\r\n"
"THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT "
"WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "
"INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
"MERCHANTABILITY, FITNESS FOR A PARTICULAR "
"PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
"COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES "
"OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "
"TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN "
"CONNECTION WITH THE SOFTWARE OR THE USE OR "
"OTHER DEALINGS IN THE SOFTWARE."
);
SetDlgItemText(hwnd, IDA_TEXT, LICENCE_TEXT("\r\n\r\n"));
}
return 1;
case WM_COMMAND:
@ -232,7 +203,7 @@ static int CALLBACK AboutProc(HWND hwnd, UINT msg,
char *text = dupprintf
("%s\r\n\r\n%s\r\n\r\n%s",
appname, ver,
"\251 1997-2015 Simon Tatham. All rights reserved.");
"\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
SetDlgItemText(hwnd, IDA_TEXT, text);
sfree(text);
}

View File

@ -11,6 +11,7 @@
#include "putty.h"
#include "ssh.h"
#include "licence.h"
#include <commctrl.h>
@ -253,36 +254,7 @@ static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
rd.right - rd.left, rd.bottom - rd.top, TRUE);
}
SetDlgItemText(hwnd, 1000,
"Copyright 1997-2015 Simon Tatham.\r\n\r\n"
"Portions copyright Robert de Bath, Joris van Rantwijk, Delian "
"Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas "
"Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, "
"Markus Kuhn, Colin Watson, Christopher Staite, and CORE SDI S.A.\r\n\r\n"
"Permission is hereby granted, free of charge, to any person "
"obtaining a copy of this software and associated documentation "
"files (the ""Software""), to deal in the Software without restriction, "
"including without limitation the rights to use, copy, modify, merge, "
"publish, distribute, sublicense, and/or sell copies of the Software, "
"and to permit persons to whom the Software is furnished to do so, "
"subject to the following conditions:\r\n\r\n"
"The above copyright notice and this permission notice shall be "
"included in all copies or substantial portions of the Software.\r\n\r\n"
"THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT "
"WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "
"INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
"MERCHANTABILITY, FITNESS FOR A PARTICULAR "
"PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
"COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES "
"OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "
"TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN "
"CONNECTION WITH THE SOFTWARE OR THE USE OR "
"OTHER DEALINGS IN THE SOFTWARE."
);
SetDlgItemText(hwnd, 1000, LICENCE_TEXT("\r\n\r\n"));
return 1;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@ -326,7 +298,7 @@ static int CALLBACK AboutProc(HWND hwnd, UINT msg,
char *text = dupprintf
("Pageant\r\n\r\n%s\r\n\r\n%s",
ver,
"\251 1997-2015 Simon Tatham. All rights reserved.");
"\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
SetDlgItemText(hwnd, 1000, text);
sfree(text);
}

View File

@ -15,6 +15,7 @@
#include "misc.h"
#include "tree234.h"
#include "winsecur.h"
#include "licence.h"
#include <shellapi.h>
@ -183,36 +184,7 @@ static int CALLBACK LicenceProc(HWND hwnd, UINT msg,
{
switch (msg) {
case WM_INITDIALOG:
SetDlgItemText(hwnd, 1000,
"Copyright 1997-2015 Simon Tatham.\r\n\r\n"
"Portions copyright Robert de Bath, Joris van Rantwijk, Delian "
"Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas "
"Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, "
"Markus Kuhn, Colin Watson, Christopher Staite, and CORE SDI S.A.\r\n\r\n"
"Permission is hereby granted, free of charge, to any person "
"obtaining a copy of this software and associated documentation "
"files (the ""Software""), to deal in the Software without restriction, "
"including without limitation the rights to use, copy, modify, merge, "
"publish, distribute, sublicense, and/or sell copies of the Software, "
"and to permit persons to whom the Software is furnished to do so, "
"subject to the following conditions:\r\n\r\n"
"The above copyright notice and this permission notice shall be "
"included in all copies or substantial portions of the Software.\r\n\r\n"
"THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT "
"WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, "
"INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF "
"MERCHANTABILITY, FITNESS FOR A PARTICULAR "
"PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
"COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES "
"OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, "
"TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN "
"CONNECTION WITH THE SOFTWARE OR THE USE OR "
"OTHER DEALINGS IN THE SOFTWARE."
);
SetDlgItemText(hwnd, 1000, LICENCE_TEXT("\r\n\r\n"));
return 1;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@ -241,7 +213,7 @@ static int CALLBACK AboutProc(HWND hwnd, UINT msg,
char *text = dupprintf
("Pageant\r\n\r\n%s\r\n\r\n%s",
ver,
"\251 1997-2015 Simon Tatham. All rights reserved.");
"\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved.");
SetDlgItemText(hwnd, 1000, text);
sfree(text);
}