From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 6 Mar 2008 15:54:11 +0300 From: Alexey Tourbin To: devel@lists.altlinux.org Message-ID: <20080306125411.GD7797@solemn.turbinal> Mail-Followup-To: devel@lists.altlinux.org References: <20080306122511.GC7797@solemn.turbinal> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vni90+aGYgRvsTuO" Content-Disposition: inline In-Reply-To: <20080306122511.GC7797@solemn.turbinal> Subject: Re: [devel] zlib/gzio.c: inconsistent gzeof() X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2008 12:59:10 -0000 Archived-At: List-Archive: List-Post: --vni90+aGYgRvsTuO Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 06, 2008 at 03:25:11PM +0300, Alexey Tourbin wrote: > =F1 =CF=C2=CE=C1=D2=D5=D6=C9=CC, =DE=D4=CF gzeof() =D7=C5=C4=A3=D4 =D3=C5= =C2=D1 =D0=CF-=D2=C1=DA=CE=CF=CD=D5, =D7 =DA=C1=D7=C9=D3=C9=CD=CF=D3=D4=C9 = =CF=D4 =D4=CF=C7=CF, > =CE=C1=C8=CF=C4=C9=CD=D3=D1 =CC=C9 =CD=D9 =D2=C5=D6=C9=CD=C5 "transparent= " (cat) =C9=CC=C9 =D6=C5 =D7 =D2=C5=D6=C9=CD=C5 =CE=C1=D3=D4=CF=D1=DD=C5=C7= =CF > =D2=C1=DA=D6=C1=D4=C9=D1. >=20 > =E1 =C9=CD=C5=CE=CE=CF, =D7 =D2=C5=D6=C9=CD=C5 =CE=C1=D3=D4=CF=D1=DD=C5= =C7=CF =D2=C1=DA=D6=C1=D4=C9=D1, =C5=D3=CC=C9 =D0=D2=CF=DE=C9=D4=C1=CE=CF = =C2=C1=D4=CA=D4=CF=D7 =CD=C5=CE=D8=DB=C5, > =DE=C5=CD =DA=C1=D0=D2=CF=DB=C5=CE=CF, =D4=CF (=C1=D7=D4=CF=CD=C1=D4=C9= =DE=C5=D3=CB=C9) =D7=D9=D3=D4=C1=D7=CC=D1=C5=D4=D3=D1 =C6=CC=C1=C7 EOF. = =F7 transparent > =D2=C5=D6=C9=CD=C5, =C5=D3=CC=C9 =D0=D2=CF=DE=C9=D4=C1=CE=CF =CD=C5=CE=D8= =DB=C5, =DE=C5=CD =D4=D2=C5=C2=D5=C5=D4=D3=D1, =D4=CF =C6=CC=C1=C7 EOF =D7= =D9=D3=D4=C1=D7=CC=D1=C5=D4=D3=D1 > =D4=CF=CC=D8=CB=CF =D0=CF=D3=CC=C5 =D3=CC=C5=C4=D5=C0=DD=C5=C7=CF gzread(= ), =CB=CF=D4=CF=D2=D9=CA =D7=CF=DA=D7=D2=C1=DD=C1=C5=D4 0. >=20 > $ cat test.c > #include > #include > #include > #include > int main(int argc, char *argv[]) > { > gzFile gz =3D gzopen(argv[1], "rb"); > assert(gz); >=20 > char buf[BUFSIZ]; > int n =3D gzread(gz, buf, sizeof(buf)); > printf("n=3D%d eof=3D%d\n", n, gzeof(gz)); >=20 > return 0; > } > $ echo a >a > $ echo a |gzip >a.gz > $ gcc -Wall test.c -lz > $ ./a.out a.gz > n=3D2 eof=3D1 > $ ./a.out a =20 > n=3D2 eof=3D0 > $=20 >=20 > =E8=CF=D4=C5=CC =D3=D0=D2=CF=D3=C9=D4=D8, =CE=C1=C4=CF =DC=D4=CF =C6=C9= =CB=D3=C9=D4=D8 =C9=CC=C9 =CE=C5=D4. =E5=DD=A3 =CF=C4=CE=CF =CC=C0=C2=CF=D0=D9=D4=CE=CF=C5 =CF=C2=D3=D4=CF=D1=D4= =C5=CC=D8=D3=D4=D7=CF: =C5=D3=CC=C9 =D0=D2=CF=DE=C9=D4=C1=CE=CF =D2=CF=D7= =CE=CF =D3=D4=CF=CC=D8=CB=CF =C2=C1=CA=D4=CF=D7, =D3=CB=CF=CC=D8=CB=CF =DA=C1=D0=D2=CF=DB=C5=CE=CF, =D4=CF =D7 =D2=C5=D6=C9= =CD=C5 =D2=C1=DA=D6=C1=D4=C9=D1 gzeof() =D7=CF=DA=D7=D2=C1=DD=C1=C5=D4 1 (= =C6=CC=C1=C7 z_eof =CE=C1 =D3=C1=CD=CF=CD =C4=C5=CC=C5 =CE=C5 =D5=D3=D4=C1=CE=CF=D7=CC=C5=CE, = =CE=CF =D7 gzeof() =C5=D3=D4=D8 =C4=CF=D0=CF=CC=CE=C9=D4=C5=CC=D8=CE=C1=D1 = =D0=D2=CF=D7=C5=D2=CB=C1 z_err =3D=3D Z_STREAM_END). =E1 =D3=D4=C1=CE=C4=C1=D2=D4=CE=D9=CA feof(3) =D7 =DC=D4=CF=CD =D3=CC=D5=DE= =C1=C5 =D7=D2=CF=C4=C5 =C2=D9 =D7=CF=DA=D7=D2=C1=DD=C1=C5=D4 0. --vni90+aGYgRvsTuO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iEYEARECAAYFAkfP6XMACgkQfBKgtDjnu0bUhQCdEBtzasdGZSkFw2ZMDpKAtzIU ksoAoMoR6+dq95GsZvSWKtfcej68pMUI =SdNQ -----END PGP SIGNATURE----- --vni90+aGYgRvsTuO--