From 3a32781476d5c96c4a8f0ce30afbcd536da34580 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Tue, 28 Jul 2026 18:54:41 +0100 Subject: [PATCH] Do not split at : on WIN32 due to C: in paths --- devOpcuaSup/iocshIntegration.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/devOpcuaSup/iocshIntegration.cpp b/devOpcuaSup/iocshIntegration.cpp index 1d305929..7b4d9c3a 100644 --- a/devOpcuaSup/iocshIntegration.cpp +++ b/devOpcuaSup/iocshIntegration.cpp @@ -20,6 +20,10 @@ #include #include #include +// cannot use : to separate command line arguments as it matches C: in file paths +#define ARGSEP ';' +#else +#define ARGSEP ':' #endif #include @@ -147,7 +151,7 @@ opcuaSessionCallFunc(const iocshArgBuf *args) std::list> setopts; for (int i = 1; i < args[2].aval.ac; i++) { - auto options = splitString(args[2].aval.av[i], ':'); + auto options = splitString(args[2].aval.av[i], ARGSEP); for (auto &opt : options) { if (opt.empty()) continue; auto keyval = splitString(opt, '='); @@ -252,7 +256,7 @@ static std::list> setopts; for (int i = 1; i < args[3].aval.ac; i++) { - auto options = splitString(args[3].aval.av[i], ':'); + auto options = splitString(args[3].aval.av[i], ARGSEP); for (auto &opt : options) { if (opt.empty()) continue; auto keyval = splitString(opt, '='); @@ -320,7 +324,7 @@ opcuaOptionsCallFunc(const iocshArgBuf *args) if (sessions.size()) { foundSomething = true; for (int i = 1; i < args[1].aval.ac; i++) { - auto options = splitString(args[1].aval.av[i], ':'); + auto options = splitString(args[1].aval.av[i], ARGSEP); for (auto &opt : options) { if (opt.empty()) continue; auto keyval = splitString(opt, '='); @@ -339,7 +343,7 @@ opcuaOptionsCallFunc(const iocshArgBuf *args) if (subscriptions.size()) { foundSomething = true; for (int i = 1; i < args[1].aval.ac; i++) { - auto options = splitString(args[1].aval.av[i], ':'); + auto options = splitString(args[1].aval.av[i], ARGSEP); for (auto &opt : options) { if (opt.empty()) continue; auto keyval = splitString(opt, '=');