diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-04-26 19:53:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-04-26 19:53:51 +0000 |
commit | a3ff344727964d434ae026e9de9efbe2b04fcbc9 (patch) | |
tree | 92e22b6230af1a1411f5fc37cdc74fe463d2f8e9 | |
parent | 327d76b209bb107dd185cd1c062f3ef7d9128d73 (diff) |
stat() the original link path not the resolved one which may be relative.
-rw-r--r-- | usr.bin/file/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/file/file.c b/usr.bin/file/file.c index 02f5f24296d..84bedfff150 100644 --- a/usr.bin/file/file.c +++ b/usr.bin/file/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.32 2015/04/24 17:34:57 nicm Exp $ */ +/* $OpenBSD: file.c,v 1.33 2015/04/26 19:53:50 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -250,7 +250,7 @@ read_link(struct input_file *inf) if (stat(inf->path, &inf->sb) == -1) inf->error = strerror(errno); } else { - if (stat(inf->link_path, &sb) == -1) + if (stat(inf->path, &sb) == -1) inf->link_target = errno; } } |