fix_grouping.c (92986) | fix_grouping.c (116875) |
---|---|
1/* 2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/lib/libc/locale/fix_grouping.c 92986 2002-03-22 21:53:29Z obrien $"); | 28__FBSDID("$FreeBSD: head/lib/libc/locale/fix_grouping.c 116875 2003-06-26 10:46:16Z phantom $"); |
29 30#include <ctype.h> 31#include <limits.h> 32#include <stddef.h> 33 34static const char nogrouping[] = { CHAR_MAX, '\0' }; 35 36/* | 29 30#include <ctype.h> 31#include <limits.h> 32#include <stddef.h> 33 34static const char nogrouping[] = { CHAR_MAX, '\0' }; 35 36/* |
37 * "3;3;-1" -> "\003\003\177" | 37 * Internal helper used to convert grouping sequences from string 38 * representation into POSIX specified form, i.e. 39 * 40 * "3;3;-1" -> "\003\003\177\000" |
38 */ 39 40const char * | 41 */ 42 43const char * |
41__fix_locale_grouping_str(const char *str) { 42 | 44__fix_locale_grouping_str(const char *str) 45{ |
43 char *src, *dst; 44 char n; 45 46 if (str == NULL || *str == '\0') { 47 return nogrouping; 48 } 49 50 for (src = (char*)str, dst = (char*)str; *src != '\0'; src++) { --- 33 unchanged lines hidden --- | 46 char *src, *dst; 47 char n; 48 49 if (str == NULL || *str == '\0') { 50 return nogrouping; 51 } 52 53 for (src = (char*)str, dst = (char*)str; *src != '\0'; src++) { --- 33 unchanged lines hidden --- |