diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2015-01-30 09:29:42 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2015-01-30 09:29:42 -0330 |
commit | 0a2a4d818fb5c276e6ba008c29b591683d5025bd (patch) | |
tree | bef463540bcd1ba853b75c8f265845251e819fd6 /cpp/demo/Manual/evictor_filesystem/Parser.cpp | |
parent | Fixed (ICE-6276) - Add support for JavaScript source maps (diff) | |
download | ice-0a2a4d818fb5c276e6ba008c29b591683d5025bd.tar.bz2 ice-0a2a4d818fb5c276e6ba008c29b591683d5025bd.tar.xz ice-0a2a4d818fb5c276e6ba008c29b591683d5025bd.zip |
ICE-5814 allow demos to be built with /W4 on Windows
Diffstat (limited to 'cpp/demo/Manual/evictor_filesystem/Parser.cpp')
-rw-r--r-- | cpp/demo/Manual/evictor_filesystem/Parser.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/cpp/demo/Manual/evictor_filesystem/Parser.cpp b/cpp/demo/Manual/evictor_filesystem/Parser.cpp index 00d7955a833..eeecee3e55a 100644 --- a/cpp/demo/Manual/evictor_filesystem/Parser.cpp +++ b/cpp/demo/Manual/evictor_filesystem/Parser.cpp @@ -44,7 +44,7 @@ Parser::usage() } // Print the contents of directory "dir". If recursive is true, -// print in tree fashion. +// print in tree fashion. // For files, show the contents of each file. The "depth" // parameter is the current nesting level (for indentation). @@ -339,25 +339,22 @@ Parser::getInput(char* buf, size_t& result, size_t maxSize) cout << parser->getPrompt() << flush; string line; - while(true) + char c; + do { - char c = static_cast<char>(getc(yyin)); + c = static_cast<char>(getc(yyin)); if(c == EOF) { if(line.size()) { line += '\n'; } - break; } - - line += c; - - if(c == '\n') + else { - break; + line += c; } - } + } while(c != EOF && c != '\n'); result = line.length(); if(result > maxSize) |