}
}
+bool path_equal(const char *a, const char *b) {
+ assert(a);
+ assert(b);
+
+ if ((a[0] == '/') != (b[0] == '/'))
+ return false;
+
+ for (;;) {
+ size_t j, k;
+
+ a += strspn(a, "/");
+ b += strspn(b, "/");
+
+ if (*a == 0 && *b == 0)
+ return true;
+
+ if (*a == 0 || *b == 0)
+ return false;
+
+ j = strcspn(a, "/");
+ k = strcspn(b, "/");
+
+ if (j != k)
+ return false;
+
+ if (memcmp(a, b, j) != 0)
+ return false;
+
+ a += j;
+ b += k;
+ }
+}
+
char *ascii_strlower(char *t) {
char *p;
while ((de = readdir(d))) {
int fd = -1;
- if (de->d_name[0] == '.')
+ if (ignore_file(de->d_name))
continue;
if ((r = safe_atoi(de->d_name, &fd)) < 0)
if (ioctl(fd, VT_ACTIVATE, vt) < 0)
r = -errno;
- close_nointr(r);
+ close_nointr_nofail(r);
return r;
}
}
if (notify >= 0)
- close_nointr(notify);
+ close_nointr_nofail(notify);
if ((r = reset_terminal(fd)) < 0)
log_warning("Failed to reset terminal: %s", strerror(-r));
fail:
if (fd >= 0)
- close_nointr(fd);
+ close_nointr_nofail(fd);
if (notify >= 0)
- close_nointr(notify);
+ close_nointr_nofail(notify);
return r;
}