From feb3c934355a9a2331cdfeb7ab6351fd4856164f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 9 Dec 1996 03:15:25 +0000 Subject: update from main archive 961208 Mon Dec 9 03:39:30 1996 Ulrich Drepper * config.make.in (defines): Add @USE_NEW_MALLOC@. * Makefile.in: Define USE_NEW_MALLOC to -DUSE_NEW_MALLOC if we use the new malloc. * malloc.h: Use either or depending on USE_NEW_MALLOC. Fix some more POSIX.1 problems. * libio/fileops.c (_IO_file_underflow): Set errno to EBADF if used on a write-only stream. (_IO_file_overflow): Set errno to EBADF if used on a read-only stream. (_IO_file_seekoff): POSIX.1 requires that fseek() after an fflush() call really positions the file offset to the correct position and no read-ahead happens. * locale/C-monetary.c: Set mon_grouping file to "" and "\377" to pass POSIX test suite. * stdio-common/vfprintf.c: Handle empty string as grouping command correctly. * stdlib/grouping.h: Likewise. * misc/syslog.c: Case first argument of __libc_cleanup_region_start. * signal/sigsetops.h: Update copyright. Don't include ansidecl.h. * stdio-common/printf_fp.c: Update copyright. Sun Dec 8 16:39:28 1996 Andreas Jaeger * time/Makefile: Compile ap.c with NO_MCHECK flag if new-malloc used (not otherwise). * misc/syslog.c (vsyslog): Cast argument to __libc_cleanup_region to get Hurd macros right. --- stdlib/grouping.h | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'stdlib') diff --git a/stdlib/grouping.h b/stdlib/grouping.h index f533689..3aa4aaf 100644 --- a/stdlib/grouping.h +++ b/stdlib/grouping.h @@ -1,21 +1,21 @@ /* Internal header for proving correct grouping in strings of numbers. -Copyright (C) 1995, 1996 Free Software Foundation, Inc. -Contributed by Ulrich Drepper , 1995. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Contributed by Ulrich Drepper , 1995. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include @@ -35,6 +35,15 @@ correctly_grouped_prefix (const STRING_TYPE *begin, const STRING_TYPE *end, if (grouping == NULL) return end; + if (*grouping == '\0') + { + /* No grouping allowed. Accept all characters up to the first + thousands separator. */ + while (begin < end && *begin != thousands) + ++begin; + return begin; + } + while (end > begin) { const STRING_TYPE *cp = end - 1; -- cgit v1.1