-/* $OpenBSD: file.c,v 1.62 2017/06/28 15:42:49 deraadt Exp $ */
+/* $OpenBSD: file.c,v 1.63 2017/06/28 17:14:15 brynet Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
{
int fd, mode, error;
+ inf->path = path;
+
if (strcmp(path, "-") == 0) {
if (fstat(STDIN_FILENO, &inf->sb) == -1) {
inf->error = errno;
inf->fd = -1;
+ return;
}
inf->fd = STDIN_FILENO;
+ return;
}
if (Lflag)
if (error == -1) {
inf->error = errno;
inf->fd = -1;
+ return;
}
/* We don't need them, so don't open directories or symlinks. */
if (S_ISLNK(mode))
read_link(inf, path);
inf->fd = fd;
- inf->path = path;
}
static void