From 7c09eb9df50981fed22d27b9d3d3c35e38685a3b Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Thu, 7 Feb 2019 03:24:44 +0800 Subject: [PATCH] Make sentence string static --- src/comfortable-swipe.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/comfortable-swipe.cpp b/src/comfortable-swipe.cpp index bab5788..f665ba8 100644 --- a/src/comfortable-swipe.cpp +++ b/src/comfortable-swipe.cpp @@ -215,7 +215,6 @@ namespace service { const regex gesture_begin(util::build_gesture_begin()); const regex gesture_update(util::build_gesture_update()); const regex gesture_end(util::build_gesture_end()); - string sentence; // read config file auto config = util::read_config_file(conf_filename().data()); // initialize gesture handler @@ -230,6 +229,8 @@ namespace service { config["down3"].c_str(), config["down4"].c_str() ); + // start reading lines from input one by one + static string sentence; while (getline(cin, sentence)) { auto data = sentence.data(); cmatch matches;