Tcl Source Code

Check-in [ad24e66451]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge core-8-branch. Remove left-over debugging code. Test-case string-5.21 still fails.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-389
Files: files | file ages | folders
SHA3-256:ad24e66451653c3f96c2530a6a225601eb342c1a4c42df5cb74dd27984012861
User & Date: jan.nijtmans 2018-01-11 15:59:17
Context
2018-01-12
10:03
Fix [11ae2be95d]: tip-389 branch: string range errors with code points greater than U+FFFF check-in: de13f558fb user: jan.nijtmans tags: tip-389
2018-01-11
15:59
merge core-8-branch. Remove left-over debugging code. Test-case string-5.21 still fails. check-in: ad24e66451 user: jan.nijtmans tags: tip-389
15:45
merge core-8-6-branch check-in: a0d51b9a0e user: jan.nijtmans tags: core-8-branch
14:11
Add test-cases for bug [11ae2be95dac9417], and make a start fixing it. Almost works. check-in: 6758341b2f user: jan.nijtmans tags: tip-389
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclCmdMZ.c.

1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
    if (TclGetIntForIndexM(interp, objv[2], length-1, &index) != TCL_OK) {
	return TCL_ERROR;
    }

    if ((index >= 0) && (index < length)) {
	int ch = Tcl_GetUniChar(objv[1], index);

	if (ch >= 0x10000) {
	    printf("HI: %x\n", ch);
	}
	if (ch == -1) {
	    printf("LO: %x\n", ch);
	    return TCL_OK;
	}

	/*
	 * If we have a ByteArray object, we're careful to generate a new
	 * bytearray for a result.
	 */







<
<
<

<







1442
1443
1444
1445
1446
1447
1448



1449

1450
1451
1452
1453
1454
1455
1456
    if (TclGetIntForIndexM(interp, objv[2], length-1, &index) != TCL_OK) {
	return TCL_ERROR;
    }

    if ((index >= 0) && (index < length)) {
	int ch = Tcl_GetUniChar(objv[1], index);




	if (ch == -1) {

	    return TCL_OK;
	}

	/*
	 * If we have a ByteArray object, we're careful to generate a new
	 * bytearray for a result.
	 */

Changes to generic/tclStringObj.c.

536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
/*
 *----------------------------------------------------------------------
 *
 * Tcl_GetUnicode --
 *
 *	Get the Unicode form of the String object. If the object is not
 *	already a String object, it will be converted to one. If the String
 *	object does not have a Unicode rep, then one is create from the UTF
 *	string format.
 *
 * Results:
 *	Returns a pointer to the object's internal Unicode string.
 *
 * Side effects:
 *	Converts the object to have the String internal rep.







|







536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
/*
 *----------------------------------------------------------------------
 *
 * Tcl_GetUnicode --
 *
 *	Get the Unicode form of the String object. If the object is not
 *	already a String object, it will be converted to one. If the String
 *	object does not have a Unicode rep, then one is created from the UTF
 *	string format.
 *
 * Results:
 *	Returns a pointer to the object's internal Unicode string.
 *
 * Side effects:
 *	Converts the object to have the String internal rep.