aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.c
diff options
context:
space:
mode:
authorGravatar liljencrantz <liljencrantz@gmail.com>2008-01-09 05:31:45 +1000
committerGravatar liljencrantz <liljencrantz@gmail.com>2008-01-09 05:31:45 +1000
commit71c2cde39073267a23cafd384ef9996be544c85d (patch)
treef6c294e2393645b86cf2f9648cfa5fab81b4f88f /parser.c
parentda4a4bcc186e14451ad39f07f6a05eda27a4007f (diff)
Cleanup and improve the exit status numbers and the messages generated on error as well as make sure that keyboard shortcuts don't change the status
darcs-hash:20080108193145-75c98-56c8aa2dd081af643d206820aa36bf3b6e49e0f2.gz
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index 916dd79b..4e1bf6b3 100644
--- a/parser.c
+++ b/parser.c
@@ -1970,7 +1970,10 @@ static int parse_job( process_t *p,
}
else
{
+ int err;
+
p->actual_cmd = path_get_path( j, (wchar_t *)al_get( args, 0 ) );
+ err = errno;
/*
Check if the specified command exists
@@ -2062,12 +2065,17 @@ static int parse_job( process_t *p,
cmd,
cmd );
}
+ else if( err!=ENOENT )
+ {
+ debug( 0,
+ _(L"The file '%ls' is not executable by this user"),
+ cmd?cmd:L"UNKNOWN" );
+ }
else
{
debug( 0,
_(L"Unknown command '%ls'"),
cmd?cmd:L"UNKNOWN" );
-
}
tmp = current_tokenizer_pos;
@@ -2078,7 +2086,7 @@ static int parse_job( process_t *p,
current_tokenizer_pos=tmp;
job_set_flag( j, JOB_SKIP, 1 );
- proc_set_last_status( STATUS_UNKNOWN_COMMAND );
+ proc_set_last_status( err==ENOENT?STATUS_UNKNOWN_COMMAND:STATUS_NOT_EXECUTABLE );
}
}
}