From d6ae329172810a93d0403d3817c89230ca1ea9bd Mon Sep 17 00:00:00 2001 From: rofl0r Date: Wed, 8 Jun 2016 19:45:04 +0100 Subject: [PATCH] main loop: remove another indent level --- jobflow.c | 70 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/jobflow.c b/jobflow.c index 6aa6478..c4735fa 100644 --- a/jobflow.c +++ b/jobflow.c @@ -514,48 +514,48 @@ int main(int argc, char** argv) { prog_state.skip--; continue; } - if(!prog_state.cmd_startarg) + if(!prog_state.cmd_startarg) { dprintf(1, fgets_result); - else { - stringptr_fromchar(fgets_result, line); - stringptr_chomp(line); - - max_subst = 0; - if(prog_state.subst_entries) { - uint32_t* index; - sblist_iter(prog_state.subst_entries, index) { - SPDECLAREC(source, argv[*index + prog_state.cmd_startarg]); - int ret; - ret = substitute_all(subst_buf[max_subst], 4096, source, SPL("{}"), line); - if(ret == -1) { - too_long: - dprintf(2, "fatal: line too long for substitution: %s\n", line->ptr); - goto out; - } else if(!ret) { - char* lastdot = stringptr_rchr(line, '.'); - stringptr tilLastDot = *line; - if(lastdot) tilLastDot.size = lastdot - line->ptr; - ret = substitute_all(subst_buf[max_subst], 4096, source, SPL("{.}"), &tilLastDot); - if(ret == -1) goto too_long; - } - if(ret) { - cmd_argv[*index] = subst_buf[max_subst]; - max_subst++; - } + continue; + } + stringptr_fromchar(fgets_result, line); + stringptr_chomp(line); + + max_subst = 0; + if(prog_state.subst_entries) { + uint32_t* index; + sblist_iter(prog_state.subst_entries, index) { + SPDECLAREC(source, argv[*index + prog_state.cmd_startarg]); + int ret; + ret = substitute_all(subst_buf[max_subst], 4096, source, SPL("{}"), line); + if(ret == -1) { + too_long: + dprintf(2, "fatal: line too long for substitution: %s\n", line->ptr); + goto out; + } else if(!ret) { + char* lastdot = stringptr_rchr(line, '.'); + stringptr tilLastDot = *line; + if(lastdot) tilLastDot.size = lastdot - line->ptr; + ret = substitute_all(subst_buf[max_subst], 4096, source, SPL("{.}"), &tilLastDot); + if(ret == -1) goto too_long; + } + if(ret) { + cmd_argv[*index] = subst_buf[max_subst]; + max_subst++; } } + } - if(prog_state.delayedspinup_interval && spinup_counter < (prog_state.numthreads * 2)) { - msleep(rand() % (prog_state.delayedspinup_interval + 1)); - spinup_counter++; - } + if(prog_state.delayedspinup_interval && spinup_counter < (prog_state.numthreads * 2)) { + msleep(rand() % (prog_state.delayedspinup_interval + 1)); + spinup_counter++; + } - add_job(cmd_argv); + add_job(cmd_argv); - if(prog_state.statefile && (prog_state.delayedflush == 0 || free_slots() == 0)) { - write_statefile(lineno, temp_state); - } + if(prog_state.statefile && (prog_state.delayedflush == 0 || free_slots() == 0)) { + write_statefile(lineno, temp_state); } } -- 2.11.4.GIT