You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
805 B

  1. From 31d1f45cd63ec142fc559ea4f8a70bd4a1151c42 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Mon, 7 Oct 2019 15:39:14 -0700
  4. Subject: [PATCH 3/4] support: flush cout in GetNumber
  5. uClibc++ does not implicitly do this before getline.
  6. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  7. ---
  8. support.cc | 2 +-
  9. 1 file changed, 1 insertion(+), 1 deletion(-)
  10. diff --git a/support.cc b/support.cc
  11. index 5ab8a23..1107993 100644
  12. --- a/support.cc
  13. +++ b/support.cc
  14. @@ -73,7 +73,7 @@ uint64_t GetNumber(uint64_t low, uint64_t high, uint64_t def, const string & pro
  15. if (low != high) { // bother only if low and high differ...
  16. do {
  17. - cout << prompt;
  18. + cout << prompt << flush;
  19. cin.getline(line, 255);
  20. if (!cin.good())
  21. exit(5);
  22. --
  23. 2.17.1