]> 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)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 5 Feb 2026 22:12:18 +0000 (23:12 +0100)
This allows a plain "portablectl attach foobar.raw.v" without needing to
specify a prefix.

src/portable/portablectl.c

index b55eda795531a1a9f6ade8f335a54cd504e1a407..dfe6df3bf310d7fa57e79233ea864f3028a5763f 100644 (file)
@@ -142,7 +142,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);