summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/testEncoding.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-10-10 12:43:41 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-10 12:43:41 (GMT)
commitf1a4ecdc0c62b46c90df5e8d20e6f61d06063894 (patch)
tree405aa77560c8a6855cdda3e6e63b5fa0b4e04af7 /Source/kwsys/testEncoding.cxx
parentc798dc8573a205f90663e9983b793b21fea28521 (diff)
parentc551ff588b48cc4c286922779651890da0f3c22c (diff)
downloadCMake-f1a4ecdc0c62b46c90df5e8d20e6f61d06063894.zip
CMake-f1a4ecdc0c62b46c90df5e8d20e6f61d06063894.tar.gz
CMake-f1a4ecdc0c62b46c90df5e8d20e6f61d06063894.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2017-10-10 (239bc737)
Diffstat (limited to 'Source/kwsys/testEncoding.cxx')
-rw-r--r--Source/kwsys/testEncoding.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx
index 2c5ef46..2742fe4 100644
--- a/Source/kwsys/testEncoding.cxx
+++ b/Source/kwsys/testEncoding.cxx
@@ -75,6 +75,10 @@ static int testRobustEncoding()
// test that the conversion functions handle invalid
// unicode correctly/gracefully
+ // we manipulate the format flags of stdout, remember
+ // the original state here to restore before return
+ std::ios::fmtflags const& flags = std::cout.flags();
+
int ret = 0;
char cstr[] = { (char)-1, 0 };
// this conversion could fail
@@ -120,6 +124,7 @@ static int testRobustEncoding()
ret++;
}
+ std::cout.flags(flags);
return ret;
}