X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/ba6d6ed23dec08b1cd5700a128c0752491c10ac9..51004dcb01e06fef634b61be77ed73dd61cb6db9:/icuSources/extra/uconv/uconv.cpp diff --git a/icuSources/extra/uconv/uconv.cpp b/icuSources/extra/uconv/uconv.cpp index 0bba48ea..56682658 100644 --- a/icuSources/extra/uconv/uconv.cpp +++ b/icuSources/extra/uconv/uconv.cpp @@ -1,6 +1,6 @@ /***************************************************************************** * -* Copyright (C) 1999-2011, International Business Machines +* Copyright (C) 1999-2013, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************/ @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -88,7 +89,7 @@ static void initMsg(const char *pname) { ps = 1; /* Set up our static data - if any */ -#ifdef UCONVMSG_LINK +#if defined(UCONVMSG_LINK) && U_PLATFORM != U_PF_OS390 /* On z/OS, this is failing. */ udata_setAppData(UCONVMSG, (const void*) uconvmsg_dat, &err); if (U_FAILURE(err)) { fprintf(stderr, "%s: warning, problem installing our static resource bundle data uconvmsg: %s - trying anyways.\n", @@ -593,6 +594,7 @@ ConvertFile::convertFile(const char *pname, UConverter *convto = 0; UErrorCode err = U_ZERO_ERROR; UBool flush; + UBool closeFile = FALSE; const char *cbufp, *prevbufp; char *bufp; @@ -628,6 +630,7 @@ ConvertFile::convertFile(const char *pname, u_wmsg(stderr, "cantOpenInputF", str1.getBuffer(), str2.getBuffer()); return FALSE; } + closeFile = TRUE; } else { infilestr = "-"; infile = stdin; @@ -1051,7 +1054,7 @@ normal_exit: delete t; #endif - if (infile != stdin) { + if (closeFile) { fclose(infile); } @@ -1378,6 +1381,8 @@ normal_exit: fclose(outfile); } + u_cleanup(); + return ret; }