about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-09-17 00:59:04 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-09-17 00:59:04 +0200
commit1fea688aa22c88d9a11aabcce8cfafce3b100946 (patch)
tree1aa221a72c0b964422ef720f2113e645ce9ffae8 /lr.c
parent4b154cdfc9ea0e656ab1e003d7da398050f954a7 (diff)
downloadlr-1fea688aa22c88d9a11aabcce8cfafce3b100946.tar.gz
lr-1fea688aa22c88d9a11aabcce8cfafce3b100946.tar.xz
lr-1fea688aa22c88d9a11aabcce8cfafce3b100946.zip
recurse: lstat on symlink loops, don't fail
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index 052bc29..2e9ad47 100644
--- a/lr.c
+++ b/lr.c
@@ -1868,7 +1868,8 @@ recurse(char *path, struct history *h)
 	int root = (path[0] == '/' && path[1] == 0);
 
 	if (resolve ? stat(fpath, &st) : lstat(fpath, &st) < 0) {
-		if (resolve && errno == ENOENT && !lstat(fpath, &st)) {
+		if (resolve && (errno == ENOENT || errno == ELOOP) &&
+		    !lstat(fpath, &st)) {
 			/* ignore */
 		} else if (!h) {
 			/* warn for toplevel arguments */