summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorketsuban_152 <webmaster@dangofacotry.net>2026-08-09 13:11:56 +0900
committerketsuban_152 <webmaster@dangofacotry.net>2026-08-09 13:11:56 +0900
commit71e309251350e273531b68d481d356c75455b01e (patch)
tree418dacf3d0430c900774b53222c59e2fc3226c40
parentb3071590a98262cb62d6bfd735a71366fda30912 (diff)
downloaddwgo-71e309251350e273531b68d481d356c75455b01e.tar.gz
dwgo-71e309251350e273531b68d481d356c75455b01e.tar.bz2
dwgo-71e309251350e273531b68d481d356c75455b01e.zip
modified: src/localtemp.cpp
-rw-r--r--src/localtemp.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/localtemp.cpp b/src/localtemp.cpp
index a1b212e..3a64200 100644
--- a/src/localtemp.cpp
+++ b/src/localtemp.cpp
@@ -316,6 +316,42 @@ bool localtemp::getInfo()
string fullkey=yyyymmdd+hhmmss;
size_t blockpos=http->data.find("\""+fullkey+"\":");
+
+ string selected_key;
+ for (size_t pos = 0; pos + 16 < http->data.size(); ++pos) {
+ if (http->data[pos] != '"')
+ continue;
+
+ string candidate = http->data.substr(pos + 1, 14);
+
+ bool digits = true;
+ for (size_t i = 0; i < candidate.size(); ++i) {
+ if (candidate[i] < '0' || candidate[i] > '9') {
+ digits = false;
+ break;
+ }
+ }
+
+ if (!digits || http->data[pos + 15] != '"')
+ continue;
+
+ size_t colon = http->data.find(':', pos + 16);
+ if (colon == string::npos)
+ continue;
+
+ size_t object_start =
+ http->data.find_first_not_of(" \t\r\n", colon + 1);
+
+ if (object_start == string::npos ||
+ http->data[object_start] != '{')
+ continue;
+
+ if (candidate <= fullkey &&
+ (selected_key.empty() || candidate > selected_key)) {
+ selected_key = candidate;
+ blockpos = pos;
+ }
+ }
if (blockpos==string::npos)
{