Skip to content

Commit

Permalink
svc/sdr.{ba,z}sh: (still) fix prefix slash (/)
Browse files Browse the repository at this point in the history
  • Loading branch information
tokiclover committed Oct 13, 2014
1 parent b5acc36 commit 88a4c19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion svc/sdr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ grep -q squashfs /proc/filesystems ||
die "failed to initialize squashfs kernel module, exiting"

for dir in ${opts[-dir]//:/ }; do
base="${opts[-root]}/${dir}"
[[ "${dir#/}" == "${dir}" ]] && dir="/${dir}"
base="${opts[-root]}${dir}"

if [[ -e ${base}.squashfs ]]; then
if (( ${opts[-offset]} != 0 )); then
Expand Down
3 changes: 2 additions & 1 deletion svc/sdr.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ grep -q squashfs /proc/filesystems ||
die "failed to initialize squashfs kernel module, exiting"

for dir (${(pws,:,)opts[-dir]}) {
base=${opts[-root]}/${dir}
[[ ${dir#/} == ${dir} ]] && dir=/${dir}
base=${opts[-root]}${dir}

if [[ -e ${base}.squashfs ]]; then
if (( ${opts[-offset]} != 0 )); then
Expand Down

0 comments on commit 88a4c19

Please sign in to comment.