diff options
Diffstat (limited to 'src/alf.c')
| -rw-r--r-- | src/alf.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -285,13 +285,14 @@ void crunch(void) { out_bitpos = 0; - store_token(TOK_RESET); + /* 0-byte input files don't get a TOK_RESET */ + if(input_len) + store_token(TOK_RESET); while(in_pos < input_len) { token = match_token(in_pos); store_token(token); new_pos = in_pos + tokentab[token].length; - // printf(" in_pos %d, new_pos %d\n", in_pos, new_pos); if(new_pos < input_len) make_token(in_pos, new_pos); in_pos = new_pos; @@ -332,11 +333,6 @@ void crunch_file(const char *filename) { fprintf(stderr, "%s: %s: this file is too large; only compressing the first 16MB.\n", self, filename); } - if(!input_len) { - fprintf(stderr, "%s: %s: can't compress a 0-byte (empty) file, skipping.\n", self, filename); - return; - } - if(opt_txtconv) convert_eols(); |
