exec: use prev ret if bad system call

This commit is contained in:
flightlessmango 2024-07-07 00:45:11 +02:00
parent bda2af47b0
commit 8f94973cd8

View File

@ -1657,8 +1657,12 @@ void HudElements::update_exec(){
if (!HUDElements.shell) if (!HUDElements.shell)
HUDElements.shell = std::make_unique<Shell>(); HUDElements.shell = std::make_unique<Shell>();
for(auto& item : exec_list) for(auto& item : exec_list){
item.ret = HUDElements.shell->exec(item.value + "\n"); std::string ret = HUDElements.shell->exec(item.value + "\n");
// use the previous ret if we get bad system call
if (ret.find("Bad system call") == std::string::npos)
item.ret = ret;
}
#endif #endif
} }