unix: Properly print script filename in case of error.

This commit is contained in:
Paul Sokolovsky 2014-06-03 01:01:39 +03:00
parent 8bf8404c15
commit dd0dee3afc

View File

@ -355,7 +355,7 @@ int main(int argc, char **argv) {
} else { } else {
char *basedir = realpath(argv[a], NULL); char *basedir = realpath(argv[a], NULL);
if (basedir == NULL) { if (basedir == NULL) {
fprintf(stderr, "%s: can't open file '%s': [Errno %d] ", argv[0], argv[1], errno); fprintf(stderr, "%s: can't open file '%s': [Errno %d] ", argv[0], argv[a], errno);
perror(""); perror("");
// CPython exits with 2 in such case // CPython exits with 2 in such case
ret = 2; ret = 2;