diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c index f38865a19..7df3748e4 100644 --- a/src/install/dracut-install.c +++ b/src/install/dracut-install.c @@ -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) {