Jim Meyering [Thu, 2 Oct 2003 17:33:54 +0000 (17:33 +0000)]
Don't require that the maximum length of a file name
encountered in a traversal fit in an `unsigned short',
and fix some portability bugs (don't depend on gcc).
Include "fts_.h", not <fts.h>.
(ALIGNBYTES) [!(__GNUC__ >= 2)]: Add a definition that works with
compilers that don't have __alignof__.
(MAX): Use a definition that doesn't depend on gcc.
(fts_build): Make `len' and `maxlen' be of type size_t, not int.
Test for overflow in a less type-dependent manner.
Test HAVE_STRUCT_DIRENT_D_TYPE, rather than
defined DT_DIR && defined _DIRENT_HAVE_D_TYPE.
(fts_palloc): Test for overflow in a less type-dependent manner.
(fts_safe_changedir): Use stat, not stat64.
Use fstat, not __fxstat64(_STAT_VER.
Jim Meyering [Thu, 2 Oct 2003 17:33:42 +0000 (17:33 +0000)]
Don't require that the maximum length of a file name
encountered in a traversal fit in an `unsigned short',
and fix some portability bugs (don't depend on gcc).
[FTS] (fts_pathlen): Change type from int to size_t.
[FTSENT] (fts_pathlen): Change type from u_short to size_t.
(fts_level): Change type from u_short to int.
Jim Meyering [Wed, 1 Oct 2003 08:09:02 +0000 (08:09 +0000)]
(print_news_deltas): New function, extracted from main.
(main): Make `news_file' an array.
Use '...=s' => \@var for --news and --url-directory specs.
Before there were a couple of problems.
Jim Meyering [Sat, 27 Sep 2003 06:57:07 +0000 (06:57 +0000)]
Don't exhaust virtual memory when processing large inputs.
Fix this by removing csplit's internal free-list management;
instead rely on malloc for that.
(free_list): Remove global.
(clear_all_line_control): Remove function.
(get_new_buffer): Always use create_new_buffer to obtain a
new buffer, rather than searching free_list.
(free_buffer): Just call free.
Jim Meyering [Wed, 24 Sep 2003 08:21:30 +0000 (08:21 +0000)]
(check_and_close, dump, dump_strings): Don't report bogus errno value
after ferror discovers an output error. We don't know the proper
errno value, since it might have been caused by any of a whole
bunch of calls, and it might have been trashed in the meantime.
Fixing this problem will require much more extensive changes;
in the meantime just say "write error".
(skip): If a read fails, don't retry it later, so
that we report the proper errno.
Jim Meyering [Tue, 23 Sep 2003 21:57:13 +0000 (21:57 +0000)]
(close_output_file): Don't report bogus errno value
after ferror discovers an output error. We don't know the proper
errno value, since it might have been caused by any of a whole
bunch of calls, and it might have been trashed in the meantime.
Fixing this problem will require much more extensive changes;
in the meantime just say "write error".
Jim Meyering [Mon, 22 Sep 2003 15:59:29 +0000 (15:59 +0000)]
(check_file): Report error right away if I/O fails,
so that the proper errno value is used.
(check_file): Check for ferror (stdout) even if ostream == stdout.
(check_file): Don't report bogus errno value
after ferror discovers an output error. We don't know the proper
errno value, since it might have been caused by any of a whole
bunch of calls, and it might have been trashed in the meantime.
Fixing this problem will require much more extensive changes;
in the meantime just say "write error".
Jim Meyering [Mon, 22 Sep 2003 07:07:16 +0000 (07:07 +0000)]
Switch encoding from Latin-1 to UTF-8.
(WRITTEN_BY): Change "Franc,ois" (actually using
c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
xgettext requires.
Jim Meyering [Thu, 18 Sep 2003 18:22:23 +0000 (18:22 +0000)]
Update AUTHORS definition to be a comma-separated list of strings and/or update
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
Jim Meyering [Thu, 18 Sep 2003 18:09:44 +0000 (18:09 +0000)]
This lets translators provide better translations for the
`Written by ...' part of --version output.
Include stdarg.h, stdlib.h, string.h, and xalloc.h.
(version_etc): Make this function variadic,
with a NULL-terminated list of author name strings.
(version_etc_va): New function.