[programs] Fix infinite loop when empty input is passed to trainer
When an empty input file was passed to the dictionary trainer, it would infinite loop. The added test case exposes the bug, and is fixed with this PR.
This commit is contained in:
1 parent
87406b5f3b
commit
da737c7ab8
3 files changed
+14
-1
No files matched your search
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
for i in $(seq 50); do
|
||||
datagen -s$i > file$i
|
||||
done
|
||||
touch empty
|
||||
|
||||
set -v
|
||||
zstd -q --train empty file*
|
||||
Reference in new issue
Block a user