]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portablectl: Strip .v or .raw.v when extracting prefix
authorLouis Stagg <lrs@ambadoom.net>
Tue, 3 Feb 2026 18:48:59 +0000 (18:48 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 27 Feb 2026 21:57:04 +0000 (21:57 +0000)
This allows a plain "portablectl attach foobar.raw.v" without needing to
specify a prefix.

(cherry picked from commit 23c6ab3971eb22d9c656165e8c6314135df0ee6c)
(cherry picked from commit a8679d8770194921f13ce3ca7b44df8432e20aaa)
(cherry picked from commit edf05ddd99df99d62512da7ef8ced594c5e698b8)

src/portable/portablectl.c

index b5678e094b8b44bc8e15de52519b8bf1886ab511..abde08849c38435171d53836ae401a80f56990d2 100644 (file)
@@ -144,7 +144,7 @@ static int extract_prefix(const char *path, char **ret) {
         else {
                 const char *e;
 
-                e = endswith(bn, ".raw");
+                e = ENDSWITH_SET(bn, ".raw.v", ".raw", ".v");
                 if (!e)
                         e = strchr(bn, 0);