summaryrefslogtreecommitdiff
path: root/gui-wm/wayfire/files/regex.patch
blob: 179b61c886b1c0735f8293636c3e45680dbae009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/subprojects/wf-utils/wayfire/lexer/literal.cpp b/subprojects/wf-utils/wayfire/lexer/literal.cpp
index cf4c9cf..5e8a042 100644
--- a/subprojects/wf-utils/wayfire/lexer/literal.cpp
+++ b/subprojects/wf-utils/wayfire/lexer/literal.cpp
@@ -3,6 +3,7 @@
 #include <ctype.h>
 #include <stdexcept>
 #include <string>
+#include <bits/stdc++.h>
 
 namespace wf
 {
@@ -86,7 +87,7 @@ variant_t parse_literal(const std::string &s)
     }
 
     // Deal with float or double here.
-    if (s.find('.') != std::string::npos)
+    if (std::count(std::begin(s), std::end(s), '.') == 1)
     {
         // Float or Double.
         if ((s.find('f') != std::string::npos) || (s.find('F') != std::string::npos))