diff --git a/src/actions.cpp b/src/actions.cpp index 1f8b016b..503ba00c 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -1253,7 +1253,7 @@ namespace Action { // -i{tgt}- reading from stdin? Exiv2::DataBuf stdIn; - bool bStdin = Params::instance().target_ | Params::ctStdInOut; + bool bStdin = (Params::instance().target_ & Params::ctStdInOut)?true:false; if ( bStdin ) Params::instance().getStdin(stdIn); if ( rc == 0 && !(Params::instance().target_ & Params::ctXmpRaw) diff --git a/src/basicio.cpp b/src/basicio.cpp index 3d1c7c5e..75d7510a 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -325,7 +325,7 @@ namespace Exiv2 { if (hKernel) { GetFileInformationByHandle_t pfcn_GetFileInformationByHandle = (GetFileInformationByHandle_t)GetProcAddress(hKernel, "GetFileInformationByHandle"); if (pfcn_GetFileInformationByHandle) { - BY_HANDLE_FILE_INFORMATION fi = {0}; + BY_HANDLE_FILE_INFORMATION fi = {0,0,0,0,0,0,0,0,0,0,0,0,0}; if (pfcn_GetFileInformationByHandle(hFd, &fi)) { nlink = fi.nNumberOfLinks; } diff --git a/src/exiv2app.hpp b/src/exiv2app.hpp index a0e7bdc2..657cce74 100644 --- a/src/exiv2app.hpp +++ b/src/exiv2app.hpp @@ -359,7 +359,7 @@ public: if ( stdinBuf.size_ == 0 ) { #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW__) || defined(_MSC_VER) DWORD fdwMode; - _setmode(_fileno(stdin), O_BINARY); + _setmode(fileno(stdin), O_BINARY); if ( !GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &fdwMode) ) { // failed: stdin has bytes! #else // http://stackoverflow.com/questions/34479795/make-c-not-wait-for-user-input/34479916#34479916 diff --git a/test/data/icc-test.out b/test/data/icc-test.out index 9d2553c5..32738ec7 100644 --- a/test/data/icc-test.out +++ b/test/data/icc-test.out @@ -202,9 +202,9 @@ STRUCTURE OF JPEG FILE: Reagan.jpg 25635 | 0xffdd DRI | 4 25641 | 0xffc4 DHT | 418 26061 | 0xffda SOS -MD5 (reagan_1.icc) = 264d91010fb585eeae33a8eeeaa0495f -MD5 (reagan_2.icc) = 264d91010fb585eeae33a8eeeaa0495f -MD5 (small_1.icc) = 75e766757c564c6c4305be96914ea923 -MD5 (small_2.icc) = 75e766757c564c6c4305be96914ea923 -MD5 (big_1.icc) = 1cb491b91a36649ef694c20f493e5d55 -MD5 (big_2.icc) = 1cb491b91a36649ef694c20f493e5d55 +264d91010fb585eeae33a8eeeaa0495f +264d91010fb585eeae33a8eeeaa0495f +75e766757c564c6c4305be96914ea923 +75e766757c564c6c4305be96914ea923 +1cb491b91a36649ef694c20f493e5d55 +1cb491b91a36649ef694c20f493e5d55 diff --git a/test/functions.source b/test/functions.source index cf907c21..d406655e 100644 --- a/test/functions.source +++ b/test/functions.source @@ -414,6 +414,14 @@ copyVideoFiles () popd 2>/dev/null >/dev/null } +## +# print checksum for one file +checkSum() +{ + # cygwin checksum: http://esrg.sourceforge.net/utils_win_up/md5sum/ + md5 $1 | cut -d= -f 2 | sed -E -e 's/ //g' | cut '-d(' -f 1 +} + ## # prepare temp files and other variables prepareTest() diff --git a/test/icc-test.sh b/test/icc-test.sh index a3fac6a0..21ed05c4 100755 --- a/test/icc-test.sh +++ b/test/icc-test.sh @@ -42,15 +42,14 @@ test2120() # --comment and -dc clobbered by writing ICC/JPG runTest exiv2 -eC --force $filename mv $iccname_ small_2.icc test2120 - - + + printf "md5 " >&3 for f in reagan small big; do for i in 1 2; do - md5 ${f}_${i}.icc + checkSum ${f}_${i}.icc done ; done - ) 3>&1 > $results 2>&1 printf "\n"