Compare commits

...

2 Commits

Author SHA1 Message Date
ScriptFanix
6e827d7bd9 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
2026-04-06 04:43:44 +02:00
ScriptFanix
60cd9f0e88 Resolve "filename sanitization can fail with ascii-only target" 2026-04-06 04:43:43 +02:00
2 changed files with 7 additions and 2 deletions

View File

@ -55,11 +55,13 @@ getDestFile() {
destfile="${filename##*/}"
destfile="${destfile%.*}"
fi
destfile=$(sanitizeFile "$destfile")
destfile=${destfile//$'\n'/::AtOM:NewLine:SQL:Inline::}
if (( ${destinationascii["$destination"]} ))
then
destfile=${destfile//$'\n'/::AtOM:NewLine:SQL:Inline::}
echo "$destfile" >&${toascii[1]}
read -r -u${toascii[0]} destfile
destfile=${destfile//::AtOM:NewLine:SQL:Inline::/$'\n'}
fi
destfile=$(sanitizeFile "$destfile")
destfile=${destfile//$'\n'/::AtOM:NewLine:SQL:Inline::}
}

View File

@ -26,6 +26,9 @@ sanitizeFile() {
string=${string/#+(.)/}
string=${string/%+(.)/}
fi
# We can't have newlines either
string=${string//$'\n'/ }
fi
echo "$string"
}