Skip to content
Snippets Groups Projects
Commit 6055d84b authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

Fix reading symlinks

The st_size field of a symlink doesn't have to be correct, e.g. for
/dev/fd symlinks.
parent 0a62d9b3
No related branches found
No related tags found
No related merge requests found
...@@ -209,7 +209,7 @@ Path readLink(const Path & path) ...@@ -209,7 +209,7 @@ Path readLink(const Path & path)
else if (rlsize > st.st_size) else if (rlsize > st.st_size)
throw Error(format("symbolic link ‘%1%’ size overflow %2% > %3%") throw Error(format("symbolic link ‘%1%’ size overflow %2% > %3%")
% path % rlsize % st.st_size); % path % rlsize % st.st_size);
return string(buf, st.st_size); return string(buf, rlsize);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment