From b78839a8d462a85ffc828cf97ebd4804051df8c7 Mon Sep 17 00:00:00 2001 From: xiaozhou233 Date: Fri, 3 Apr 2026 16:30:27 +0800 Subject: [PATCH] Feat: Config support ".xxx.xx" or "./xxx.xx" --- src/libloader/includes/config.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libloader/includes/config.hpp b/src/libloader/includes/config.hpp index 0a340a5..07ef863 100644 --- a/src/libloader/includes/config.hpp +++ b/src/libloader/includes/config.hpp @@ -99,6 +99,20 @@ public: if constexpr (std::is_same_v) { std::string s = val->as(); if (use_default_if_empty && s.empty()) return default_value; + // Check if string starts with '.' + if (s.starts_with('.')) { + // remove '.' + s.erase(0, 1); + + // Check if string starts with '/' + // MUST REMOVE '/', or it will cause path error (root directory) + if (s.starts_with('/')) { + s.erase(0, 1); + } + + // runtime_dir + s + s = (std::filesystem::path(runtime_dir) / s).string(); + } return s; } else { return val->as();