From 775ba5eeb2cebbd896fc16e6e95de6aecd32f288 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 26 May 2021 14:26:41 +0000 Subject: Test Tk 8.5 on MacOS with XQuarz only --- .github/workflows/mac-build.yml | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 0fc1d04..7378565 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -23,14 +23,10 @@ jobs: run: | touch ../generic/tkStubInit.c ../doc/man.macros mkdir "$HOME/install" - echo "USE_XVFB=$USE_XVFB" >> $GITHUB_ENV - env: - USE_XVFB: ${{ contains(matrix.options, '--disable-aqua') }} - name: Add Tcl run: | brew install tcl-tk - - name: Add X11 (if required) - if: ${{ env.USE_XVFB == 'true' }} + - name: Add X11 run: | brew install --cask xquartz sudo /opt/X11/libexec/privileged_startx || true @@ -52,21 +48,15 @@ jobs: } - name: Run Tests run: | - if [ $USE_XVFB == true ]; then - function runXvfb { - PATH=$PATH:/opt/X11/bin - Xvfb $1 & - XVFB_PID=$! - echo Launched Xvfb $1 as process $XVFB_PID >&2 - trap "echo killing process $XVFB_PID... >&2; kill $XVFB_PID" 0 - export DISPLAY=$1 - sleep 2 - } - else - function runXvfb { - echo Xvfb not used, this is a --enable-aqua build - } - fi + function runXvfb { + PATH=$PATH:/opt/X11/bin + Xvfb $1 & + XVFB_PID=$! + echo Launched Xvfb $1 as process $XVFB_PID >&2 + trap "echo killing process $XVFB_PID... >&2; kill $XVFB_PID" 0 + export DISPLAY=$1 + sleep 2 + } ( runXvfb :0; make test-classic; exit $? ) | tee out-classic.txt || { echo "::error::Failure during Test (classic)" exit 1 -- cgit v0.12 From 3b894ebd5728eb377932f6a0a6f7703ad70ab7cf Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 21 Jun 2021 10:46:27 +0000 Subject: Fix copy/paste error in ttk::scale man page. --- doc/ttk_scale.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n index aa851b9..32686a6 100644 --- a/doc/ttk_scale.n +++ b/doc/ttk_scale.n @@ -99,7 +99,7 @@ The class name for a \fBttk::scale\fP is \fBTScale\fP. .PP Dynamic states: \fBactive\fP. .PP -\fBTProgressbar\fP styling options configurable with \fBttk::style\fP +\fBTScale\fP styling options configurable with \fBttk::style\fP are: .PP \fB\-background\fP \fIcolor\fP -- cgit v0.12 From 6eac9c2f48c934ccb300208994845259d88e1ebf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 21 Jun 2021 13:05:45 +0000 Subject: Add ISSUE_TEMPLATE and PULL_REQUEST_TEMPLATE for github. Change many url's from http:// to https:// --- .github/ISSUE_TEMPLATE.md | 3 +++ .github/PULL_REQUEST_TEMPLATE.md | 3 +++ ChangeLog | 2 +- README.md | 2 +- doc/wm.n | 2 +- generic/tkInt.h | 2 +- generic/tkSelect.c | 2 +- library/demos/cscroll.tcl | 2 +- library/icons.tcl | 2 +- library/listbox.tcl | 2 +- library/text.tcl | 2 +- library/tk.tcl | 2 +- macosx/Credits.html.in | 4 ++-- 13 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..35a56fb --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,3 @@ +Important Note +========== +Please do not file issues with Tk on Github. They are unlikely to be noticed in a timely fashion. Tk issues are hosted in the [tk fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tk/tktnew); please post them there. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..dc07555 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,3 @@ +Important Note +========== +Please do not file pull requests with Tk on Github. They are unlikely to be noticed in a timely fashion. Tk issues (including patches) are hosted in the [tk fossil repository on core.tcl-lang.org](https://core.tcl-lang.org/tk/tktnew); please post them there. diff --git a/ChangeLog b/ChangeLog index f01946a..941c509 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3203,7 +3203,7 @@ a better first place to look now. 2009-03-25 Jan Nijtmans * doc/wish.1: Bring doc and demos in line with - * library/demos/hello: http://wiki.tcl.tk/812 + * library/demos/hello: https://wiki.tcl-lang.org/page/exec+magic * library/demos/rmt * library/demos/square * library/demos/tcolor diff --git a/README.md b/README.md index 2c27a64..38d026a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This directory contains the sources and documentation for Tk, a cross-platform GUI toolkit implemented with the Tcl scripting language. For details on features, incompatibilities, and potential problems with -this release, see [the Tcl/Tk 8.6 Web page](https://www.tcl.tk/software/tcltk/8.6.html) +this release, see [the Tcl/Tk 8.6 Web page](https://www.tcl-lang.org/software/tcltk/8.6.html) or refer to the "changes" file in this directory, which contains a historical record of all changes to Tk. diff --git a/doc/wm.n b/doc/wm.n index 5e6c394..5bb1c61 100644 --- a/doc/wm.n +++ b/doc/wm.n @@ -120,7 +120,7 @@ color with some alpha, e.g. .PP On X11, the following attributes may be set. These are not supported by all window managers, and will have no effect under older WMs. -.\" See http://www.freedesktop.org/Standards/wm-spec +.\" See https://www.freedesktop.org/wiki/Specifications/wm-spec/ .TP \fB\-type\fR .VS 8.6 diff --git a/generic/tkInt.h b/generic/tkInt.h index c281821..fe8f16e 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -1041,7 +1041,7 @@ MODULE_SCOPE const char *const tkWebColors[20]; #endif /* - * Support for Clang Static Analyzer + * Support for Clang Static Analyzer */ #if defined(PURIFY) && defined(__clang__) diff --git a/generic/tkSelect.c b/generic/tkSelect.c index f187f83..ef636da 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -1191,7 +1191,7 @@ TkSelInit( * Using UTF8_STRING instead of the XA_UTF8_STRING macro allows us to * support older X servers that didn't have UTF8_STRING yet. This is * necessary on Unix systems. For more information, see: - * http://www.cl.cam.ac.uk/~mgk25/unicode.html#x11 + * https://www.cl.cam.ac.uk/~mgk25/unicode.html#x11 */ #if !defined(_WIN32) diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl index d210c7d..c88bfa9 100644 --- a/library/demos/cscroll.tcl +++ b/library/demos/cscroll.tcl @@ -114,7 +114,7 @@ if {[tk windowingsystem] eq "x11" && ![package vsatisfies [package provide Tk] 8 # Support for mousewheels on Linux/Unix commonly comes through mapping # the wheel to the extended buttons. If you have a mousewheel, find # Linux configuration info at: - # http://linuxreviews.org/howtos/xfree/mouse/ + # https://linuxreviews.org/HOWTO_change_the_mouse_speed_in_X bind $c { if {!$tk_strictMotif} { %W yview scroll -5 units diff --git a/library/icons.tcl b/library/icons.tcl index e53a1bd..87af75a 100644 --- a/library/icons.tcl +++ b/library/icons.tcl @@ -4,7 +4,7 @@ # were provided by the Tango Desktop project which provides a # unified set of high quality icons licensed under the # Creative Commons Attribution Share-Alike license -# (http://creativecommons.org/licenses/by-sa/3.0/) +# (https://creativecommons.org/licenses/by-sa/3.0/) # # See http://tango.freedesktop.org/Tango_Desktop_Project # diff --git a/library/listbox.tcl b/library/listbox.tcl index 9e0da6c..44abfb9 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -214,7 +214,7 @@ if {[tk windowingsystem] eq "x11"} { # Support for mousewheels on Linux/Unix commonly comes through mapping # the wheel to the extended buttons. If you have a mousewheel, find # Linux configuration info at: - # http://linuxreviews.org/howtos/xfree/mouse/ + # https://linuxreviews.org/HOWTO_change_the_mouse_speed_in_X bind Listbox <4> { if {!$tk_strictMotif} { %W yview scroll -5 units diff --git a/library/text.tcl b/library/text.tcl index ec8f3d3..d1f9b86 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -499,7 +499,7 @@ if {[tk windowingsystem] eq "x11"} { # Support for mousewheels on Linux/Unix commonly comes through mapping # the wheel to the extended buttons. If you have a mousewheel, find # Linux configuration info at: - # http://linuxreviews.org/howtos/xfree/mouse/ + # https://linuxreviews.org/HOWTO_change_the_mouse_speed_in_X bind Text <4> { if {!$tk_strictMotif} { %W yview scroll -50 pixels diff --git a/library/tk.tcl b/library/tk.tcl index 0715489..be934c1 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -460,7 +460,7 @@ switch -exact -- [tk windowingsystem] { event add <> # Official bindings - # See http://support.apple.com/kb/HT1343 + # See https://support.apple.com/en-us/HT201236 event add <> event add <> event add <> diff --git a/macosx/Credits.html.in b/macosx/Credits.html.in index cc409b1..1c14367 100644 --- a/macosx/Credits.html.in +++ b/macosx/Credits.html.in @@ -5,8 +5,8 @@

Tcl and Tk are distributed under a modified BSD license:
- - https:www.tcl.tk/software/tcltk/license.html + + https://www.tcl-lang.org/software/tcltk/license.html

    -- cgit v0.12 From d51463d25ae5593de66709ef25d113b57bd32f09 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Jun 2021 09:58:21 +0000 Subject: Fix [4a40353237]: Serious regression regarding ttk::notebook index validation --- generic/ttk/ttkManager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 0d41d21..c3257c3 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -452,7 +452,7 @@ int Ttk_GetContentIndexFromObj( /* Try interpreting as an integer first: */ if (TkGetIntForIndex(objPtr, mgr->nContent - 1, 1, &index) == TCL_OK) { - if (index + 1 > mgr->nContent + 1) { + if (index == TCL_INDEX_NONE || index > mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Managed window index %d out of bounds", (int)index)); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); -- cgit v0.12 From 33bdf9c83be075275d217b9fc75c158fae0c42e5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Jun 2021 11:30:29 +0000 Subject: Sync win/nmakehlp.c with Tcl --- win/nmakehlp.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 121 insertions(+), 17 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 0439d1c..4021346 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -14,13 +14,8 @@ #define _CRT_SECURE_NO_DEPRECATE #include -#define NO_SHLWAPI_GDI -#define NO_SHLWAPI_STREAM -#define NO_SHLWAPI_REG -#include #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") -#pragma comment (lib, "shlwapi.lib") #include #include @@ -39,7 +34,6 @@ #endif - /* protos */ static int CheckForCompilerFeature(const char *option); @@ -47,6 +41,7 @@ static int CheckForLinkerFeature(const char **options, int count); static int IsIn(const char *string, const char *substring); static int SubstituteFile(const char *substs, const char *filename); static int QualifyPath(const char *path); +static int LocateDependency(const char *keyfile); static const char *GetVersionFromFile(const char *filename, const char *match, int numdots); static DWORD WINAPI ReadFromPipe(LPVOID args); @@ -74,7 +69,7 @@ main( char msg[300]; DWORD dwWritten; int chars; - char *s; + const char *s; /* * Make sure children (cl.exe and link.exe) are kept quiet. @@ -172,6 +167,18 @@ main( return 2; } return QualifyPath(argv[2]); + + case 'L': + if (argc != 3) { + chars = snprintf(msg, sizeof(msg) - 1, + "usage: %s -L keypath\n" + "Emit the fully qualified path of directory containing keypath\n" + "exitcodes: 0 == success, 1 == not found, 2 == error\n", argv[0]); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, + &dwWritten, NULL); + return 2; + } + return LocateDependency(argv[2]); } } chars = snprintf(msg, sizeof(msg) - 1, @@ -530,7 +537,7 @@ GetVersionFromFile( ++q; } - memcpy(szBuffer, p, q - p); + memmove(szBuffer, p, q - p); szBuffer[q-p] = 0; szResult = szBuffer; break; @@ -636,7 +643,7 @@ SubstituteFile( } /* debug: dump the list */ -#ifdef _DEBUG +#ifndef NDEBUG { int n = 0; list_item_t *p = NULL; @@ -667,7 +674,7 @@ SubstituteFile( memcpy(szBuffer, szCopy, sizeof(szCopy)); } } - printf(szBuffer); + printf("%s", szBuffer); } list_free(&substPtr); @@ -676,6 +683,17 @@ SubstituteFile( return 0; } +BOOL FileExists(LPCTSTR szPath) +{ +#ifndef INVALID_FILE_ATTRIBUTES + #define INVALID_FILE_ATTRIBUTES ((DWORD)-1) +#endif + DWORD pathAttr = GetFileAttributes(szPath); + return (pathAttr != INVALID_FILE_ATTRIBUTES && + !(pathAttr & FILE_ATTRIBUTE_DIRECTORY)); +} + + /* * QualifyPath -- * @@ -689,18 +707,104 @@ QualifyPath( const char *szPath) { char szCwd[MAX_PATH + 1]; - char szTmp[MAX_PATH + 1]; - char *p; - GetCurrentDirectory(MAX_PATH, szCwd); - while ((p = strchr(szPath, '/')) && *p) - *p = '\\'; - PathCombine(szTmp, szCwd, szPath); - PathCanonicalize(szCwd, szTmp); + + GetFullPathName(szPath, sizeof(szCwd)-1, szCwd, NULL); printf("%s\n", szCwd); return 0; } /* + * Implements LocateDependency for a single directory. See that command + * for an explanation. + * Returns 0 if found after printing the directory. + * Returns 1 if not found but no errors. + * Returns 2 on any kind of error + * Basically, these are used as exit codes for the process. + */ +static int LocateDependencyHelper(const char *dir, const char *keypath) +{ + HANDLE hSearch; + char path[MAX_PATH+1]; + int dirlen, keylen, ret; + WIN32_FIND_DATA finfo; + + if (dir == NULL || keypath == NULL) + return 2; /* Have no real error reporting mechanism into nmake */ + dirlen = strlen(dir); + if ((dirlen + 3) > sizeof(path)) + return 2; + strncpy(path, dir, dirlen); + strncpy(path+dirlen, "\\*", 3); /* Including terminating \0 */ + keylen = strlen(keypath); + +#if 0 /* This function is not available in Visual C++ 6 */ + /* + * Use numerics 0 -> FindExInfoStandard, + * 1 -> FindExSearchLimitToDirectories, + * as these are not defined in Visual C++ 6 + */ + hSearch = FindFirstFileEx(path, 0, &finfo, 1, NULL, 0); +#else + hSearch = FindFirstFile(path, &finfo); +#endif + if (hSearch == INVALID_HANDLE_VALUE) + return 1; /* Not found */ + + /* Loop through all subdirs checking if the keypath is under there */ + ret = 1; /* Assume not found */ + do { + int sublen; + /* + * We need to check it is a directory despite the + * FindExSearchLimitToDirectories in the above call. See SDK docs + */ + if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) + continue; + sublen = strlen(finfo.cFileName); + if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) + continue; /* Path does not fit, assume not matched */ + strncpy(path+dirlen+1, finfo.cFileName, sublen); + path[dirlen+1+sublen] = '\\'; + strncpy(path+dirlen+1+sublen+1, keypath, keylen+1); + if (FileExists(path)) { + /* Found a match, print to stdout */ + path[dirlen+1+sublen] = '\0'; + QualifyPath(path); + ret = 0; + break; + } + } while (FindNextFile(hSearch, &finfo)); + FindClose(hSearch); + return ret; +} + +/* + * LocateDependency -- + * + * Locates a dependency for a package. + * keypath - a relative path within the package directory + * that is used to confirm it is the correct directory. + * The search path for the package directory is currently only + * the parent and grandparent of the current working directory. + * If found, the command prints + * name_DIRPATH= + * and returns 0. If not found, does not print anything and returns 1. + */ +static int LocateDependency(const char *keypath) +{ + int i, ret; + static const char *paths[] = {"..", "..\\..", "..\\..\\.."}; + + for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { + ret = LocateDependencyHelper(paths[i], keypath); + if (ret == 0) + return ret; + } + return ret; +} + + +/* * Local variables: * mode: c * c-basic-offset: 4 -- cgit v0.12 From 36b40e0e79cad925938b08e4d4bade6afa45f8a1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Jun 2021 13:24:24 +0000 Subject: Sync win/nmakehlp.c with Tcl (again) --- win/nmakehlp.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 4021346..2dc33cc 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -14,8 +14,10 @@ #define _CRT_SECURE_NO_DEPRECATE #include +#ifdef _MSC_VER #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") +#endif #include #include @@ -37,7 +39,7 @@ /* protos */ static int CheckForCompilerFeature(const char *option); -static int CheckForLinkerFeature(const char **options, int count); +static int CheckForLinkerFeature(char **options, int count); static int IsIn(const char *string, const char *substring); static int SubstituteFile(const char *substs, const char *filename); static int QualifyPath(const char *path); @@ -54,8 +56,8 @@ typedef struct { char buffer[STATICBUFFERSIZE]; } pipeinfo; -pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'}; -pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'}; +pipeinfo Out = {INVALID_HANDLE_VALUE, ""}; +pipeinfo Err = {INVALID_HANDLE_VALUE, ""}; /* * exitcodes: 0 == no, 1 == yes, 2 == error @@ -273,7 +275,7 @@ CheckForCompilerFeature( "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], + FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; @@ -326,7 +328,7 @@ CheckForCompilerFeature( static int CheckForLinkerFeature( - const char **options, + char **options, int count) { STARTUPINFO si; @@ -407,7 +409,7 @@ CheckForLinkerFeature( "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| - FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], + FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars], (300-chars), 0); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; @@ -503,7 +505,6 @@ GetVersionFromFile( const char *match, int numdots) { - size_t cbBuffer = 100; static char szBuffer[100]; char *szResult = NULL; FILE *fp = fopen(filename, "rt"); @@ -513,7 +514,7 @@ GetVersionFromFile( * Read data until we see our match string. */ - while (fgets(szBuffer, cbBuffer, fp) != NULL) { + while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { LPSTR p, q; p = strstr(szBuffer, match); @@ -523,7 +524,7 @@ GetVersionFromFile( */ p += strlen(match); - while (*p && !isdigit(*p)) { + while (*p && !isdigit((unsigned char)*p)) { ++p; } @@ -532,14 +533,13 @@ GetVersionFromFile( */ q = p; - while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q) - && (!strchr("ab", q[-1])) || --numdots))) { + while (*q && (strchr("0123456789.ab", *q)) && (((!strchr(".ab", *q) + && !strchr("ab", q[-1])) || --numdots))) { ++q; } - memmove(szBuffer, p, q - p); - szBuffer[q-p] = 0; - szResult = szBuffer; + *q = 0; + szResult = p; break; } } @@ -562,7 +562,7 @@ typedef struct list_item_t { static list_item_t * list_insert(list_item_t **listPtrPtr, const char *key, const char *value) { - list_item_t *itemPtr = malloc(sizeof(list_item_t)); + list_item_t *itemPtr = (list_item_t *)malloc(sizeof(list_item_t)); if (itemPtr) { itemPtr->key = strdup(key); itemPtr->value = strdup(value); @@ -611,9 +611,7 @@ SubstituteFile( const char *substitutions, const char *filename) { - size_t cbBuffer = 1024; static char szBuffer[1024], szCopy[1024]; - char *szResult = NULL; list_item_t *substPtr = NULL; FILE *fp, *sp; @@ -626,7 +624,7 @@ SubstituteFile( sp = fopen(substitutions, "rt"); if (sp != NULL) { - while (fgets(szBuffer, cbBuffer, sp) != NULL) { + while (fgets(szBuffer, sizeof(szBuffer), sp) != NULL) { unsigned char *ks, *ke, *vs, *ve; ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; @@ -657,7 +655,7 @@ SubstituteFile( * Run the substitutions over each line of the input */ - while (fgets(szBuffer, cbBuffer, fp) != NULL) { + while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { char *m = strstr(szBuffer, p->key); @@ -725,7 +723,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) { HANDLE hSearch; char path[MAX_PATH+1]; - int dirlen, keylen, ret; + size_t dirlen; + int keylen, ret; WIN32_FIND_DATA finfo; if (dir == NULL || keypath == NULL) @@ -792,7 +791,8 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) */ static int LocateDependency(const char *keypath) { - int i, ret; + size_t i; + int ret; static const char *paths[] = {"..", "..\\..", "..\\..\\.."}; for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { -- cgit v0.12 From 472a20da74ae386ba8360843638d81fceb84ed5a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Jun 2021 10:02:53 +0000 Subject: Fix [4efbfe2d6a]: Wrong order in winMain.c for TCL_USE_STATIC_PACKAGES --- win/winMain.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/win/winMain.c b/win/winMain.c index 3920801..14eb718 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -203,6 +203,17 @@ Tcl_AppInit( if ((Tcl_Init)(interp) == TCL_ERROR) { return TCL_ERROR; } +#if defined(STATIC_BUILD) && TCL_USE_STATIC_PACKAGES + if (Registry_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } + Tcl_StaticLibrary(interp, "Registry", Registry_Init, 0); + + if (Dde_Init(interp) == TCL_ERROR) { + return TCL_ERROR; + } + Tcl_StaticLibrary(interp, "Dde", Dde_Init, Dde_SafeInit); +#endif if (Tk_Init(interp) == TCL_ERROR) { return TCL_ERROR; } @@ -218,18 +229,6 @@ Tcl_AppInit( return TCL_ERROR; } } -#if defined(STATIC_BUILD) && TCL_USE_STATIC_PACKAGES - if (Registry_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticLibrary(interp, "Registry", Registry_Init, 0); - - if (Dde_Init(interp) == TCL_ERROR) { - return TCL_ERROR; - } - Tcl_StaticLibrary(interp, "Dde", Dde_Init, Dde_SafeInit); -#endif - #ifdef TK_TEST if (Tktest_Init(interp) == TCL_ERROR) { return TCL_ERROR; -- cgit v0.12 From 225fd19a0a1470dfc5cf8a3189aa8f2e270e85c8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Jun 2021 10:22:06 +0000 Subject: c++ fix in winMain.c --- win/winMain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win/winMain.c b/win/winMain.c index 6583a64..9c23037 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -28,10 +28,11 @@ int _CRT_glob = 0; #endif /* __GNUC__ */ -#ifdef TK_TEST #ifdef __cplusplus extern "C" { #endif + +#ifdef TK_TEST extern Tcl_LibraryInitProc Tktest_Init; #endif /* TK_TEST */ -- cgit v0.12