aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-04-28 23:21:37 +1000
committerGravatar axel <axel@liljencrantz.se>2006-04-28 23:21:37 +1000
commitd690a15b29e69b2dcd762541e5ed708c4f304c27 (patch)
tree954a1ef4ee75671a36c49017beec7694dee5b111 /expand.c
parent445f6539cf3d2cfcc0ff36db24ede8bb5415c5ed (diff)
Make job id numbering start from 1, not 0
darcs-hash:20060428132137-ac50b-8e5adcdbc18ad7627b66e9129a13b037a669dd02.gz
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/expand.c b/expand.c
index 6dd512b5..0ae783a5 100644
--- a/expand.c
+++ b/expand.c
@@ -421,16 +421,18 @@ static int find_process( const wchar_t *proc,
{
int jid = wcstol( proc, 0, 10 );
-
- j = job_get( jid );
- if( (j != 0) && (j->command != 0 ) )
+ if( jid > 0 )
{
-
+ j = job_get( jid );
+ if( (j != 0) && (j->command != 0 ) )
{
- result = malloc(sizeof(wchar_t)*16 );
- swprintf( result, 16, L"%d", j->pgid );
- al_push( out, result );
- found = 1;
+
+ {
+ result = malloc(sizeof(wchar_t)*16 );
+ swprintf( result, 16, L"%d", j->pgid );
+ al_push( out, result );
+ found = 1;
+ }
}
}
}