From e46d3d649c2525dcbb65b99b72f06b1a4633c2a1 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Mon, 22 Nov 1999 19:53:19 +0000 Subject: [PATCH] ICU-157 improve UErrorCode handling X-SVN-Rev: 218 --- icu4c/source/common/udata.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/icu4c/source/common/udata.c b/icu4c/source/common/udata.c index f42e41e039..5061faeaf5 100644 --- a/icu4c/source/common/udata.c +++ b/icu4c/source/common/udata.c @@ -731,7 +731,6 @@ doOpenChoice(const char *path, const char *type, const char *name, lib=NO_LIBRARY; } } else { - *pErrorCode=errorCode; if(!isICUData) { UNLOAD_LIBRARY(lib); } @@ -761,7 +760,6 @@ doOpenChoice(const char *path, const char *type, const char *name, /* look for the entry point */ p=getChoice(lib, entryName, type, name, isAcceptable, context, &errorCode); if(p==NULL) { - *pErrorCode=errorCode; UNLOAD_LIBRARY(lib); } } @@ -789,7 +787,6 @@ doOpenChoice(const char *path, const char *type, const char *name, /* look for the entry point */ p=getChoice(lib, entryName, type, name, isAcceptable, context, &errorCode); if(p==NULL) { - *pErrorCode=errorCode; UNLOAD_LIBRARY(lib); } } @@ -836,7 +833,13 @@ doOpenChoice(const char *path, const char *type, const char *name, /* data not found */ if(U_SUCCESS(*pErrorCode)) { - *pErrorCode=U_FILE_ACCESS_ERROR; + if(U_SUCCESS(errorCode)) { + /* file not found */ + *pErrorCode=U_FILE_ACCESS_ERROR; + } else { + /* entry point not found or rejected */ + *pErrorCode=errorCode; + } } return NULL; }