From cd75b77695eb2f445974ecae22895bd969cc6681 Mon Sep 17 00:00:00 2001 From: Rico Tiongson Date: Thu, 7 Feb 2019 04:15:22 +0800 Subject: [PATCH] Set some variables to static --- src/comfortable-swipe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/comfortable-swipe.cpp b/src/comfortable-swipe.cpp index 73c0743..73a402c 100644 --- a/src/comfortable-swipe.cpp +++ b/src/comfortable-swipe.cpp @@ -232,9 +232,9 @@ namespace service { // start reading lines from input one by one static const int MAX_LINE_LENGTH = 256; static char data[MAX_LINE_LENGTH]; + static cmatch matches; bool flag_begin = false; while (fgets_unlocked(data, MAX_LINE_LENGTH, stdin) != NULL) { - cmatch matches; if (!flag_begin) { if (regex_match(data, matches, gesture_begin)) { swipe.device = matches[1]; @@ -293,7 +293,7 @@ namespace service { } // toggle automatically start application on startup void autostart() { - string path = autostart_filename(); + cstr path = autostart_filename(); if (ifstream(path.data()).good()) { // file found, delete it if (remove(path.data()) != 0)