92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
char* end = stpncpy(srv.sun_path, run, sizeof srv.sun_path);
end = stpncpy(end, ssz("/qutebrowser/"));
DIR* qb = opendir(srv.sun_path);
if (!qb) return start_instance;
struct dirent* ent;
while (ent = readdir(qb)) {
if (ent == NULL) return start_instance;
if (ent -> d_name[0] != '.') break;
}
if (ent == NULL) return start_instance;
end = stpncpy(end, ent->d_name,
(sizeof srv.sun_path) - (end - srv.sun_path));
closedir(qb);
}
|
|
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
char* end = stpncpy(srv.sun_path, run, sizeof srv.sun_path);
end = stpncpy(end, ssz("/qutebrowser/"));
DIR* qb = opendir(srv.sun_path);
if (!qb) return start_instance;
struct dirent* ent;
while (ent = readdir(qb)) {
if (ent == NULL) return start_instance;
if (strncmp(ent -> d_name, "ipc-", 4) == 0) break;
}
if (ent == NULL) return start_instance;
end = stpncpy(end, ent->d_name,
(sizeof srv.sun_path) - (end - srv.sun_path));
closedir(qb);
}
|