summaryrefslogtreecommitdiffstats
path: root/Source/cmakewizard.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-17 17:48:30 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-17 17:48:30 (GMT)
commitd1fbb556eba2cee409d502ecf0c1ee70415cbc1d (patch)
tree5f0304a2580516034c294814ae3728b23ade3d76 /Source/cmakewizard.cxx
parent577cf9194542b874676a08291f3a27a65784d017 (diff)
downloadCMake-d1fbb556eba2cee409d502ecf0c1ee70415cbc1d.zip
CMake-d1fbb556eba2cee409d502ecf0c1ee70415cbc1d.tar.gz
CMake-d1fbb556eba2cee409d502ecf0c1ee70415cbc1d.tar.bz2
Replace getline with fgets since getline does not seems to work properly on Mac OSX
Diffstat (limited to 'Source/cmakewizard.cxx')
-rw-r--r--Source/cmakewizard.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx
index 7ff4842..608b46c 100644
--- a/Source/cmakewizard.cxx
+++ b/Source/cmakewizard.cxx
@@ -18,6 +18,11 @@
#include "cmake.h"
#include "cmCacheManager.h"
+
+// On Mac OSX getline looks like it is broken, so we have to use
+// fgets. This is why we are including stdio.h.
+#include <stdio.h>
+
cmakewizard::cmakewizard()
{
m_ShowAdvanced = false;
@@ -33,7 +38,7 @@ void cmakewizard::AskUser(const char* key, cmCacheManager::CacheIterator& iter)
std::cout << "New Value (Enter to keep current value): ";
char buffer[4096];
buffer[0] = 0;
- std::cin.getline(buffer, sizeof(buffer));
+ fgets(buffer, sizeof(buffer)-1, stdin);
if(buffer[0])
{
std::string value = buffer;
@@ -59,7 +64,7 @@ bool cmakewizard::AskAdvanced()
std::cout << "Would you like to see advanced options? [No]:";
char buffer[4096];
buffer[0] = 0;
- std::cin.getline(buffer, sizeof(buffer));
+ fgets(buffer, sizeof(buffer)-1, stdin);
if(buffer[0])
{
if(buffer[0] == 'y' || buffer[0] == 'Y')