Tcl Source Code

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

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

Overview
Comment:merge core-8-6-branch
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0a9475dd06be3e8975e79c224dec4fa679d24ca5
User & Date: jan.nijtmans 2017-06-08 12:53:31
Context
2017-06-08
20:49
Make read and write operations on Tcl_Var handles available in tclInt API. check-in: 2487a9bc13 user: dkf tags: trunk
20:38
Create new branch named "tip-452" check-in: 0aad28628c user: gerald tags: tip-452
16:48
merge trunk check-in: 260be46929 user: dgp tags: dgp-stringcat-delaystringrep
12:59
merge trunk check-in: 7b30d63181 user: jan.nijtmans tags: novem
12:53
merge core-8-6-branch check-in: 0a9475dd06 user: jan.nijtmans tags: trunk
12:50
Revert part of [95d096e0378b460c6c5168bb55bb2ca8b2fd799e|95d096e037]: Missed the fact that tolower()... check-in: 9d00eb3607 user: jan.nijtmans tags: core-8-6-branch
12:38
merge core-8-6-branch check-in: 9053c4a54f user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclUtil.c.

2158
2159
2160
2161
2162
2163
2164




2165
2166
2167

2168
2169
2170
2171
2172
2173
2174
....
2226
2227
2228
2229
2230
2231
2232





2233
2234
2235

2236
2237
2238
2239
2240





2241
2242
2243

2244
2245
2246
2247
2248
2249





2250
2251
2252

2253
2254
2255
2256
2257
2258
2259
		return 1;
	    }

	    /*
	     * This is a special case optimization for single-byte utf.
	     */





	    TclUtfToUniChar(pattern, &ch2);
	    if (nocase) {
		ch2 = Tcl_UniCharToLower(ch2);

	    }

	    while (1) {
		/*
		 * Optimization for matching - cruise through the string
		 * quickly if the next char in the pattern isn't a special
		 * character
................................................................................
	 * characters separated by "-").
	 */

	if (p == '[') {
	    Tcl_UniChar startChar, endChar;

	    pattern++;





	    str += TclUtfToUniChar(str, &ch1);
	    if (nocase) {
		ch1 = Tcl_UniCharToLower(ch1);

	    }
	    while (1) {
		if ((*pattern == ']') || (*pattern == '\0')) {
		    return 0;
		}





		pattern += TclUtfToUniChar(pattern, &startChar);
		if (nocase) {
		    startChar = Tcl_UniCharToLower(startChar);

		}
		if (*pattern == '-') {
		    pattern++;
		    if (*pattern == '\0') {
			return 0;
		    }





		    pattern += TclUtfToUniChar(pattern, &endChar);
		    if (nocase) {
			endChar = Tcl_UniCharToLower(endChar);

		    }
		    if (((startChar <= ch1) && (ch1 <= endChar))
			    || ((endChar <= ch1) && (ch1 <= startChar))) {
			/*
			 * Matches ranges of form [a-z] or [z-a].
			 */







>
>
>
>
|
|
|
>







 







>
>
>
>
>
|
|
|
>





>
>
>
>
>
|
|
|
>






>
>
>
>
>
|
|
|
>







2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
....
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
		return 1;
	    }

	    /*
	     * This is a special case optimization for single-byte utf.
	     */

	    if (UCHAR(*pattern) < 0x80) {
		ch2 = (Tcl_UniChar)
			(nocase ? tolower(UCHAR(*pattern)) : UCHAR(*pattern));
	    } else {
		Tcl_UtfToUniChar(pattern, &ch2);
		if (nocase) {
		    ch2 = Tcl_UniCharToLower(ch2);
		}
	    }

	    while (1) {
		/*
		 * Optimization for matching - cruise through the string
		 * quickly if the next char in the pattern isn't a special
		 * character
................................................................................
	 * characters separated by "-").
	 */

	if (p == '[') {
	    Tcl_UniChar startChar, endChar;

	    pattern++;
	    if (UCHAR(*str) < 0x80) {
		ch1 = (Tcl_UniChar)
			(nocase ? tolower(UCHAR(*str)) : UCHAR(*str));
		str++;
	    } else {
		str += Tcl_UtfToUniChar(str, &ch1);
		if (nocase) {
		    ch1 = Tcl_UniCharToLower(ch1);
		}
	    }
	    while (1) {
		if ((*pattern == ']') || (*pattern == '\0')) {
		    return 0;
		}
		if (UCHAR(*pattern) < 0x80) {
		    startChar = (Tcl_UniChar) (nocase
			    ? tolower(UCHAR(*pattern)) : UCHAR(*pattern));
		    pattern++;
		} else {
		    pattern += Tcl_UtfToUniChar(pattern, &startChar);
		    if (nocase) {
			startChar = Tcl_UniCharToLower(startChar);
		    }
		}
		if (*pattern == '-') {
		    pattern++;
		    if (*pattern == '\0') {
			return 0;
		    }
		    if (UCHAR(*pattern) < 0x80) {
			endChar = (Tcl_UniChar) (nocase
				? tolower(UCHAR(*pattern)) : UCHAR(*pattern));
			pattern++;
		    } else {
			pattern += Tcl_UtfToUniChar(pattern, &endChar);
			if (nocase) {
			    endChar = Tcl_UniCharToLower(endChar);
			}
		    }
		    if (((startChar <= ch1) && (ch1 <= endChar))
			    || ((endChar <= ch1) && (ch1 <= startChar))) {
			/*
			 * Matches ranges of form [a-z] or [z-a].
			 */