/*
*******************************************************************************
*
-* Copyright (C) 2005-2010, International Business Machines
+* Copyright (C) 2005-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
/* extract items */
if(options[OPT_EXTRACT_LIST].doesOccur) {
- listPkg=readList(NULL, options[OPT_EXTRACT_LIST].value, FALSE);
- if(listPkg!=NULL) {
+ listPkg=new Package();
+ if(listPkg==NULL) {
+ fprintf(stderr, "icupkg: not enough memory\n");
+ exit(U_MEMORY_ALLOCATION_ERROR);
+ }
+ if(!readList(NULL, options[OPT_EXTRACT_LIST].value, FALSE, listPkg)) {
pkg->extractItems(destPath, *listPkg, outType);
delete listPkg;
} else {
/******************************************************************************
- * Copyright (C) 2008-2009, International Business Machines
+ * Copyright (C) 2008-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
* Otherwise, read the file itself as a single-item list.
*/
U_CAPI Package * U_EXPORT2
-readList(const char *filesPath, const char *listname, UBool readContents) {
- Package *listPkg;
+readList(const char *filesPath, const char *listname, UBool readContents, Package *listPkgIn) {
+ Package *listPkg = listPkgIn;
FILE *file;
const char *listNameEnd;
return NULL;
}
- listPkg=new Package();
- if(listPkg==NULL) {
- fprintf(stderr, "icupkg: not enough memory\n");
- exit(U_MEMORY_ALLOCATION_ERROR);
+ if (listPkg == NULL) {
+ listPkg=new Package();
+ if(listPkg==NULL) {
+ fprintf(stderr, "icupkg: not enough memory\n");
+ exit(U_MEMORY_ALLOCATION_ERROR);
+ }
}
listNameEnd=strchr(listname, 0);
/******************************************************************************
- * Copyright (C) 2008-2011, International Business Machines
+ * Copyright (C) 2008-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
char outType);
U_CAPI icu::Package * U_EXPORT2
-readList(const char *filesPath, const char *listname, UBool readContents);
+readList(const char *filesPath, const char *listname, UBool readContents, Package *listPkgIn = NULL);
#endif