Re: Patch to make GNU indent work on 64-bit file systems

Petr Pisar <[email protected]> Tue, 26 Mar 2013 14:40:05 +0100
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
On Mon, Mar 25, 2013 at 01:43:19PM -0700, Eric Fischer wrote:
> Indent doesn't work on file systems with 64-bit inode numbers because calls
> to fstat() will overflow and fail.
> 
> Here is a minimal patch to make it use fstat64() instead, also at
> https://github.com/ericfischer/indent/commit/b9e8ee5c9b0e6b36737fab5cc821dfc7f2f57237
> 
I've already posted patch
<http://lists.gnu.org/archive/html/bug-indent/2013-02/msg00001.html>
targeting the same issue.

Your patch forces stat64 unconditionally which is not portable. Moreover the
indent itself does not handle 64-bit file size. My patch makes indent 64-bit
safe while still using stat() and struct stat. 64-bit interface can be enabled
but putting -D_FILE_OFFSET_BITS=64 to CFLAGS at configure time.

-- Petr

_______________________________________________
bug-indent mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-indent
signature.asc (application/pgp-signature, 230 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iF0EABEIAAYFAlFRpTQACgkQEsnFx2fG+qJBbAD6A/+h64nafOeuYKMio85AhqRD
IHLjarYhk5VjiRPZlv0A+M8Gxw/jA0KipOB2Qeuo+o4sO9kE0TFdR4dV+Niq5bk=
=vd/k
-----END PGP SIGNATURE-----