Simon Josefsson <[EMAIL PROTECTED]> writes:
> I think we should be able to assume free (NULL) works though
Yes. To my knowledge the last major system for which the 'free'
module was needed was SunOS 4.1.4 aka Solaris 1.1.2. Sun stopped
patching SunOS 4.1.4 in 2000 and stopped supporting it in 2
Paul Eggert <[EMAIL PROTECTED]> writes:
> Looks nice. A couple of comments:
>
>> + count = fread (buf + size, 1, BUFSIZ, stream);
>
> BUFSIZ is too small on many systems, for backward compatibility reasons.
> Why not change that "BUFSIZ" to "alloc - size - 1"?
Done.
> Also, for the common
Looks nice. A couple of comments:
> + count = fread (buf + size, 1, BUFSIZ, stream);
BUFSIZ is too small on many systems, for backward compatibility reasons.
Why not change that "BUFSIZ" to "alloc - size - 1"?
Also, for the common case of regular files that you have opened,
you can use fst
Simon Josefsson <[EMAIL PROTECTED]> writes:
> Hmmm. I've made the same mistake before. I'll see how hard it would
> be to write a tool that will "prepare" additions of a gnulib module,
> for one it should run indent on the files, and then run 'cvs
> --new-file diff' on the modules file, and the
Simon Josefsson <[EMAIL PROTECTED]> writes:
> I like this, and I also like your fread_file function. I will create
> a module read-file with two functions fread_file and read_file.
Here's the module. Only lighted tested, mostly to get feedback on the
approach, but if you agree with it, detailed
Bruno Haible <[EMAIL PROTECTED]> wrote:
> /* Read the contents of an input stream, and return it, terminated with a NUL
>byte. */
> char* fread_file (FILE* stream)
> {
How about an interface that provides a length as well as a malloc'd
buffer, so that it works also when the file contains NUL b
Bruno Haible <[EMAIL PROTECTED]> writes:
>> Index: modules/strfile
>
> I would call the module 'read-file' and the function 'read_file'. So that it's
> possible to add a module 'write_file' if needed, and for consistency with the
> 'copy-file' module.
I like this, and I also like your fread_file