| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8c6dc62 commit 9e7f863
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1125,8 +1125,8 @@ def glob_to_var(dir_base, dir_sub, patch_dir): | |||
| 1125 | 1125 | def configure_intl(o): | |
| 1126 | 1126 | icus = [ | |
| 1127 | 1127 | { | |
| 1128 | - 'url': 'https://ssl.icu-project.org/files/icu4c/60.1/icu4c-60_1-src.zip', | ||
| 1129 | - 'md5': 'e6cb990ac2a3161d31a3def8435f80cb', | ||
| 1128 | + 'url': 'https://ssl.icu-project.org/files/icu4c/60.2/icu4c-60_2-src.zip', | ||
| 1129 | + 'md5': '115908818fd0324530b2acb1b029738d', | ||
| 1130 | 1130 | }, | |
| 1131 | 1131 | ] | |
| 1132 | 1132 | def icu_download(path): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,7 +121,7 @@ class RuleBasedBreakIterator::BreakCache: public UMemory { | |||
| 121 | 121 | * If the requested position is a break boundary, leave the iteration | |
| 122 | 122 | * position on it. | |
| 123 | 123 | * If the requested position is not a boundary, leave the iteration | |
| 124 | - * position on the preceding boundary and include both the the | ||
| 124 | + * position on the preceding boundary and include both the | ||
| 125 | 125 | * preceding and following boundaries in the cache. | |
| 126 | 126 | * Additional boundaries, either preceding or following, may be added | |
| 127 | 127 | * to the cache as a side effect. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ | |||
| 28 | 28 | #include "unicode/utf.h" | |
| 29 | 29 | #include "unicode/utf8.h" | |
| 30 | 30 | #include "unicode/utf16.h" | |
| 31 | + #include "uassert.h" | ||
| 31 | 32 | #include "ucnv_bld.h" | |
| 32 | 33 | #include "ucnv_cnv.h" | |
| 33 | 34 | #include "cmemory.h" | |
@@ -694,7 +695,9 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, | |||
| 694 | 695 | // Use a single counter for source and target, counting the minimum of | |
| 695 | 696 | // the source length and the target capacity. | |
| 696 | 697 | // Let the standard converter handle edge cases. | |
| 698 | + const uint8_t *limit=sourceLimit; | ||
| 697 | 699 | if(count>targetCapacity) { | |
| 700 | + limit-=(count-targetCapacity); | ||
| 698 | 701 | count=targetCapacity; | |
| 699 | 702 | } | |
| 700 | 703 | ||
@@ -707,11 +710,11 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, | |||
| 707 | 710 | // sequence from the previous buffer. | |
| 708 | 711 | int32_t length=count-toULimit; | |
| 709 | 712 | if(length>0) { | |
| 710 | - uint8_t b1=*(sourceLimit-1); | ||
| 713 | + uint8_t b1=*(limit-1); | ||
| 711 | 714 | if(U8_IS_SINGLE(b1)) { | |
| 712 | 715 | // common ASCII character | |
| 713 | 716 | } else if(U8_IS_TRAIL(b1) && length>=2) { | |
| 714 | - uint8_t b2=*(sourceLimit-2); | ||
| 717 | + uint8_t b2=*(limit-2); | ||
| 715 | 718 | if(0xe0<=b2 && b2<0xf0 && U8_IS_VALID_LEAD3_AND_T1(b2, b1)) { | |
| 716 | 719 | // truncated 3-byte sequence | |
| 717 | 720 | count-=2; | |
@@ -811,7 +814,7 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, | |||
| 811 | 814 | } | |
| 812 | 815 | ||
| 813 | 816 | /* copy the legal byte sequence to the target */ | |
| 814 | - { | ||
| 817 | + if(count>=toULength) { | ||
| 815 | 818 | int8_t i; | |
| 816 | 819 | ||
| 817 | 820 | for(i=0; i<oldToULength; ++i) { | |
@@ -822,9 +825,18 @@ ucnv_UTF8FromUTF8(UConverterFromUnicodeArgs *pFromUArgs, | |||
| 822 | 825 | *target++=*source++; | |
| 823 | 826 | } | |
| 824 | 827 | count-=toULength; | |
| 828 | + } else { | ||
| 829 | + // A supplementary character that does not fit into the target. | ||
| 830 | + // Let the standard converter handle this. | ||
| 831 | + source-=(toULength-oldToULength); | ||
| 832 | + pToUArgs->source=(char *)source; | ||
| 833 | + pFromUArgs->target=(char *)target; | ||
| 834 | + *pErrorCode=U_USING_DEFAULT_WARNING; | ||
| 835 | + return; | ||
| 825 | 836 | } | |
| 826 | 837 | } | |
| 827 | 838 | } | |
| 839 | + U_ASSERT(count>=0); | ||
| 828 | 840 | ||
| 829 | 841 | if(U_SUCCESS(*pErrorCode) && source<sourceLimit) { | |
| 830 | 842 | if(target==(const uint8_t *)pFromUArgs->targetLimit) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -292,7 +292,7 @@ class U_COMMON_API BreakIterator : public UObject { | |||
| 292 | 292 | * does nothing. Negative values move to previous boundaries | |
| 293 | 293 | * and positive values move to later boundaries. | |
| 294 | 294 | * @return The new iterator position, or | |
| 295 | - * DONE if there are fewer than |n| boundaries in the specfied direction. | ||
| 295 | + * DONE if there are fewer than |n| boundaries in the specified direction. | ||
| 296 | 296 | * @stable ICU 2.0 | |
| 297 | 297 | */ | |
| 298 | 298 | virtual int32_t next(int32_t n) = 0; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,7 @@ | |||
| 29 | 29 | * converter, you can get its properties, set options, convert your data and | |
| 30 | 30 | * close the converter.</p> | |
| 31 | 31 | * | |
| 32 | - * <p>Since many software programs recogize different converter names for | ||
| 32 | + * <p>Since many software programs recognize different converter names for | ||
| 33 | 33 | * different types of converters, there are other functions in this API to | |
| 34 | 34 | * iterate over the converter aliases. The functions {@link ucnv_getAvailableName() }, | |
| 35 | 35 | * {@link ucnv_getAlias() } and {@link ucnv_getStandardName() } are some of the | |
@@ -184,7 +184,7 @@ typedef enum { | |||
| 184 | 184 | ||
| 185 | 185 | /** | |
| 186 | 186 | * Function pointer for error callback in the codepage to unicode direction. | |
| 187 | - * Called when an error has occured in conversion to unicode, or on open/close of the callback (see reason). | ||
| 187 | + * Called when an error has occurred in conversion to unicode, or on open/close of the callback (see reason). | ||
| 188 | 188 | * @param context Pointer to the callback's private data | |
| 189 | 189 | * @param args Information about the conversion in progress | |
| 190 | 190 | * @param codeUnits Points to 'length' bytes of the concerned codepage sequence | |
@@ -452,7 +452,7 @@ ucnv_openU(const UChar *name, | |||
| 452 | 452 | * @param platform the platform in which the codepage number exists | |
| 453 | 453 | * @param err error status <TT>U_MEMORY_ALLOCATION_ERROR, U_FILE_ACCESS_ERROR</TT> | |
| 454 | 454 | * @return the created Unicode converter object, or <TT>NULL</TT> if an error | |
| 455 | - * occured. | ||
| 455 | + * occurred. | ||
| 456 | 456 | * @see ucnv_open | |
| 457 | 457 | * @see ucnv_openU | |
| 458 | 458 | * @see ucnv_close | |
@@ -596,7 +596,7 @@ U_NAMESPACE_END | |||
| 596 | 596 | * stateful, then subChars will be an empty string. | |
| 597 | 597 | * | |
| 598 | 598 | * @param converter the Unicode converter | |
| 599 | - * @param subChars the subsitution characters | ||
| 599 | + * @param subChars the substitution characters | ||
| 600 | 600 | * @param len on input the capacity of subChars, on output the number | |
| 601 | 601 | * of bytes copied to it | |
| 602 | 602 | * @param err the outgoing error status code. | |
@@ -832,7 +832,7 @@ ucnv_getMinCharSize(const UConverter *converter); | |||
| 832 | 832 | * name will be filled in. | |
| 833 | 833 | * | |
| 834 | 834 | * @param converter the Unicode converter. | |
| 835 | - * @param displayLocale is the specific Locale we want to localised for | ||
| 835 | + * @param displayLocale is the specific Locale we want to localized for | ||
| 836 | 836 | * @param displayName user provided buffer to be filled in | |
| 837 | 837 | * @param displayNameCapacity size of displayName Buffer | |
| 838 | 838 | * @param err error status code | |
@@ -877,7 +877,7 @@ ucnv_getName(const UConverter *converter, UErrorCode *err); | |||
| 877 | 877 | * | |
| 878 | 878 | * @param converter the Unicode converter | |
| 879 | 879 | * @param err the error status code. | |
| 880 | - * @return If any error occurrs, -1 will be returned otherwise, the codepage number | ||
| 880 | + * @return If any error occurs, -1 will be returned otherwise, the codepage number | ||
| 881 | 881 | * will be returned | |
| 882 | 882 | * @see ucnv_openCCSID | |
| 883 | 883 | * @see ucnv_getPlatform | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -389,7 +389,7 @@ utext_equals(const UText *a, const UText *b); | |||
| 389 | 389 | ||
| 390 | 390 | /***************************************************************************** | |
| 391 | 391 | * | |
| 392 | - * Functions to work with the text represeted by a UText wrapper | ||
| 392 | + * Functions to work with the text represented by a UText wrapper | ||
| 393 | 393 | * | |
| 394 | 394 | *****************************************************************************/ | |
| 395 | 395 | ||
@@ -433,7 +433,7 @@ utext_isLengthExpensive(const UText *ut); | |||
| 433 | 433 | * | |
| 434 | 434 | * The iteration position will be set to the start of the returned code point. | |
| 435 | 435 | * | |
| 436 | - * This function is roughly equivalent to the the sequence | ||
| 436 | + * This function is roughly equivalent to the sequence | ||
| 437 | 437 | * utext_setNativeIndex(index); | |
| 438 | 438 | * utext_current32(); | |
| 439 | 439 | * (There is a subtle difference if the index is out of bounds by being less than zero - | |
@@ -592,7 +592,7 @@ U_STABLE void U_EXPORT2 | |||
| 592 | 592 | utext_setNativeIndex(UText *ut, int64_t nativeIndex); | |
| 593 | 593 | ||
| 594 | 594 | /** | |
| 595 | - * Move the iterator postion by delta code points. The number of code points | ||
| 595 | + * Move the iterator position by delta code points. The number of code points | ||
| 596 | 596 | * is a signed number; a negative delta will move the iterator backwards, | |
| 597 | 597 | * towards the start of the text. | |
| 598 | 598 | * <p> | |
@@ -611,7 +611,7 @@ U_STABLE UBool U_EXPORT2 | |||
| 611 | 611 | utext_moveIndex32(UText *ut, int32_t delta); | |
| 612 | 612 | ||
| 613 | 613 | /** | |
| 614 | - * Get the native index of the character preceeding the current position. | ||
| 614 | + * Get the native index of the character preceding the current position. | ||
| 615 | 615 | * If the iteration position is already at the start of the text, zero | |
| 616 | 616 | * is returned. | |
| 617 | 617 | * The value returned is the same as that obtained from the following sequence, | |
@@ -628,7 +628,7 @@ utext_moveIndex32(UText *ut, int32_t delta); | |||
| 628 | 628 | * native index of the character most recently returned from utext_next(). | |
| 629 | 629 | * | |
| 630 | 630 | * @param ut the text to be accessed | |
| 631 | - * @return the native index of the character preceeding the current index position, | ||
| 631 | + * @return the native index of the character preceding the current index position, | ||
| 632 | 632 | * or zero if the current position is at the start of the text. | |
| 633 | 633 | * @stable ICU 3.6 | |
| 634 | 634 | */ | |
@@ -1054,7 +1054,7 @@ UTextAccess(UText *ut, int64_t nativeIndex, UBool forward); | |||
| 1054 | 1054 | * be NUL-terminated if there is sufficient space in the destination buffer. | |
| 1055 | 1055 | * | |
| 1056 | 1056 | * @param ut the UText from which to extract data. | |
| 1057 | - * @param nativeStart the native index of the first characer to extract. | ||
| 1057 | + * @param nativeStart the native index of the first character to extract. | ||
| 1058 | 1058 | * @param nativeLimit the native string index of the position following the last | |
| 1059 | 1059 | * character to extract. | |
| 1060 | 1060 | * @param dest the UChar (UTF-16) buffer into which the extracted text is placed | |
@@ -1211,7 +1211,7 @@ UTextClose(UText *ut); | |||
| 1211 | 1211 | struct UTextFuncs { | |
| 1212 | 1212 | /** | |
| 1213 | 1213 | * (public) Function table size, sizeof(UTextFuncs) | |
| 1214 | - * Intended for use should the table grow to accomodate added | ||
| 1214 | + * Intended for use should the table grow to accommodate added | ||
| 1215 | 1215 | * functions in the future, to allow tests for older format | |
| 1216 | 1216 | * function tables that do not contain the extensions. | |
| 1217 | 1217 | * | |
@@ -1345,7 +1345,7 @@ typedef struct UTextFuncs UTextFuncs; | |||
| 1345 | 1345 | struct UText { | |
| 1346 | 1346 | /** | |
| 1347 | 1347 | * (private) Magic. Used to help detect when UText functions are handed | |
| 1348 | - * invalid or unitialized UText structs. | ||
| 1348 | + * invalid or uninitialized UText structs. | ||
| 1349 | 1349 | * utext_openXYZ() functions take an initialized, | |
| 1350 | 1350 | * but not necessarily open, UText struct as an | |
| 1351 | 1351 | * optional fill-in parameter. This magic field | |
@@ -1367,7 +1367,7 @@ struct UText { | |||
| 1367 | 1367 | ||
| 1368 | 1368 | ||
| 1369 | 1369 | /** | |
| 1370 | - * Text provider properties. This set of flags is maintainted by the | ||
| 1370 | + * Text provider properties. This set of flags is maintained by the | ||
| 1371 | 1371 | * text provider implementation. | |
| 1372 | 1372 | * @stable ICU 3.4 | |
| 1373 | 1373 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,7 +64,7 @@ | |||
| 64 | 64 | * This value will change in the subsequent releases of ICU | |
| 65 | 65 | * @stable ICU 2.6 | |
| 66 | 66 | */ | |
| 67 | - #define U_ICU_VERSION_MINOR_NUM 1 | ||
| 67 | + #define U_ICU_VERSION_MINOR_NUM 2 | ||
| 68 | 68 | ||
| 69 | 69 | /** The current ICU patchlevel version as an integer. | |
| 70 | 70 | * This value will change in the subsequent releases of ICU | |
@@ -119,7 +119,7 @@ | |||
| 119 | 119 | * This value will change in the subsequent releases of ICU | |
| 120 | 120 | * @stable ICU 2.4 | |
| 121 | 121 | */ | |
| 122 | - #define U_ICU_VERSION "60.1" | ||
| 122 | + #define U_ICU_VERSION "60.2" | ||
| 123 | 123 | ||
| 124 | 124 | /** The current ICU library major/minor version as a string without dots, for library name suffixes. | |
| 125 | 125 | * This value will change in the subsequent releases of ICU | |
@@ -131,7 +131,7 @@ | |||
| 131 | 131 | /** Data version in ICU4C. | |
| 132 | 132 | * @internal ICU 4.4 Internal Use Only | |
| 133 | 133 | **/ | |
| 134 | - #define U_ICU_DATA_VERSION "60.1" | ||
| 134 | + #define U_ICU_DATA_VERSION "60.2" | ||
| 135 | 135 | #endif /* U_HIDE_INTERNAL_API */ | |
| 136 | 136 | ||
| 137 | 137 | /*=========================================================================== | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -708,6 +708,8 @@ fZone(NULL), | |||
| 708 | 708 | fRepeatedWallTime(UCAL_WALLTIME_LAST), | |
| 709 | 709 | fSkippedWallTime(UCAL_WALLTIME_LAST) | |
| 710 | 710 | { | |
| 711 | + validLocale[0] = 0; | ||
| 712 | + actualLocale[0] = 0; | ||
| 711 | 713 | clear(); | |
| 712 | 714 | if (U_FAILURE(success)) { | |
| 713 | 715 | return; | |
@@ -734,6 +736,8 @@ fZone(NULL), | |||
| 734 | 736 | fRepeatedWallTime(UCAL_WALLTIME_LAST), | |
| 735 | 737 | fSkippedWallTime(UCAL_WALLTIME_LAST) | |
| 736 | 738 | { | |
| 739 | + validLocale[0] = 0; | ||
| 740 | + actualLocale[0] = 0; | ||
| 737 | 741 | if (U_FAILURE(success)) { | |
| 738 | 742 | return; | |
| 739 | 743 | } | |
@@ -766,6 +770,8 @@ fZone(NULL), | |||
| 766 | 770 | fRepeatedWallTime(UCAL_WALLTIME_LAST), | |
| 767 | 771 | fSkippedWallTime(UCAL_WALLTIME_LAST) | |
| 768 | 772 | { | |
| 773 | + validLocale[0] = 0; | ||
| 774 | + actualLocale[0] = 0; | ||
| 769 | 775 | if (U_FAILURE(success)) { | |
| 770 | 776 | return; | |
| 771 | 777 | } | |
@@ -822,8 +828,10 @@ Calendar::operator=(const Calendar &right) | |||
| 822 | 828 | fWeekendCease = right.fWeekendCease; | |
| 823 | 829 | fWeekendCeaseMillis = right.fWeekendCeaseMillis; | |
| 824 | 830 | fNextStamp = right.fNextStamp; | |
| 825 | - uprv_strcpy(validLocale, right.validLocale); | ||
| 826 | - uprv_strcpy(actualLocale, right.actualLocale); | ||
| 831 | + uprv_strncpy(validLocale, right.validLocale, sizeof(validLocale)); | ||
| 832 | + uprv_strncpy(actualLocale, right.actualLocale, sizeof(actualLocale)); | ||
| 833 | + validLocale[sizeof(validLocale)-1] = 0; | ||
| 834 | + actualLocale[sizeof(validLocale)-1] = 0; | ||
| 827 | 835 | } | |
| 828 | 836 | ||
| 829 | 837 | return *this; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments