Skip to content

Commit

Permalink
fix(dracut-install): handle correctly sysrootdir with trailing '/'
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
  • Loading branch information
kubiko authored and LaszloGombos committed Sep 7, 2024
1 parent 7bc1f53 commit 1c44cd7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/install/dracut-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,9 @@ static int parse_argv(int argc, char *argv[])
case 'r':
sysrootdir = optarg;
sysrootdirlen = strlen(sysrootdir);
/* ignore trailing '/' */
if (sysrootdir[sysrootdirlen-1] == '/')
sysrootdirlen--;
break;
case 'p':
if (regcomp(&mod_filter_path, optarg, REG_NOSUB | REG_EXTENDED) != 0) {
Expand Down

0 comments on commit 1c44cd7

Please sign in to comment.