- NULSTR_FOREACH_PAIR(j, k, symlinks)
- symlink_and_label(j, k);
+ NULSTR_FOREACH_PAIR(j, k, symlinks) {
+ if (j[0] == '-') {
+ j++;
+
+ if (access(j, F_OK) < 0)
+ continue;
+ }
+
+ if (prefix) {
+ _cleanup_free_ char *link_name = NULL;
+
+ link_name = strjoin(prefix, "/", k, NULL);
+ if (!link_name)
+ return -ENOMEM;
+
+ symlink_label(j, link_name);
+ } else
+ symlink_label(j, k);
+ }
+
+ return 0;