Skip to content

Commit 96c1120

Browse files
committed
Revert "Removed exception-raising functions (#72)"
This reverts commit 5e5f44a.
1 parent 5e5f44a commit 96c1120

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

custom-prompt/custom-prompt.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -681,16 +681,16 @@ int main_internal(int const argc, char const* argv[])
681681
.detach();
682682

683683
std::string_view last_command(argv[1]);
684-
int exit_code = std::strtol(argv[2], nullptr, 10);
685-
long long unsigned delay = ts - std::strtoull(argv[3], nullptr, 10);
686-
long long unsigned prev_active_wid = std::strtoull(argv[4], nullptr, 10);
687-
std::size_t columns = std::strtoull(argv[5], nullptr, 10);
684+
int exit_code = std::stoi(argv[2]);
685+
long long unsigned delay = ts - std::stoull(argv[3]);
686+
long long unsigned prev_active_wid = std::stoull(argv[4]);
687+
std::size_t columns = std::stoull(argv[5]);
688688
report_command_status(last_command, exit_code, delay, prev_active_wid, columns);
689689

690690
std::string_view pwd(argv[6]);
691691
set_terminal_title(pwd);
692692

693-
int shlvl = std::strtol(argv[7], nullptr, 10);
693+
int shlvl = std::stoi(argv[7]);
694694
display_primary_prompt(shlvl,
695695
git_repository_information_future.wait_for(std::chrono::milliseconds(150)) == std::future_status::ready
696696
? git_repository_information_future.get()

0 commit comments

Comments
 (0)