Tcl Source Code

Check-in [bb9b52ab82]
Login

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

Overview
Comment:Merge 8.7
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bb9b52ab82d48e8723b604fea7d0848e9062207c5df75e78b70aedce311f442b
User & Date: jan.nijtmans 2019-03-20 22:51:17.447
Context
2019-03-21
20:11
Merge 8.7 check-in: 871076a655 user: jan.nijtmans tags: trunk
2019-03-20
22:51
Merge 8.7 check-in: bb9b52ab82 user: jan.nijtmans tags: trunk
22:45
Fix Tcl_UtfToUniCharDString() function, handling invalid byte at the end of the string: Not quite co... check-in: 3e8ada19f5 user: jan.nijtmans tags: core-8-branch
2019-03-18
22:34
Merge 8.7 check-in: 48c676b649 user: jan.nijtmans tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tclUtf.c.
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
	    if ((unsigned)(*chPtr - 0x10000) <= 0xFFFFF) {
		return 4;
	    }
#endif
	}

	/*
	 * A four-byte-character lead-byte not followed by two trail-bytes
	 * represents itself.
	 */
    }

    *chPtr = byte;
    return 1;
}







|







450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
	    if ((unsigned)(*chPtr - 0x10000) <= 0xFFFFF) {
		return 4;
	    }
#endif
	}

	/*
	 * A four-byte-character lead-byte not followed by three trail-bytes
	 * represents itself.
	 */
    }

    *chPtr = byte;
    return 1;
}
616
617
618
619
620
621
622


623
624
625
626
627
628
629
630
631
632
633
    end = src + length - 4;
    while (p < end) {
	p += TclUtfToUniChar(p, &ch);
	*w++ = ch;
    }
    end += 4;
    while (p < end) {


	if (Tcl_UtfCharComplete(p, end-p)) {
	    p += TclUtfToUniChar(p, &ch);
	} else if (((UCHAR(*p)-0x80)) < 0x20) {
	    ch = cp1252[UCHAR(*p++)-0x80];
	} else {
	    ch = UCHAR(*p++);
	}
	*w++ = ch;
    }
    *w = '\0';
    Tcl_DStringSetLength(dsPtr,







>
>
|

<
<







616
617
618
619
620
621
622
623
624
625
626


627
628
629
630
631
632
633
    end = src + length - 4;
    while (p < end) {
	p += TclUtfToUniChar(p, &ch);
	*w++ = ch;
    }
    end += 4;
    while (p < end) {
	if (((unsigned)(UCHAR(*p)-0x80)) < 0x20) {
	    ch = cp1252[UCHAR(*p++)-0x80];
	} else if (Tcl_UtfCharComplete(p, end-p)) {
	    p += TclUtfToUniChar(p, &ch);


	} else {
	    ch = UCHAR(*p++);
	}
	*w++ = ch;
    }
    *w = '\0';
    Tcl_DStringSetLength(dsPtr,
670
671
672
673
674
675
676


677
678
679
680
681
682
683
684
685
686
687
    end = src + length - 4;
    while (p < end) {
	p += TclUtfToWChar(p, &ch);
	*w++ = ch;
    }
    end += 4;
    while (p < end) {


	if (Tcl_UtfCharComplete(p, end-p)) {
	    p += TclUtfToWChar(p, &ch);
	} else if (((UCHAR(*p)-0x80)) < 0x20) {
	    ch = cp1252[UCHAR(*p++)-0x80];
	} else {
	    ch = UCHAR(*p++);
	}
	*w++ = ch;
    }
    *w = '\0';
    Tcl_DStringSetLength(dsPtr,







>
>
|
|
<
<







670
671
672
673
674
675
676
677
678
679
680


681
682
683
684
685
686
687
    end = src + length - 4;
    while (p < end) {
	p += TclUtfToWChar(p, &ch);
	*w++ = ch;
    }
    end += 4;
    while (p < end) {
	if (((unsigned)(UCHAR(*p)-0x80)) < 0x20) {
	    ch = cp1252[UCHAR(*p++)-0x80];
	} else if (Tcl_UtfCharComplete(p, end-p)) {
		    p += TclUtfToWChar(p, &ch);


	} else {
	    ch = UCHAR(*p++);
	}
	*w++ = ch;
    }
    *w = '\0';
    Tcl_DStringSetLength(dsPtr,