summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/tcltk-man2html-utils.tcl2
-rwxr-xr-xtools/tcltk-man2html.tcl2
-rw-r--r--unix/Makefile.in2
-rw-r--r--win/Makefile.in2
-rw-r--r--win/makefile.vc2
-rw-r--r--win/tclWinDde.c19
6 files changed, 16 insertions, 13 deletions
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index 78aa8ec..c658d71 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -1271,7 +1271,7 @@ proc output-directive {line} {
##
proc merge-copyrights {l1 l2} {
set merge {}
- set re1 {^Copyright +(?:\(c\)|\\\(co|©) +(\w.*?)(?:all rights reserved)?(?:\. )*$}
+ set re1 {^Copyright +(?:\(c\)|\\\(co|©|©) +(\w.*?)(?:all rights reserved)?(?:\. )*$}
set re2 {^(\d+) +(?:by +)?(\w.*)$} ;# date who
set re3 {^(\d+)-(\d+) +(?:by +)?(\w.*)$} ;# from to who
set re4 {^(\d+), *(\d+) +(?:by +)?(\w.*)$} ;# date1 date2 who
diff --git a/tools/tcltk-man2html.tcl b/tools/tcltk-man2html.tcl
index f4466b5..7c45fa9 100755
--- a/tools/tcltk-man2html.tcl
+++ b/tools/tcltk-man2html.tcl
@@ -29,7 +29,7 @@ set ::CSSFILE "docs.css"
## Source the utility functions that provide most of the
## implementation of the transformation from nroff to html.
##
-source [file join [file dirname [info script]] tcltk-man2html-utils.tcl]
+source -encoding utf-8 [file join [file dirname [info script]] tcltk-man2html-utils.tcl]
proc getversion {tclh {name {}}} {
if {[file exists $tclh]} {
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 48837e4..e7dee7a 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -2445,7 +2445,7 @@ html-tk: ${NATIVE_TCLSH}
@EXTRA_BUILD_HTML@
BUILD_HTML = \
- @${NATIVE_TCLSH} $(TOOL_DIR)/tcltk-man2html.tcl \
+ @${NATIVE_TCLSH} -encoding utf-8 $(TOOL_DIR)/tcltk-man2html.tcl \
--useversion=$(MAJOR_VERSION).$(MINOR_VERSION) \
--htmldir="$(HTML_INSTALL_DIR)" \
--srcdir=$(TOP_DIR) $(BUILD_HTML_FLAGS)
diff --git a/win/Makefile.in b/win/Makefile.in
index 1c74b4f..2713e73 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -1009,7 +1009,7 @@ runtest: tcltest
# `make shell SCRIPT=foo.tcl`
shell: binaries
@TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \
- $(WINE) ./$(TCLSH) $(SCRIPT)
+ $(WINE) ./$(TCLSH) -encoding utf-8 $(SCRIPT)
# This target can be used to run tclsh inside either gdb or insight
gdb: binaries
diff --git a/win/makefile.vc b/win/makefile.vc
index 1124788..e5f0b43 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -676,7 +676,7 @@ CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm
htmlhelp: chmsetup $(CHMFILE)
$(CHMFILE): $(DOCDIR)\*
- @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl "--htmldir=$(HTMLDIR)"
+ @$(TCLSH) -encoding utf-8 $(TOOLSDIR)\tcltk-man2html.tcl "--htmldir=$(HTMLDIR)"
@echo Compiling HTML help project
-"$(HHC)" <<$(HHPFILE) >NUL
[OPTIONS]
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index 697aae6..3377bfa 100644
--- a/win/tclWinDde.c
+++ b/win/tclWinDde.c
@@ -313,12 +313,12 @@ DdeSetServerName(
Tcl_Obj *handlerPtr) /* Name of the optional proc/command to handle
* incoming Dde eval's */
{
- int suffix, offset;
+ int suffix;
RegisteredInterp *riPtr, *prevPtr;
Tcl_DString dString;
const WCHAR *actualName;
Tcl_Obj *srvListPtr = NULL, **srvPtrPtr = NULL;
- Tcl_Size n, srvCount = 0;
+ Tcl_Size n, srvCount = 0, offset;
int lastSuffix, r = TCL_OK;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
@@ -942,8 +942,8 @@ DdeServerProc(
*/
HSZPAIR *returnPtr;
- int i;
- int numItems;
+ Tcl_Size i;
+ DWORD numItems;
for (i = 0, riPtr = tsdPtr->interpListPtr; riPtr != NULL;
i++, riPtr = riPtr->nextPtr) {
@@ -952,12 +952,15 @@ DdeServerProc(
*/
}
- numItems = i;
+ if ((size_t)i >= UINT_MAX/sizeof(HSZPAIR)) {
+ return NULL;
+ }
+ numItems = (DWORD)i;
ddeReturn = DdeCreateDataHandle(ddeInstance, NULL,
- (numItems + 1) * sizeof(HSZPAIR), 0, 0, 0, 0);
+ (numItems + 1) * (DWORD)sizeof(HSZPAIR), 0, 0, 0, 0);
returnPtr = (HSZPAIR *) DdeAccessData(ddeReturn, &dlen);
len = dlen;
- for (i = 0, riPtr = tsdPtr->interpListPtr; i < numItems;
+ for (i = 0, riPtr = tsdPtr->interpListPtr; i < (Tcl_Size)numItems;
i++, riPtr = riPtr->nextPtr) {
returnPtr[i].hszSvc = DdeCreateStringHandleW(ddeInstance,
TCL_DDE_SERVICE_NAME, CP_WINUNICODE);
@@ -1645,7 +1648,7 @@ DdeObjCmd(
if ((tmp >= sizeof(WCHAR))
&& !dataString[tmp / sizeof(WCHAR) - 1]) {
- tmp -= sizeof(WCHAR);
+ tmp -= (DWORD)sizeof(WCHAR);
}
Tcl_DStringInit(&dsBuf);
Tcl_WCharToUtfDString(dataString, tmp>>1, &dsBuf);