Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 244483 Details for
Bug 326021
dev-libs/icu-4.6 doesn't compile with a large CFLAGS string
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix "pkgdata" tool hard-wired buffer sizes
icu-4.4.1-pkgdata_cmdlength.patch (text/plain), 4.03 KB, created by
Gordon Schumacher
on 2010-08-25 04:22:51 UTC
(
hide
)
Description:
Patch to fix "pkgdata" tool hard-wired buffer sizes
Filename:
MIME Type:
Creator:
Gordon Schumacher
Created:
2010-08-25 04:22:51 UTC
Size:
4.03 KB
patch
obsolete
>--- icu.orig/source/tools/pkgdata/pkgdata.cpp 2010-08-24 15:49:45.198814885 -0600 >+++ icu/source/tools/pkgdata/pkgdata.cpp 2010-08-24 16:43:05.747817972 -0600 >@@ -601,42 +601,53 @@ static int32_t pkg_executeOptions(UPKGOp > char gencFilePath[SMALL_BUFFER_MAX_SIZE] = ""; > char version_major[10] = ""; > UBool reverseExt = FALSE; >+ unsigned currentBufferSize = MEDIUM_BUFFER_MAX_SIZE; > > /* Initialize pkgdataFlags */ > pkgDataFlags = (char**)uprv_malloc(sizeof(char*) * PKGDATA_FLAGS_SIZE); >- if (pkgDataFlags != NULL) { >- for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) { >- pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * MEDIUM_BUFFER_MAX_SIZE); >- if (pkgDataFlags[i] != NULL) { >- pkgDataFlags[i][0] = 0; >- } else { >- fprintf(stderr,"Error allocating memory for pkgDataFlags.\n"); >- return -1; >+#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN) >+ /* If we run out of space, allocate more */ >+ do { >+#endif >+ if (pkgDataFlags != NULL) { >+ for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) { >+ pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * currentBufferSize); >+ if (pkgDataFlags[i] != NULL) { >+ pkgDataFlags[i][0] = 0; >+ } else { >+ fprintf(stderr,"Error allocating memory for pkgDataFlags.\n"); >+ return -1; >+ } > } >+ } else { >+ fprintf(stderr,"Error allocating memory for pkgDataFlags.\n"); >+ return -1; > } >- } else { >- fprintf(stderr,"Error allocating memory for pkgDataFlags.\n"); >- return -1; >- } > >- if(o->verbose) { >- fprintf(stdout, "# pkgDataFlags="); >- for(int32_t i=0;i<PKGDATA_FLAGS_SIZE && pkgDataFlags[i][0];i++) { >- fprintf(stdout, "%c \"%s\"", (i>0)?',':' ',pkgDataFlags[i]); >- } >- fprintf(stdout, "\n"); >- } >+ if(o->verbose) { >+ fprintf(stdout, "# pkgDataFlags="); >+ for(int32_t i=0;i<PKGDATA_FLAGS_SIZE && pkgDataFlags[i][0];i++) { >+ fprintf(stdout, "%c \"%s\"", (i>0)?',':' ',pkgDataFlags[i]); >+ } >+ fprintf(stdout, "\n"); >+ } > > #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN) >- /* Read in options file. */ >- if(o->verbose) { >- fprintf(stdout, "# Reading options file %s\n", o->options); >- } >- parseFlagsFile(o->options, pkgDataFlags, SMALL_BUFFER_MAX_SIZE, (int32_t)PKGDATA_FLAGS_SIZE, &status); >- if (U_FAILURE(status)) { >- fprintf(stderr,"Unable to open or read \"%s\" option file. status = %s\n", o->options, u_errorName(status)); >- return -1; >- } >+ /* Read in options file. */ >+ if(o->verbose) { >+ fprintf(stdout, "# Reading options file %s\n", o->options); >+ } >+ parseFlagsFile(o->options, pkgDataFlags, currentBufferSize, (int32_t)PKGDATA_FLAGS_SIZE, &status); >+ if (status == U_BUFFER_OVERFLOW_ERROR) { >+ for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) { >+ uprv_free(pkgDataFlags[i]); >+ } >+ currentBufferSize *= 2; >+ } else if (U_FAILURE(status)) { >+ fprintf(stderr,"Unable to open or read \"%s\" option file. status = %s\n", o->options, u_errorName(status)); >+ return -1; >+ } >+ } while (status == U_BUFFER_OVERFLOW_ERROR); > > /* Get the version major number. */ > if (o->version != NULL) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 326021
:
237199
|
237201
|
237203
|
237205
| 244483 |
257539
|
257541
|
257543