diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index bec8010..45e8b14 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -452,12 +452,12 @@ relpath() { return fi - while [[ "${filedir#$common/}" = "$filedir" ]]; do + while [[ "${filedir#"$common"/}" = "$filedir" ]]; do common="$(dirname "$common")" result="../$result" done - result="${result}${filedir#$common/}" + result="${result}${filedir#"$common"/}" echo "${result}/$(basename "$file")" } diff --git a/kpatch-build/kpatch-cc b/kpatch-build/kpatch-cc index d2bccdd..2a3d264 100755 --- a/kpatch-build/kpatch-cc +++ b/kpatch-build/kpatch-cc @@ -23,7 +23,7 @@ if [[ "$TOOLCHAINCMD" =~ ^(.*-)?gcc$ || "$TOOLCHAINCMD" =~ ^(.*-)?clang$ ]] ; th [[ "$obj" = */.tmp_mc_*.o ]] && break; [[ "$obj" = */.tmp_*.o ]] && obj="${obj/.tmp_/}" - relobj=${obj##$KPATCH_GCC_SRCDIR/} + relobj=${obj##"$KPATCH_GCC_SRCDIR"/} case "$relobj" in *.mod.o|\ *built-in.o|\