- for (; beg != end; ++beg) {
- if (prefixIs(beg->leaf(), "lyx_tmpdir" + pid)) {
- fs::path lyxsocket = beg->path() / "lyxsocket";
- if (fs::exists(lyxsocket)) {
- dirlist.push_back(lyxsocket);
- }
- }
+ for (; it != end; ++it) {
+ if (!it->isDirectory())
+ continue;
+ string const tmpdir = it->absFileName();
+ if (!contains(tmpdir, "lyx_tmpdir" + pid))
+ continue;
+
+ FileName lyxsocket(tmpdir + "/lyxsocket");
+ if (lyxsocket.exists())
+ dirlist.push_back(lyxsocket);