summaryrefslogtreecommitdiffstats
path: root/Source/cmakewizard.cxx
diff options
context:
space:
mode:
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')