Merge branch '32-filename-sanitization-can-fail-with-ascii-only-target' into 'dev'
Resolve "filename sanitization can fail with ascii-only target" See merge request atom/AtOM!46
This commit is contained in:
commit
6e827d7bd9
@ -55,11 +55,13 @@ getDestFile() {
|
|||||||
destfile="${filename##*/}"
|
destfile="${filename##*/}"
|
||||||
destfile="${destfile%.*}"
|
destfile="${destfile%.*}"
|
||||||
fi
|
fi
|
||||||
destfile=$(sanitizeFile "$destfile")
|
|
||||||
destfile=${destfile//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
|
||||||
if (( ${destinationascii["$destination"]} ))
|
if (( ${destinationascii["$destination"]} ))
|
||||||
then
|
then
|
||||||
|
destfile=${destfile//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
echo "$destfile" >&${toascii[1]}
|
echo "$destfile" >&${toascii[1]}
|
||||||
read -r -u${toascii[0]} destfile
|
read -r -u${toascii[0]} destfile
|
||||||
|
destfile=${destfile//::AtOM:NewLine:SQL:Inline::/$'\n'}
|
||||||
fi
|
fi
|
||||||
|
destfile=$(sanitizeFile "$destfile")
|
||||||
|
destfile=${destfile//$'\n'/::AtOM:NewLine:SQL:Inline::}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,9 @@ sanitizeFile() {
|
|||||||
string=${string/#+(.)/}
|
string=${string/#+(.)/}
|
||||||
string=${string/%+(.)/}
|
string=${string/%+(.)/}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# We can't have newlines either
|
||||||
|
string=${string//$'\n'/ }
|
||||||
fi
|
fi
|
||||||
echo "$string"
|
echo "$string"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user