diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-08 16:03:27 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-08 16:03:27 (GMT) |
commit | e5bcddb6fecc1fb55f18f734601a3e928dc7510a (patch) | |
tree | 4c6fd15be926b48ca7e962c51024a1bea9bae649 /tools/porting/src | |
parent | 468bd5ac176c42af310d439810bbd3bb561f5a1b (diff) | |
parent | 3945fd75a93d790434b33c2d23add155893a82a4 (diff) | |
download | Qt-e5bcddb6fecc1fb55f18f734601a3e928dc7510a.zip Qt-e5bcddb6fecc1fb55f18f734601a3e928dc7510a.tar.gz Qt-e5bcddb6fecc1fb55f18f734601a3e928dc7510a.tar.bz2 |
Merge branch '4.6'
Conflicts:
tools/assistant/translations/translations_adp.pro
Diffstat (limited to 'tools/porting/src')
-rw-r--r-- | tools/porting/src/filewriter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/porting/src/filewriter.cpp b/tools/porting/src/filewriter.cpp index ee8debb..99bd6e7 100644 --- a/tools/porting/src/filewriter.cpp +++ b/tools/porting/src/filewriter.cpp @@ -44,6 +44,7 @@ #include <QFileInfo> #include <QDir> #include <ctype.h> +#include <errno.h> QT_BEGIN_NAMESPACE @@ -106,11 +107,18 @@ FileWriter::WriteResult FileWriter::writeFile(QString filePath, QByteArray conte char answer = 0; while (answer != 'y' && answer != 'n' && answer != 'a') { #if defined(Q_OS_WIN) && defined(_MSC_VER) && _MSC_VER >= 1400 - scanf_s("%c", &answer); + int result = scanf_s("%c", &answer); #else - scanf("%c", &answer); + int result = scanf("%c", &answer); #endif - answer = tolower(answer); + if (1 == result) + answer = tolower(answer); + else if (EOF == result) { + if (EINTR == errno || EILSEQ == errno) + continue; + + answer = 'n'; + } } if(answer == 'n') |