MCPcopy Create free account
hub / github.com/containers/bubblewrap / path_equal

Function path_equal

utils.c:246–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246bool
247path_equal (const char *path1,
248 const char *path2)
249{
250 while (true)
251 {
252 /* Skip consecutive slashes to reach next path
253 element */
254 while (*path1 == '/')
255 path1++;
256 while (*path2 == '/')
257 path2++;
258
259 /* No more prefix path elements? Done! */
260 if (*path1 == 0 || *path2 == 0)
261 return *path1 == 0 && *path2 == 0;
262
263 /* Compare path element */
264 while (*path1 != 0 && *path1 != '/')
265 {
266 if (*path1 != *path2)
267 return false;
268 path1++;
269 path2++;
270 }
271
272 /* Matched path1 path element, must be entire path element */
273 if (*path2 != '/' && *path2 != 0)
274 return false;
275 }
276}
277
278
279bool

Callers 2

parse_mountinfoFunction · 0.85
bind_mountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected