Skip to content

Commit

Permalink
exec: use prev ret if bad system call
Browse files Browse the repository at this point in the history
  • Loading branch information
flightlessmango committed Jul 6, 2024
1 parent bda2af4 commit 8f94973
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hud_elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,8 +1657,12 @@ void HudElements::update_exec(){
if (!HUDElements.shell)
HUDElements.shell = std::make_unique<Shell>();

for(auto& item : exec_list)
item.ret = HUDElements.shell->exec(item.value + "\n");
for(auto& item : exec_list){
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
}

Expand Down

0 comments on commit 8f94973

Please sign in to comment.