mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-21 06:41:16 -03:00
Eliminate the job from block_t
This exists only to support the '--on-job-exit caller' feature. Just store the calling job ID directly in the parser's libdata.
This commit is contained in:
@@ -93,19 +93,7 @@ static int parse_cmd_opts(function_cmd_opts_t &opts, int *optind, //!OCLINT(hig
|
||||
job_id_t job_id = -1;
|
||||
|
||||
if (is_subshell) {
|
||||
size_t block_idx = 0;
|
||||
|
||||
// Find the outermost substitution block.
|
||||
for (block_idx = 0;; block_idx++) {
|
||||
const block_t *b = parser.block_at_index(block_idx);
|
||||
if (b == NULL || b->type() == SUBST) break;
|
||||
}
|
||||
|
||||
// Go one step beyond that, to get to the caller.
|
||||
const block_t *caller_block = parser.block_at_index(block_idx + 1);
|
||||
if (caller_block != NULL && caller_block->job != NULL) {
|
||||
job_id = caller_block->job->job_id;
|
||||
}
|
||||
job_id = parser.libdata().caller_job_id;
|
||||
}
|
||||
|
||||
if (job_id == -1) {
|
||||
|
||||
Reference in New Issue
Block a user