/*
*******************************************************************************
*
-* Copyright (C) 2005-2010, International Business Machines
+* Copyright (C) 2005-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
/* remove items */
if(options[OPT_REMOVE_LIST].doesOccur) {
- listPkg=readList(NULL, options[OPT_REMOVE_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_REMOVE_LIST].value, FALSE, listPkg)) {
pkg->removeItems(*listPkg);
delete listPkg;
isModified=TRUE;
*/
addListPkg=NULL;
if(options[OPT_ADD_LIST].doesOccur) {
- addListPkg=readList(sourcePath, options[OPT_ADD_LIST].value, TRUE);
- if(addListPkg!=NULL) {
+ addListPkg=new Package();
+ if(addListPkg==NULL) {
+ fprintf(stderr, "icupkg: not enough memory\n");
+ exit(U_MEMORY_ALLOCATION_ERROR);
+ }
+ if(readList(sourcePath, options[OPT_ADD_LIST].value, TRUE, addListPkg)) {
pkg->addItems(*addListPkg);
// delete addListPkg; deferred until after writePackage()
isModified=TRUE;
/* 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 {