Handle files without a final newline

This commit is contained in:
Héctor Molinero Fernández 2021-12-25 14:12:56 +01:00
commit 96d56829f1
8 changed files with 8 additions and 7 deletions

1
hblock
View file

@ -582,6 +582,7 @@ main() {
touch -- "${sourceDlFile:?}.part"
{
if fetchUrl "${url:?}" > "${sourceDlFile:?}.part"; then
printf '\n' >> "${sourceDlFile:?}.part"
mv -- "${sourceDlFile:?}.part" "${sourceDlFile:?}"
else
rm -f -- "${sourceDlFile:?}.part"

View file

@ -1,2 +1,2 @@
single-entry-000.com
entry-with-comment-000.com
entry-with-comment-000.com

View file

@ -1,2 +1,2 @@
denied-entry-000.com
denied-entry-001.com
denied-entry-001.com

View file

@ -1,2 +1,2 @@
Footer line 1
Footer line 2
Footer line 2

View file

@ -1,2 +1,2 @@
Header line 1
Header line 2
Header line 2

View file

@ -12,4 +12,4 @@ jp
東京.jp
香港
網絡.香港
網絡.香港

View file

@ -49,4 +49,4 @@ not-an-iP ENTry-With-pReFIx-009.coM
eNTry-with-coMMeNt-000.COM# dUmMY cOMMENt
entry-with-comment-001.CoM Entry-WITh-cOmMEnt-002.cOM # DuMmY CoMMenT
0.0.0.0 ENTrY-wItH-COMMEnT-003.CoM ENTrY-wITH-cOmMEnt-004.cOm # DumMY coMmeNT
#0.0.0.0 ENTRY-wiTH-ComMenT-005.Com
#0.0.0.0 ENTRY-wiTH-ComMenT-005.Com

View file

@ -39,4 +39,4 @@ example-037.net
example-038.xn--1lqs71d.jp
example-039.org
example-040.xn--od0alg.xn--j6w193g
example-041.jp
example-041.jp