xref: /aoo41x/main/icu/icu4c-4_0_1-src.patch (revision 7ec8d7e0)
1*7ec8d7e0SPedro Giffuni--- misc/icu/source/config/mh-bsd-gcc	2009-01-15 16:46:10.000000000 +0900
2*7ec8d7e0SPedro Giffuni+++ misc/build/icu/source/config/mh-bsd-gcc	2011-06-14 17:12:14.000000000 +0900
3*7ec8d7e0SPedro Giffuni@@ -18,7 +18,15 @@
4*7ec8d7e0SPedro Giffuni
5*7ec8d7e0SPedro Giffuni ## Compiler switch to embed a runtime search path
6*7ec8d7e0SPedro Giffuni LD_RPATH=
7*7ec8d7e0SPedro Giffuni-LD_RPATH_PRE=	-Wl,-rpath,
8*7ec8d7e0SPedro Giffuni+LD_RPATH_PRE=	-Wl,-z,origin -Wl,-rpath,
9*7ec8d7e0SPedro Giffuni+
10*7ec8d7e0SPedro Giffuni+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
11*7ec8d7e0SPedro Giffuni+## (incl. the C++ runtime libs potentially found in the URE lib dir):
12*7ec8d7e0SPedro Giffuni+ENABLE_RPATH=YES
13*7ec8d7e0SPedro Giffuni+RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'
14*7ec8d7e0SPedro Giffuni+
15*7ec8d7e0SPedro Giffuni+#SH#  ENABLE_RPATH=YES
16*7ec8d7e0SPedro Giffuni+#SH#  RPATHLDFLAGS="${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'"
17*7ec8d7e0SPedro Giffuni
18*7ec8d7e0SPedro Giffuni ## Compiler switch to embed a library name
19*7ec8d7e0SPedro Giffuni LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
20*7ec8d7e0SPedro Giffuni
21cdf0e10cSrcweir--- misc/icu/source/common/putil.c	2008-07-01 03:41:12.000000000 +0200
22cdf0e10cSrcweir+++ misc/build/icu/source/common/putil.c	2008-09-02 07:01:29.335795765 +0200
23cdf0e10cSrcweir@@ -52,7 +52,7 @@
24cdf0e10cSrcweir Poorly upgraded Solaris machines can't have this defined.
25cdf0e10cSrcweir Cleanly installed Solaris can use this #define.
26cdf0e10cSrcweir */
27cdf0e10cSrcweir-#if !defined(_XOPEN_SOURCE_EXTENDED) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ >= 199901L)
28cdf0e10cSrcweir+#if !defined(_XOPEN_SOURCE_EXTENDED) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L)
29cdf0e10cSrcweir #define _XOPEN_SOURCE_EXTENDED 1
30cdf0e10cSrcweir #endif
31cdf0e10cSrcweir
32cdf0e10cSrcweir--- misc/icu/source/common/unicode/pwin32.h	2008-07-01 10:41:12.000000000 +0900
33cdf0e10cSrcweir+++ misc/build/icu/source/common/unicode/pwin32.h	2008-11-05 22:37:21.479250000 +0900
34cdf0e10cSrcweir@@ -32,6 +32,10 @@
35cdf0e10cSrcweir #define __STDC_CONSTANT_MACROS
36cdf0e10cSrcweir #endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir+#if defined(__MINGW32__)
39cdf0e10cSrcweir+#define U_HAVE_INTTYPES_H 1
40cdf0e10cSrcweir+#endif
41cdf0e10cSrcweir+
42cdf0e10cSrcweir /* _MSC_VER is used to detect the Microsoft compiler. */
43cdf0e10cSrcweir #if defined(_MSC_VER)
44cdf0e10cSrcweir #define U_INT64_IS_LONG_LONG 0
45cdf0e10cSrcweir--- misc/icu/source/config/mh-darwin	Tue Jul  1 03:41:24 2008
46cdf0e10cSrcweir+++ misc/build/icu/source/config/mh-darwin	Tue Jan 20 18:33:16 2009
47cdf0e10cSrcweir@@ -25,7 +25,7 @@
48cdf0e10cSrcweir SHLIB.cc=	$(CXX) -dynamiclib -dynamic $(CXXFLAGS) $(LDFLAGS)
49cdf0e10cSrcweir
50cdf0e10cSrcweir ## Compiler switches to embed a library name and version information
51cdf0e10cSrcweir-LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))
52cdf0e10cSrcweir+LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name @executable_path/$(notdir $(FINAL_SO_TARGET))
53cdf0e10cSrcweir
54cdf0e10cSrcweir ## Compiler switch to embed a runtime search path
55cdf0e10cSrcweir LD_RPATH=
56cdf0e10cSrcweir@@ -41,10 +41,6 @@
57cdf0e10cSrcweir ## Non-shared intermediate object suffix
58cdf0e10cSrcweir STATIC_O = ao
59cdf0e10cSrcweir
60cdf0e10cSrcweir-## Override Versioned target for a shared library.
61cdf0e10cSrcweir-FINAL_SO_TARGET=  $(basename $(SO_TARGET)).$(SO_TARGET_VERSION).$(SO)
62cdf0e10cSrcweir-MIDDLE_SO_TARGET= $(basename $(SO_TARGET)).$(SO_TARGET_VERSION_MAJOR).$(SO)
63cdf0e10cSrcweir-
64cdf0e10cSrcweir ## Compilation rules
65cdf0e10cSrcweir %.$(STATIC_O): $(srcdir)/%.c
66cdf0e10cSrcweir 	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
67cdf0e10cSrcweir@@ -76,15 +72,9 @@
68cdf0e10cSrcweir
69cdf0e10cSrcweir ## Versioned libraries rules
70cdf0e10cSrcweir
71cdf0e10cSrcweir-%.$(SO_TARGET_VERSION_MAJOR).$(SO): %.$(SO_TARGET_VERSION).$(SO)
72cdf0e10cSrcweir+%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
73cdf0e10cSrcweir 	$(RM) $@ && ln -s ${<F} $@
74cdf0e10cSrcweir-%.$(SO): %.$(SO_TARGET_VERSION_MAJOR).$(SO)
75cdf0e10cSrcweir-	$(RM) $@ && ln -s ${*F}.$(SO_TARGET_VERSION).$(SO) $@
76cdf0e10cSrcweir-
77cdf0e10cSrcweir-# tzcode option
78cdf0e10cSrcweir-TZORIG_EXTRA_CFLAGS=-DSTD_INSPIRED
79cdf0e10cSrcweir-
80cdf0e10cSrcweir-# genren opts
81cdf0e10cSrcweir-GENREN_PL_OPTS=-x Mach-O -n '-g' -p '| c++filt'
82cdf0e10cSrcweir+%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
83cdf0e10cSrcweir+	$(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
84cdf0e10cSrcweir
85cdf0e10cSrcweir ## End Darwin-specific setup
86cdf0e10cSrcweir--- misc/icu/source/config/mh-linux	2007-12-12 19:57:36.000000000 +0100
87cdf0e10cSrcweir+++ misc/build/icu/source/config/mh-linux	2008-05-21 18:59:13.000000000 +0200
88cdf0e10cSrcweir@@ -20,6 +20,14 @@
89cdf0e10cSrcweir LD_RPATH=
90cdf0e10cSrcweir LD_RPATH_PRE = -Wl,-rpath,
91cdf0e10cSrcweir
92cdf0e10cSrcweir+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
93cdf0e10cSrcweir+## (incl. the C++ runtime libs potentially found in the URE lib dir):
94cdf0e10cSrcweir+ENABLE_RPATH=YES
95cdf0e10cSrcweir+RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'
96cdf0e10cSrcweir+
97cdf0e10cSrcweir+#SH#  ENABLE_RPATH=YES
98cdf0e10cSrcweir+#SH#  RPATHLDFLAGS="${LD_RPATH_PRE}'$$ORIGIN:$$ORIGIN/../ure-link/lib'"
99cdf0e10cSrcweir+
100cdf0e10cSrcweir ## These are the library specific LDFLAGS
101cdf0e10cSrcweir LDFLAGSICUDT=-nodefaultlibs -nostdlib
102cdf0e10cSrcweir
103cdf0e10cSrcweir--- misc/icu/source/config/mh-mingw	2008-07-01 10:41:24.000000000 +0900
104cdf0e10cSrcweir+++ misc/build/icu/source/config/mh-mingw	2008-11-06 00:18:30.261250000 +0900
105cdf0e10cSrcweir@@ -72,10 +72,12 @@
106cdf0e10cSrcweir # The #M# is used to delete lines for icu-config
107cdf0e10cSrcweir # Current full path directory.
108cdf0e10cSrcweir #CURR_FULL_DIR=$(shell pwd -W)#M# for MSYS
109cdf0e10cSrcweir-CURR_FULL_DIR=$(subst \,/,$(shell cmd /c cd | tail --bytes=+3))#M# for Cygwin shell
110cdf0e10cSrcweir+CURR_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
111cdf0e10cSrcweir # Current full path directory for use in source code in a -D compiler option.
112cdf0e10cSrcweir #CURR_SRCCODE_FULL_DIR=$(subst /,\\\\,$(shell pwd -W))#M# for MSYS
113cdf0e10cSrcweir-CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd | tail --bytes=+3))#M# for Cygwin shell
114cdf0e10cSrcweir+CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
115cdf0e10cSrcweir+SRCDIR_DEPEND=$(shell cd $(SRCDIR) && pwd)
116cdf0e10cSrcweir+DATAFILEPATHS_DEPEND=$(foreach p,$(DATAFILEPATHS),$(shell cd $(dir $(p)) && pwd)/$(notdir $(p)))
117cdf0e10cSrcweir
118cdf0e10cSrcweir ## Compilation rules
119cdf0e10cSrcweir %.$(STATIC_O): $(srcdir)/%.c
120cdf0e10cSrcweir--- misc/icu/source/config/mh-solaris	2008-07-01 03:41:26.000000000 +0200
121cdf0e10cSrcweir+++ misc/build/icu/source/config/mh-solaris	2009-02-17 11:54:45.105890123 +0100
122cdf0e10cSrcweir@@ -18,17 +18,24 @@
123cdf0e10cSrcweir
124cdf0e10cSrcweir ## Commands to link
125cdf0e10cSrcweir ## For Sun Workshop, use CC to link to bring in C++ runtime
126cdf0e10cSrcweir-LINK.c=		$(CXX) $(CXXFLAGS) $(LDFLAGS)
127cdf0e10cSrcweir-LINK.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS)
128cdf0e10cSrcweir+LINK.c=     $(CXX) $(CXXFLAGS) $(LDFLAGS) -norunpath
129cdf0e10cSrcweir+LINK.cc=    $(CXX) $(CXXFLAGS) $(LDFLAGS) -norunpath
130cdf0e10cSrcweir
131cdf0e10cSrcweir ## Commands to make a shared library
132cdf0e10cSrcweir SHLIB.c=	$(CC) $(CFLAGS) $(LDFLAGS) -G
133cdf0e10cSrcweir-SHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -G
134cdf0e10cSrcweir+SHLIB.cc=   $(CXX) $(CXXFLAGS) $(LDFLAGS) -G -norunpath
135cdf0e10cSrcweir
136cdf0e10cSrcweir ## Compiler switch to embed a runtime search path
137cdf0e10cSrcweir LD_RPATH=	-R
138cdf0e10cSrcweir LD_RPATH_PRE=
139cdf0e10cSrcweir
140cdf0e10cSrcweir+## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH
141cdf0e10cSrcweir+ENABLE_RPATH=YES
142cdf0e10cSrcweir+RPATHLDFLAGS=${LD_RPATH}'$$ORIGIN'
143cdf0e10cSrcweir+
144cdf0e10cSrcweir+#SH#  ENABLE_RPATH=YES
145cdf0e10cSrcweir+#SH#  RPATHLDFLAGS="${LD_RPATH}'$$ORIGIN'"
146cdf0e10cSrcweir+
147cdf0e10cSrcweir #LIBRARY_PATH_PREFIX=/usr/lib/lwp:
148cdf0e10cSrcweir
149cdf0e10cSrcweir ## Compiler switch to embed a library name
150cdf0e10cSrcweir--- misc/icu/source/layout/ArabicShaping.cpp	2008-07-01 03:42:04.000000000 +0200
151cdf0e10cSrcweir+++ misc/build/icu/source/layout/ArabicShaping.cpp	2009-02-17 12:04:34.264869737 +0100
152cdf0e10cSrcweir@@ -79,7 +79,6 @@
153cdf0e10cSrcweir #define markFeatureMask 0x00040000UL
154cdf0e10cSrcweir #define mkmkFeatureMask 0x00020000UL
155cdf0e10cSrcweir
156cdf0e10cSrcweir-#define NO_FEATURES   0
157cdf0e10cSrcweir #define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask)
158cdf0e10cSrcweir
159cdf0e10cSrcweir #define SHAPE_MASK 0xF0000000UL
160cdf0e10cSrcweir@@ -174,11 +173,7 @@
161cdf0e10cSrcweir         LEUnicode c = chars[in];
162cdf0e10cSrcweir         ShapeType t = getShapeType(c);
163cdf0e10cSrcweir
164cdf0e10cSrcweir-        if (t == ST_NOSHAPE_NONE) {
165cdf0e10cSrcweir-            glyphStorage.setAuxData(out, NO_FEATURES, success);
166cdf0e10cSrcweir-        } else {
167cdf0e10cSrcweir-            glyphStorage.setAuxData(out, ISOL_FEATURES, success);
168cdf0e10cSrcweir-        }
169cdf0e10cSrcweir+        glyphStorage.setAuxData(out, ISOL_FEATURES, success);
170cdf0e10cSrcweir
171cdf0e10cSrcweir         if ((t & MASK_TRANSPARENT) != 0) {
172cdf0e10cSrcweir             continue;
173cdf0e10cSrcweir--- misc/icu/source/layoutex/ParagraphLayout.cpp	2008-07-01 03:42:02.000000000 +0200
174cdf0e10cSrcweir+++ misc/build/icu/source/layoutex/ParagraphLayout.cpp	2008-12-01 19:32:58.000000000 +0100
175cdf0e10cSrcweir@@ -868,7 +868,7 @@
176cdf0e10cSrcweir
177cdf0e10cSrcweir     return nullLanguageCode;
178cdf0e10cSrcweir }
179cdf0e10cSrcweir-#elif
180cdf0e10cSrcweir+#else
181cdf0e10cSrcweir
182cdf0e10cSrcweir // TODO - dummy implementation for right now...
183cdf0e10cSrcweir le_int32 ParagraphLayout::getLanguageCode(const Locale *locale)
184cdf0e10cSrcweir--- misc/icu/source/tools/pkgdata/cmnmode.c	2008-07-01 10:41:20.000000000 +0900
185cdf0e10cSrcweir+++ misc/build/icu/source/tools/pkgdata/cmnmode.c	2008-11-07 00:03:32.393500000 +0900
186cdf0e10cSrcweir@@ -69,7 +69,11 @@
187cdf0e10cSrcweir   sprintf(tmp, "# List file for gencmn:\n"
188cdf0e10cSrcweir           "CMNLIST=%s%s%s_common.lst\n\n",
189cdf0e10cSrcweir           o->tmpDir,
190cdf0e10cSrcweir+#ifdef __MINGW32__
191cdf0e10cSrcweir+          U_FILE_ALT_SEP_STRING,
192cdf0e10cSrcweir+#else
193cdf0e10cSrcweir           U_FILE_SEP_STRING,
194cdf0e10cSrcweir+#endif
195cdf0e10cSrcweir           o->shortName);
196cdf0e10cSrcweir   T_FileStream_writeLine(makefile, tmp);
197cdf0e10cSrcweir
198cdf0e10cSrcweir--- misc/icu/source/tools/pkgdata/dllmode.c	2008-07-01 10:41:20.000000000 +0900
199cdf0e10cSrcweir+++ misc/build/icu/source/tools/pkgdata/dllmode.c	2008-11-07 06:08:36.016750000 +0900
200cdf0e10cSrcweir@@ -139,7 +139,11 @@
201cdf0e10cSrcweir     sprintf(tmp, "# List file for gencmn:\n"
202cdf0e10cSrcweir                  "CMNLIST=%s%s$(NAME)_dll.lst\n\n",
203cdf0e10cSrcweir                  o->tmpDir,
204cdf0e10cSrcweir+#ifdef __MINGW32__
205cdf0e10cSrcweir+                 U_FILE_ALT_SEP_STRING);
206cdf0e10cSrcweir+#else
207cdf0e10cSrcweir                  U_FILE_SEP_STRING);
208cdf0e10cSrcweir+#endif
209cdf0e10cSrcweir     T_FileStream_writeLine(makefile, tmp);
210cdf0e10cSrcweir
211cdf0e10cSrcweir     if(o->hadStdin == FALSE) { /* shortcut */
212cdf0e10cSrcweir--- misc/icu/source/tools/pkgdata/make.c	2008-07-01 10:41:20.000000000 +0900
213cdf0e10cSrcweir+++ misc/build/icu/source/tools/pkgdata/make.c	2008-11-06 23:23:04.096625000 +0900
214cdf0e10cSrcweir@@ -313,8 +313,13 @@
215cdf0e10cSrcweir       uprv_strcpy(cfile+uprv_strlen(cfile)-uprv_strlen(objSuffix), ".c" ); /* replace .o with .c */
216cdf0e10cSrcweir
217cdf0e10cSrcweir       /* Make up parents.. */
218cdf0e10cSrcweir+#ifdef __MINGW32__
219cdf0e10cSrcweir+      parentPath = uprv_malloc(1+uprv_strlen(baseName) + uprv_strlen("$(SRCDIR_DEPEND)/"));
220cdf0e10cSrcweir+      sprintf(parentPath, "$(SRCDIR_DEPEND)/%s", baseName);
221cdf0e10cSrcweir+#else
222cdf0e10cSrcweir       parentPath = uprv_malloc(1+uprv_strlen(baseName) + uprv_strlen("$(SRCDIR)/"));
223cdf0e10cSrcweir       sprintf(parentPath, "$(SRCDIR)/%s", baseName);
224cdf0e10cSrcweir+#endif
225cdf0e10cSrcweir       parents = pkg_appendToList(parents, NULL, parentPath);
226cdf0e10cSrcweir
227cdf0e10cSrcweir       /* make up commands.. */
228cdf0e10cSrcweir@@ -379,7 +384,11 @@
229cdf0e10cSrcweir     T_FileStream_writeLine(f, "\n");
230cdf0e10cSrcweir     T_FileStream_writeLine(f, "BASE_OBJECTS=$(NAME)_dat.o\n");
231cdf0e10cSrcweir     T_FileStream_writeLine(f, "\n");
232cdf0e10cSrcweir+#ifdef __MINGW32__
233cdf0e10cSrcweir+    T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME).dat: $(CMNLIST) $(DATAFILEPATHS_DEPEND)\n");
234cdf0e10cSrcweir+#else
235cdf0e10cSrcweir     T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME).dat: $(CMNLIST) $(DATAFILEPATHS)\n");
236cdf0e10cSrcweir+#endif
237cdf0e10cSrcweir     T_FileStream_writeLine(f, "\t$(INVOKE) $(ICUPKG) -t$(ICUDATA_CHAR) -c -s $(SRCDIR) -a $(CMNLIST) new $(TEMP_DIR)/$(CNAME).dat\n");
238cdf0e10cSrcweir     T_FileStream_writeLine(f, "\n");
239cdf0e10cSrcweir     T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME)_dat.o : $(TEMP_DIR)/$(NAME).dat\n");
240cdf0e10cSrcweir--- misc/icu/source/tools/pkgdata/pkgdata.c	2008-07-01 10:41:20.000000000 +0900
241cdf0e10cSrcweir+++ misc/build/icu/source/tools/pkgdata/pkgdata.c	2008-11-07 05:59:27.110500000 +0900
242cdf0e10cSrcweir@@ -594,7 +594,11 @@
243cdf0e10cSrcweir                     exit(U_ILLEGAL_ARGUMENT_ERROR);
244cdf0e10cSrcweir                 }
245cdf0e10cSrcweir                 uprv_strcpy(tmp, o->srcDir);
246cdf0e10cSrcweir+#ifdef __MINGW32__
247cdf0e10cSrcweir+                uprv_strcat(tmp, o->srcDir[uprv_strlen(o->srcDir)-1]==U_FILE_SEP_CHAR?"":U_FILE_ALT_SEP_STRING);
248cdf0e10cSrcweir+#else
249cdf0e10cSrcweir                 uprv_strcat(tmp, o->srcDir[uprv_strlen(o->srcDir)-1]==U_FILE_SEP_CHAR?"":U_FILE_SEP_STRING);
250cdf0e10cSrcweir+#endif
251cdf0e10cSrcweir                 uprv_strcat(tmp, s);
252cdf0e10cSrcweir                 o->filePaths = pkg_appendToList(o->filePaths, &tail2, uprv_strdup(tmp));
253cdf0e10cSrcweir                 linePtr = lineNext;
254cdf0e10cSrcweir--- misc/icu/source/tools/pkgdata/sttcmode.c	2008-07-01 10:41:20.000000000 +0900
255cdf0e10cSrcweir+++ misc/build/icu/source/tools/pkgdata/sttcmode.c	2008-11-07 00:30:05.690375000 +0900
256cdf0e10cSrcweir@@ -172,7 +172,11 @@
257cdf0e10cSrcweir     sprintf(tmp, "# List file for gencmn:\n"
258cdf0e10cSrcweir         "CMNLIST=%s%s$(NAME)_static.lst\n\n",
259cdf0e10cSrcweir         o->tmpDir,
260cdf0e10cSrcweir+#ifdef __MINGW32__
261cdf0e10cSrcweir+        U_FILE_ALT_SEP_STRING);
262cdf0e10cSrcweir+#else
263cdf0e10cSrcweir         U_FILE_SEP_STRING);
264cdf0e10cSrcweir+#endif
265cdf0e10cSrcweir     T_FileStream_writeLine(makefile, tmp);
266cdf0e10cSrcweir
267cdf0e10cSrcweir     if(o->hadStdin == FALSE) { /* shortcut */
26886d32d45SHerbert Dürr--- misc/icu/source/common/uloc.c	2009-01-15 08:45:56.000000000 +0100
26986d32d45SHerbert Dürr+++ misc/build/icu/source/common/uloc.c	2009-12-14 10:51:38.000000000 +0100
27086d32d45SHerbert Dürr@@ -1736,7 +1736,7 @@
27186d32d45SHerbert Dürr                 int32_t variantLen = _deleteVariant(variant, uprv_min(variantSize, (nameCapacity-len)), variantToCompare, n);
27286d32d45SHerbert Dürr                 len -= variantLen;
27386d32d45SHerbert Dürr                 if (variantLen > 0) {
27486d32d45SHerbert Dürr-                    if (name[len-1] == '_') { /* delete trailing '_' */
27586d32d45SHerbert Dürr+                    if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
27686d32d45SHerbert Dürr                         --len;
27786d32d45SHerbert Dürr                     }
27886d32d45SHerbert Dürr                     addKeyword = VARIANT_MAP[j].keyword;
27986d32d45SHerbert Dürr@@ -1744,7 +1744,7 @@
28086d32d45SHerbert Dürr                     break;
28186d32d45SHerbert Dürr                 }
28286d32d45SHerbert Dürr             }
28386d32d45SHerbert Dürr-            if (name[len-1] == '_') { /* delete trailing '_' */
28486d32d45SHerbert Dürr+            if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
28586d32d45SHerbert Dürr                 --len;
28686d32d45SHerbert Dürr             }
28786d32d45SHerbert Dürr         }
288