Remove unnecessary negation

This commit is contained in:
Bandie 2018-03-17 21:26:06 +01:00
parent 661f84912e
commit 896b4400da
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD

View File

@ -71,13 +71,7 @@ int main(int argc, char *argv[]){
if(fork() == 0){
// Check if program is even executable
if(!(!access(PROGRAM, F_OK) && !access(PROGRAM, R_OK) && !access(PROGRAM, X_OK))){
fprintf(stderr, "ERROR: It is not possible to execute %s: ", PROGRAM);
if(access(PROGRAM, F_OK)) fprintf(stderr, "It does not exist.\n");
else fprintf(stderr, "Access denied. (Are you root?)\n");
return 1;
}
else{
if(!access(PROGRAM, F_OK) && !access(PROGRAM, R_OK) && !access(PROGRAM, X_OK)){
// Exec program silently by default
if(!verbose){
@ -90,6 +84,14 @@ int main(int argc, char *argv[]){
}
else
execlp(PROGRAM, PROGRAM, NULL);
}
else{
fprintf(stderr, "ERROR: It is not possible to execute %s: ", PROGRAM);
if(access(PROGRAM, F_OK)) fprintf(stderr, "It does not exist.\n");
else fprintf(stderr, "Access denied. (Are you root?)\n");
return 1;
}
}