Don't update CMD_DURATION if no command is requested

Fixes issue #4926
This commit is contained in:
Swayam Raina 2018-05-27 14:08:29 +05:30 committed by ridiculousfish
parent c1af560753
commit eb0539af60

View File

@ -1911,7 +1911,10 @@ void reader_run_command(parser_t &parser, const wcstring &cmd) {
job_reap(1);
gettimeofday(&time_after, NULL);
set_env_cmd_duration(&time_after, &time_before);
// update the execution duration iff a command is requested for execution
// issue - #4926
if (!ft.empty()) set_env_cmd_duration(&time_after, &time_before);
term_steal();