summaryrefslogtreecommitdiffstats
path: root/src/basic/os-util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/basic/os-util.c
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/basic/os-util.c')
-rw-r--r--src/basic/os-util.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/basic/os-util.c b/src/basic/os-util.c
index 985d89b..0d26d18 100644
--- a/src/basic/os-util.c
+++ b/src/basic/os-util.c
@@ -72,16 +72,11 @@ int path_extract_image_name(const char *path, char **ret) {
r = path_extract_filename(path, &fn);
if (r < 0)
return r;
-
if (r != O_DIRECTORY) {
- /* Chop off any image suffixes we recognize (unless we already know this must refer to some dir */
- FOREACH_STRING(suffix, ".sysext.raw", ".confext.raw", ".raw") {
- char *m = endswith(fn, suffix);
- if (m) {
- *m = 0;
- break;
- }
- }
+ /* Chop off any image suffixes we recognize (unless we already know this must refer to some dir) */
+ char *m = ENDSWITH_SET(fn, ".sysext.raw", ".confext.raw", ".raw");
+ if (m)
+ *m = 0;
}
/* Truncate the version/counting suffixes */