Jim Meyering [Sat, 8 Sep 2007 19:25:52 +0000 (19:25 +0000)]
Rename __fpending.c -> fpending.c and __fpending.h -> fpending.h
* lib/fpending.h: Rename from __fpending.h.
* lib/fpending.c: Rename from __fpending.c.
Include "fpending.h", not "__fpending.h".
* lib/__fpending.h, lib/__fpending.c: Remove files.
* modules/fpending (Files): Reflect new file names.
* lib/close-stream.c: Include "fpending.h", not "__fpending.h".
Jim Meyering [Sun, 2 Sep 2007 23:05:26 +0000 (23:05 +0000)]
Import changes from coreutils for bootstrap script.
* build-aux/bootstrap (WGET_COMMAND): Remove code to set this variable.
bootstrap: uses rsync to download the .po files
* build-aux/bootstrap (po_download_command_format): New global.
(download_po_files): Use rsync.
(update_po_files): Don't remove .po files after download,
so future rsync runs can take advantage of the copies.
* build-aux/bootstrap (gnulib_tool): Make sha1sum check quietly.
Solve the unnecessary-.po-file-regeneration problem once and for all.
* build-aux/bootstrap (download_po_files): New function, renamed from
get_translations. Now, downloads, but doesn't update LINGUAS.
(update_po_files): New function.
bootstrap: Ignore more.
* build-aux/bootstrap (symlink_to_dir): Add a directory name like
uniwidth to e.g., lib/.gitignore.
(slurp): Handle the sys_stat_.h -> sys mapping, too.
* build-aux/bootstrap: New setting: vc_ignore.
(insert_sorted_if_absent): Create $file if absent.
Adapt to new, possibly empty, list: $vc_ignore.
bootstrap: generate more ignorable names
* build-aux/bootstrap (slurp): When generating ignorable names,
also map .sin to .sed, .gperf to .c, and .y to .c.
Jim Meyering [Thu, 23 Aug 2007 08:33:16 +0000 (08:33 +0000)]
Getdelim touchup.
* lib/getdelim.c (getdelim): Don't bother to save/restore errno
around the funlockfile call, since funlockfile never sets errno.
Don't set errno upon failed realloc.
Eric Blake [Thu, 23 Aug 2007 02:00:18 +0000 (02:00 +0000)]
Getline touchups.
* lib/getdelim.c (getdelim): Revert regression that required *n to
be 0 when *lineptr is NULL. Preserve errno across funlockfile.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Check for declaration of
getdelim, rather than whether implementation is missing.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise for getline.
* lib/stdio_.h (getline): Also declare if replacement is
required.
* doc/functions/getdelim.texi: New file.
* doc/functions/getline.texi: Likewise.
* doc/gnulib.texi (Function Substitutes): Add new files.
Reported by Bruno Haible.
Eric Blake [Sun, 19 Aug 2007 15:47:14 +0000 (15:47 +0000)]
Test yesno in combination with closein.
* lib/yesno.c (yesno): Document use of stdin.
* modules/yesno-tests (Files): New module.
* tests/test-yesno.c (main): New file.
* tests/test-yesno.sh: Likewise.
Bruno Haible [Sat, 18 Aug 2007 10:53:41 +0000 (10:53 +0000)]
- Comment style.
- Change 'heuristic' from 'int' to 'bool'.
- Remove the 'const' from the context parameter. Needed because in the
fstrcmp case, the NOTE_INSERT and NOTE_DELETE macros modify fields
in the context, and an extra indirection would only cost performance:
#define EXTRA_CONTEXT_FIELDS \
/* The number of elements inserted or deleted. */ \
int xvec_edit_count; \
int yvec_edit_count;
#define NOTE_DELETE(ctxt, xoff) ctxt->xvec_edit_count++
#define NOTE_INSERT(ctxt, yoff) ctxt->yvec_edit_count++
- In 'diag', keep two blocks of code in sync (lines 191 and 224).
- Undefine the macro USE_HEURISTIC after use.
Jim Meyering [Sat, 18 Aug 2007 07:16:52 +0000 (07:16 +0000)]
New file: lib/idcache.h
* NEWS: Mention the addition.
* modules/idcache (Files): Add lib/idcache.h
* lib/idcache.c: Include "idcache.h".
Don't include <sys/types.h>.
Add a FIXME comment.
Move file-scoped "static" declarations to the top.
* lib/idcache.h: New file. Include <sys/types.h> here, instead.
Paul Eggert [Fri, 17 Aug 2007 23:29:23 +0000 (23:29 +0000)]
* MODULES.html.sh: Add diffseq.
* modules/diffseq: New file.
* lib/diffseq.h: New file, from GNU gettext with a few minor changes,
extracted from GNU gettext's fstrcmp.c and GNU diff's analyze.c.
Paul Eggert [Fri, 17 Aug 2007 23:13:57 +0000 (23:13 +0000)]
Import changes from coreutils for bootstrap script.
2007-07-21 Paul Eggert <eggert@cs.ucla.edu>
* build-aux/bootstrap (slurp): Work even in environments where
"ls" defaults to "ls -A". Put in a FIXME, though, since the
current code does not slurp files whose names start with ".", and
this looks like it might be a troublesome area.
2007-07-11 Jim Meyering <jim@meyering.net>
If there's a GPL vN copyright comment, require that N == 3.
2007-07-08 Jim Meyering <jim@meyering.net>
Run the coreutils-specific code only if tests/Makefile.am.in exists.
* build-aux/bootstrap (mam_template): Move definition out of loop.
Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
* build-aux/bootstrap (symlink_to_dir): Rename function from
symlink_to_gnulib. Add a directory parameter. Update all
callers.
(cp_mark_as_generated): Also check for -- and link to -- files in
gl/.
2007-07-08 Jim Meyering <jim@meyering.net>
Adapt to deeper hierarchy in gnulib.
* build-aux/bootstrap (symlink_to_dir): If the destination
directory doesn't exist, create it. This is required at least for
"lib/uniwidth/cjk.h".
2007-05-15 Jim Meyering <jim@meyering.net>
* build-aux/bootstrap: Now that generated Makefile.am files
are no longer under version control, they must be created at
bootstrap time.
Ben Pfaff [Wed, 15 Aug 2007 03:37:54 +0000 (03:37 +0000)]
* lib/count-one-bits.h: Add comments. (From Bruno Haible.)
* lib/count-one-bits.h: Don't include <limits.h>; no longer needed
given the changes below.
(COUNT_ONE_BITS): Use 'verify' rather than 'verify_true'. Work
even on hosts that have padding bits beyond the supported 64.
(From Paul Eggert.)
Paul Eggert [Fri, 10 Aug 2007 19:02:31 +0000 (19:02 +0000)]
* NEWS: In xstrtol, remove STRTOL_FATAL_ERROR and add xstrtol_fatal.
* lib/xstrtol.h: Don't include exitfail.h; that's now internal to
xstrtol.c. Include getopt.h, since xstrtol_fatal's signature
depends on it.
(xstrtol_error): Remove.
(xstrtol_fatal): New decl, replacing the functionality of xstrtol_error
but with a different signature.
(ATTRIBUTE_NORETURN, __attribute__): New macros.
* lib/xstrtol-error.c: Include exitfail.h.
(xstrtol_fatal): New function, with a different signature from the
old xstrtol_error, so that the caller need not worry about passing
in an exit status, or about storage management of the option argument.
(xstrtol_error): Now a static function. Redo signature to
implement xstrtol_fatal. Output the correct number of hyphens in
front of the option so that the caller need not worry about
storage management.
(N_): New macro.
(_): Remove; not used now.
* modules/xstrtol: Depend on getopt.
* tests/test-xstrtol.c (main): Use new xstrtol_error function instead
of old STRTOL_FATAL_ERROR macro.
* tests/test-xstrtol.sh (t-xstrtol.xo): Adjust to match new behavior
of test program.
Eric Blake [Wed, 8 Aug 2007 12:45:54 +0000 (12:45 +0000)]
Move xstrtol messages into gnulib domain, when --pobase is used.
* lib/xstrtol.h (_STRTOL_ERROR): Move messages out of macro...
* lib/xstrtol-error.c (xstrtol_error): ...into new file.
* modules/xstrtol (Files): Distribute new file.
* m4/xstrtol.m4 (gl_XSTRTOL): Build new file.
* lib/xstrtol.c (TESTING_XSTRTO): Move tests...
* tests/test-xstrtol.c: ...into new file.
* tests/test-xstrtoul.c: Also test xstrtoul.
* tests/test-xstrtoimax.c: Also test xstrtoimax.
* tests/test-xstrtoumax.c: Also test xstrtoumax.
* tests/test-xstrtol.sh: Drive the tests.
* tests/test-xstrtoimax.sh: Likewise.
* tests/test-xstrtoumax.sh: Likewise.
* modules/xstrtol-tests: New module.
* modules/xstrtoimax-tests: Likewise.
* modules/xstrtoumax-tests: Likewise.
Jim Meyering [Wed, 8 Aug 2007 06:43:35 +0000 (06:43 +0000)]
New function: mfile_name_concat.
* lib/filenamecat.c (mfile_name_concat): New function, just like
file_name_concat, but return NULL upon failure rather than exiting
with a diagnostic.
* lib/filenamecat.h: Declare it.
Paul Eggert [Mon, 6 Aug 2007 16:44:24 +0000 (16:44 +0000)]
* NEWS: Describe interface changes to human, xstrtol.
* lib/human.h: Include <xstrtol.h>.
(human_options): Return enum strtol_error, not int. Remove
bool arg; take int * instead.
* lib/human.c: Don't include "gettext.h".
(_): Remove; no longer used.
Don't include <xstrtol.h>, since human.h does it.
(human_options): Adjust to abovementioned interface changes.
Do not report error to stderr; that's now the caller's
responsibility.
* lib/xstrtol.c (main) [defined TESTING_XSTRTO]: Adjust to
interface change.
* lib/xstrtol.h (_STRTOL_ERROR): Take Option, Arg rather than
Str, Argument_type_string. All uses changed. Put " argument"
in diagnostics to make them clearer. Change wording of suffix
message for clarity.
(STRTOL_FATAL_ERROR): Take Option, Arg rather than Str,
Argument_type_string.
(STRTOL_FATAL_WARN): Remove; no longer used.
* modules/human (Depends-on): Remove gettext-h.
Jim Meyering [Mon, 30 Jul 2007 12:16:34 +0000 (12:16 +0000)]
* lib/fts.c (fts_read): Upon failure to chdir into a subdirectory,
set fts_info to FTS_DNR, not to FTS_ERR, so that the caller knows
it has valid stat data. This bug would cause du not to count the
sizes of inaccessible directories.
Patch by Jose Maria Plans, reported in http://bugzilla.redhat.com/250077
Bruno Haible [Wed, 25 Jul 2007 22:42:36 +0000 (22:42 +0000)]
2007-07-25 Jim Meyering <jim@meyering.net>
Bruno Haible <bruno@clisp.org>
* lib/xstrtol.h (_STRTOL_ERROR): Change third argument from a
localized noun to an option name.
(STRTOL_FATAL_ERROR, STRTOL_FAIL_WARN): Likewise.
* lib/human.h (human_options): Insert a third argument.
* lib/human.h (human_options): Likewise. Pass it to STRTOL_FATAL_ERROR.
Ben Pfaff [Tue, 24 Jul 2007 02:35:09 +0000 (02:35 +0000)]
(popcount32): Reduce size of constants, to allow better code
generation, and add U to large constants to avoid warnings, in non-GCC
case.
Suggested by Bruno Haible.