lib/read-file.c


Log

Author Commit Date CI Message
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Jim Meyering 94879b67 2010-12-27T11:05:00 read-file.c: tweak syntax * lib/read-file.c (fread_file): Remove space after "*" in function definitions.
Pádraig Brady 5c84fa52 2010-12-13T08:08:23 read-file: reorganize to avoid various issues * lib/read-file.c (fread_file): Read 1 more byte than is currently in a regular file, to immediately detect EOF, and thus avoid any realloc()s. As well as being slower, these may fail, thus artificially limiting the supported size. Allocate up to SIZE_MAX for streams, rather than limiting to about SIZE_MAX - SIZE_MAX/5. Don't use the 'size + BUFSIZ + 1' expression, which could overflow and cause invalid operation. As a style decision, explicitly check for overflow rather than using a temporary roll over variable (new_alloc).
Bruno Haible 32a3eff7 2010-08-28T16:22:14 read-file: Don't occupy too much unused memory.
Giuseppe Scrivano 3e53db21 2010-08-28T16:12:37 read-file: Avoid memory reallocations with regular files. * lib/read-file.c: Include <sys/stat.h>, <stdio.h>, <stdint.h>. (fread_file): With regular files, use the remaining length as the initial buffer size. Check against overflow. * modules/read-file (Depends-on): Add ftello, malloc-posix, stdint, sys_stat.
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Jim Meyering 3030c5b5 2009-12-28T10:50:36 update nearly all FSF copyright year lists to include 2009 The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
Bruno Haible 441aa304 2009-12-10T20:28:30 Use spaces for indentation, not tabs.
Eric Blake a42e0dae 2006-10-29T21:52:55 * lib/arcfour.c: Assume config.h. * lib/arctwo.c: Likewise. * lib/base64.c: Likewise. * lib/check-version.c: Likewise. * lib/crc.c: Likewise. * lib/des.c: Likewise. * lib/gc-gnulib.c: Likewise. * lib/gc-libgcrypt.c: Likewise. * lib/gc-pbkdf2-sha1.c: Likewise. * lib/getaddrinfo.c: Likewise. * lib/getdelim.c: Likewise. * lib/getline.c: Likewise. * lib/hmac-md5.c: Likewise. * lib/hmac-sha1.c: Likewise. * lib/iconvme.c: Likewise. * lib/md2.c: Likewise. * lib/md4.c: Likewise. * lib/memxor.c: Likewise. * lib/read-file.c: Likewise. * lib/readline.c: Likewise. * lib/rijndael-alg-fst.c: Likewise. * lib/rijndael-api-fst.c: Likewise. * lib/xgetdomainname.c: Likewise.
Simon Josefsson 7a8df33d 2006-06-21T08:02:40 2006-06-19 Paul Eggert <eggert@cs.ucla.edu> * read-file.c (fread_file): Start with buffer allocation of 0 bytes rather than 1 byte; this simplifies the code. Don't invoke feof; it's not needed. Refactor to avoid duplicate code to free buffer and save/restore errno. (internal_read_file): Remove unused local.
Simon Josefsson 08c03e59 2006-06-16T19:40:12 Add read-file module.