Re: getline.h

2007-08-22 Thread Simon Josefsson
Eric Blake <[EMAIL PROTECTED]> writes: > According to Jim Meyering on 8/19/2007 2:18 PM: >> Eric Blake <[EMAIL PROTECTED]> wrote: >>> I could go either way, although I'm leaning toward doing it now; >> >> I agree. Doing it now is fine. > > How about this for the patch, then? Simon, this is your

Re: getline.h

2007-08-22 Thread Jim Meyering
Eric Blake <[EMAIL PROTECTED]> wrote: > 2007-08-21 Eric Blake <[EMAIL PROTECTED]> > > Move getline and getdelim into stdio.h, per POSIX 200x. ... Thanks for doing that. I've adjusted coreutils accordingly: http://git.sv.gnu.org/gitweb/?p=coreutils.git

Re: case-insensitive hash of strings

2007-08-22 Thread Jim Meyering
Eric Blake <[EMAIL PROTECTED]> wrote: > A couple of questions. First, in hash-pjw.c, should we be using unsigned > char instead of char to iterate through the NUL-terminated string? I'd rather not change it, unless there's a problem. Have you found inputs for which it doesn't work well?

Re: getline.h

2007-08-22 Thread Bruno Haible
Hi Eric, Thanks for working on this, and for the unit tests. The patch - excluding the one of getdelim.c - is nearly perfect. But I see three problems: 1) You define the shell variable HAVE_DECL_GETDELIM depending whether the function exists, not whether the function is declared. But for examp

Multiply exported Gnulib symbols

2007-08-22 Thread Ludovic Courtès
Hi, The following issue was brought up recently on the Guile list [0]. Suppose some library uses, e.g., the `strcasecmp' module, which exports `strcasecmp ()' (assuming the module is actually compiled). Suppose, for instance, that an application using said library is also linked against `strcase

Re: getline() behaviour change

2007-08-22 Thread Bruno Haible
Hi Eric, > The patch includes a couple of bug fixes in getdelim.c: > > It is valid on entrance for *lineptr to be non-NULL but *n to be 0 (ie. > via malloc(0)), but your implementation was leaking that memory. Also, > your implementation failed to set errno to EOVERFLOW when it detects that > it

Updated user list

2007-08-22 Thread Ludovic Courtès
Hi, The attached patch adds Guile (1.9.x) to the user list. Thanks, Ludovic. diff --git a/ChangeLog b/ChangeLog index d780a41..54fa517 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-08-22 Ludovic Courtès <[EMAIL PROTECTED]> + + * users.txt: Added Guile. + 2007-08-22 Eric Blake

Re: getline() behaviour change

2007-08-22 Thread Jim Meyering
Hi Bruno, Thanks for all the reviews. I haven't had time to look at the rest, but the following stood out: Bruno Haible <[EMAIL PROTECTED]> wrote: > The POSIX spec implies that errno should be set when getdelim fails. Therefore > errno needs to be set not only here, with EOVERFLOW. In lines 77 an

Re: Updated user list

2007-08-22 Thread Bruno Haible
Ludovic Courtès wrote: > The attached patch adds Guile (1.9.x) to the user list. Thanks, applied. You're welcome! Bruno

Re: Multiply exported Gnulib symbols

2007-08-22 Thread Bruno Haible
Ludovic Courtès wrote: > Suppose some library uses, e.g., the `strcasecmp' module, which exports > `strcasecmp ()' (assuming the module is actually compiled). Suppose, > for instance, that an application using said library is also linked > against `strcasecmp'. Then we may have troubles (dependin

Re: getline() behaviour change

2007-08-22 Thread Bruno Haible
Jim Meyering wrote: > Are you advocating support for non-POSIX malloc/realloc? Sure. gnulib supports - to a large extent - mingw. It uses a malloc implementation from msvcrt.dll. This malloc does not set errno. > A *lot* of code expects malloc and realloc to set errno when they fail. Such code i

Re: getline() behaviour change

2007-08-22 Thread Ben Pfaff
Bruno Haible <[EMAIL PROTECTED]> writes: > Jim Meyering wrote: >> A *lot* of code expects malloc and realloc to set errno when they fail. > > Such code is not portable to plain ISO C 99 systems. We could extend gnulib's existing malloc/realloc wrappers to ensure that malloc/realloc set errno when

Re: getline.h

2007-08-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 8/22/2007 3:02 PM: > Hi Eric, > > Thanks for working on this, and for the unit tests. The patch - excluding > the one of getdelim.c - is nearly perfect. But I see three problems: Thanks for catching the nits. Please feel

Re: getline() behaviour change

2007-08-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 8/22/2007 3:25 PM: >> >> - if (*lineptr == NULL || *n == 0) >> + if (*n == 0) > > This is a behaviour change: Previously when *lineptr == NULL, *n did not > need to be initialized. Now it needs to be initialized to 0.

Re: getline() behaviour change

2007-08-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Ben Pfaff on 8/22/2007 5:19 PM: > Bruno Haible <[EMAIL PROTECTED]> writes: > >> Jim Meyering wrote: >>> A *lot* of code expects malloc and realloc to set errno when they fail. >> Such code is not portable to plain ISO C 99 systems. > > W

Re: getline.h

2007-08-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 8/22/2007 6:04 PM: > According to Bruno Haible on 8/22/2007 3:02 PM: >> Hi Eric, > >> Thanks for working on this, and for the unit tests. The patch - excluding >> the one of getdelim.c - is nearly perfect. But I see three pr

Re: yesno module and i18n

2007-08-22 Thread Paul Eggert
Eric Blake <[EMAIL PROTECTED]> writes: > I agree with Paul - a POSIX conforming mv uses only yesexpr to > decide on affirmative responses. Yes, I'm afraid I don't see any other way to read the intent of POSIX. The definition of "affirmative response" confirms this reading; see

do not set errno after failing malloc [Re: getline() behaviour change

2007-08-22 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Jim Meyering wrote: >> Are you advocating support for non-POSIX malloc/realloc? > > Sure. gnulib supports - to a large extent - mingw. It uses a malloc > implementation from msvcrt.dll. This malloc does not set errno. You're dumbing down gnulib to accommod

Re: getline() behaviour change

2007-08-22 Thread Jim Meyering
Ben Pfaff <[EMAIL PROTECTED]> wrote: > Bruno Haible <[EMAIL PROTECTED]> writes: > >> Jim Meyering wrote: >>> A *lot* of code expects malloc and realloc to set errno when they fail. >> >> Such code is not portable to plain ISO C 99 systems. > > We could extend gnulib's existing malloc/realloc wrapp