mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-23 00:01:16 -03:00
improve sanity check code
This commit is contained in:
@@ -984,18 +984,16 @@ int proc_format_status(int status) {
|
||||
}
|
||||
|
||||
void proc_sanity_check() {
|
||||
job_t *j;
|
||||
job_t *fg_job = 0;
|
||||
job_t *fg_job = NULL;
|
||||
|
||||
job_iterator_t jobs;
|
||||
while ((j = jobs.next())) {
|
||||
|
||||
while (job_t *j = jobs.next()) {
|
||||
if (!job_get_flag(j, JOB_CONSTRUCTED)) continue;
|
||||
|
||||
|
||||
// More than one foreground job?
|
||||
if (job_get_flag(j, JOB_FOREGROUND) && !(job_is_stopped(j) || job_is_completed(j))) {
|
||||
if (fg_job != 0) {
|
||||
if (fg_job) {
|
||||
debug(0, _(L"More than one job in foreground: job 1: '%ls' job 2: '%ls'"),
|
||||
fg_job->command_wcstr(), j->command_wcstr());
|
||||
sanity_lose();
|
||||
|
||||
Reference in New Issue
Block a user