Diff
Not logged in

Differences From Artifact [e3b0ac4884]:

To Artifact [f289098ae1]:


697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
 *
 *---------------------------------------------------------------------------
 */

Tcl_UniChar
Tcl_UniCharAtIndex(
    register const char *src,	/* The UTF-8 string to dereference. */
    register int index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;

    while (index >= 0) {
	index--;
	src += TclUtfToUniChar(src, &ch);
    }
    return ch;
}

/*
 *---------------------------------------------------------------------------







|



|
<







697
698
699
700
701
702
703
704
705
706
707
708

709
710
711
712
713
714
715
 *
 *---------------------------------------------------------------------------
 */

Tcl_UniChar
Tcl_UniCharAtIndex(
    register const char *src,	/* The UTF-8 string to dereference. */
    register size_t index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;

    while (index--) {

	src += TclUtfToUniChar(src, &ch);
    }
    return ch;
}

/*
 *---------------------------------------------------------------------------
728
729
730
731
732
733
734
735
736
737
738
739
740
741

742
743
744
745
746
747
748
 *
 *---------------------------------------------------------------------------
 */

const char *
Tcl_UtfAtIndex(
    register const char *src,	/* The UTF-8 string. */
    register int index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;

    while (index > 0) {
	index--;
	src += TclUtfToUniChar(src, &ch);

    }
    return src;
}

/*
 *---------------------------------------------------------------------------
 *







|



|
|
|
>







727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
 *
 *---------------------------------------------------------------------------
 */

const char *
Tcl_UtfAtIndex(
    register const char *src,	/* The UTF-8 string. */
    register size_t index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;

    if (index != (size_t)-1) {
	while (index--) {
	    src += TclUtfToUniChar(src, &ch);
	}
    }
    return src;
}

/*
 *---------------------------------------------------------------------------
 *