Problems unzipping ODS files have been reported on windows. This change
might fix them.
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2011, 2013 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2013, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
zr->members[zr->nm++] = zm;
zr->members[zr->nm++] = zm;
- zm->fp = fopen (zr->filename, "r");
+ zm->fp = fopen (zr->filename, "rb");
zm->ref_cnt = 1;
zm->errs = zr->errs;
zm->ref_cnt = 1;
zm->errs = zr->errs;
- zr->fr = fopen (filename, "r");
+ zr->fr = fopen (filename, "rb");
if (NULL == zr->fr)
{
ds_put_cstr (zr->errs, strerror (errno));
if (NULL == zr->fr)
{
ds_put_cstr (zr->errs, strerror (errno));
- fread (&byte, 1, 1, fp);
+ if (1 != fread (&byte, 1, 1, fp))
+ break;
if ( byte == seq[state])
state++;
if ( byte == seq[state])
state++;