intl patches (8)

Bruno Haible haible@ilog.fr
Mon Mar 19 11:04:00 GMT 2001


libintl.{a,so} must remain self-contained, even on platforms without 'strtoul'.

This patch has no effect inside glibc.


2001-01-05  Bruno Haible  <haible@clisp.cons.org>

	* intl/loadmsgcat.c (_nl_load_domain): Add fallback code for platforms
	lacking strtoul, like SunOS4.

diff -r -c3 intl/loadmsgcat.c intl-98/loadmsgcat.c
*** intl/loadmsgcat.c	Mon Jan 29 18:29:03 2001
--- intl/loadmsgcat.c	Sat Mar 17 14:52:33 2001
***************
*** 381,392 ****
  	{
  	  /* First get the number.  */
  	  char *endp;
  	  struct parse_args args;
  
  	  nplurals += 9;
  	  while (*nplurals != '\0' && isspace (*nplurals))
  	    ++nplurals;
! 	  domain->nplurals = strtoul (nplurals, &endp, 10);
  	  if (nplurals == endp)
  	    goto no_plural;
  
--- 443,461 ----
  	{
  	  /* First get the number.  */
  	  char *endp;
+ 	  unsigned long int n;
  	  struct parse_args args;
  
  	  nplurals += 9;
  	  while (*nplurals != '\0' && isspace (*nplurals))
  	    ++nplurals;
! #if defined HAVE_STRTOUL || defined _LIBC
! 	  n = strtoul (nplurals, &endp, 10);
! #else
! 	  for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
! 	    n = n * 10 + (*endp - '0');
! #endif
! 	  domain->nplurals = n;
  	  if (nplurals == endp)
  	    goto no_plural;
  



More information about the Libc-alpha mailing list