CVS commit: src/lib/libc/citrus/modules

2018-06-11 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Jun 11 20:28:23 UTC 2018

Modified Files:
src/lib/libc/citrus/modules: citrus_mapper_std.c

Log Message:
Avoid left-shifting a negative number in the non-compat case, too.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/citrus/modules/citrus_mapper_std.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_mapper_std.c
diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.11 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.12
--- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.11	Mon Jun 11 18:03:38 2018
+++ src/lib/libc/citrus/modules/citrus_mapper_std.c	Mon Jun 11 20:28:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $	*/
+/*	$NetBSD: citrus_mapper_std.c,v 1.12 2018/06/11 20:28:23 maya Exp $	*/
 
 /*-
  * Copyright (c)2003, 2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $");
+__RCSID("$NetBSD: citrus_mapper_std.c,v 1.12 2018/06/11 20:28:23 maya Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -216,7 +216,7 @@ rowcol_parse_variable(struct _citrus_map
 	rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits);
 
 	m = be32toh(rcx->rcx_src_rowcol_bits);
-	n = 1 << (m - 1);
+	n = 1U << (m - 1);
 	n |= n - 1;
 	rc->rc_src_rowcol_bits = m;
 	rc->rc_src_rowcol_mask = n;



CVS commit: src/lib/libc/citrus/modules

2018-06-11 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jun 11 18:03:38 UTC 2018

Modified Files:
src/lib/libc/citrus/modules: citrus_mapper_std.c

Log Message:
Correct Undefined Behavior in libc/citrus

Unportable left shift reported with MKSANITIZER=yes USE_SANITIZER=undefined:

# nm /usr/lib/libc.so|grep sanit
/public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8: runtime 
error: left shift of 1 by 31 places cannot be represented in type 'int'

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/modules/citrus_mapper_std.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_mapper_std.c
diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.11
--- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10	Sat Nov 19 18:48:39 2011
+++ src/lib/libc/citrus/modules/citrus_mapper_std.c	Mon Jun 11 18:03:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $	*/
+/*	$NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $	*/
 
 /*-
  * Copyright (c)2003, 2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -170,7 +170,7 @@ rowcol_parse_variable_compat(struct _cit
 	rc->rc_dst_invalid = be32toh(rcx->rcx_dst_invalid);
 	rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits);
 	m = be32toh(rcx->rcx_src_col_bits);
-	n = 1 << (m - 1);
+	n = 1U << (m - 1);
 	n |= n - 1;
 	rc->rc_src_rowcol_bits = m;
 	rc->rc_src_rowcol_mask = n;



CVS commit: src/lib/libc/citrus

2018-01-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jan  5 17:52:06 UTC 2018

Modified Files:
src/lib/libc/citrus: citrus_lc_ctype.c

Log Message:
Include namespace.h in citrus/citrus_lc_ctype.c

The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global name of the following symbol:
  - strlcpy -> _strlcpy

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/citrus/citrus_lc_ctype.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_lc_ctype.c
diff -u src/lib/libc/citrus/citrus_lc_ctype.c:1.15 src/lib/libc/citrus/citrus_lc_ctype.c:1.16
--- src/lib/libc/citrus/citrus_lc_ctype.c:1.15	Fri Sep 13 13:13:32 2013
+++ src/lib/libc/citrus/citrus_lc_ctype.c	Fri Jan  5 17:52:06 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_ctype.c,v 1.15 2013/09/13 13:13:32 joerg Exp $ */
+/* $NetBSD: citrus_lc_ctype.c,v 1.16 2018/01/05 17:52:06 kamil Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,9 +28,10 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.15 2013/09/13 13:13:32 joerg Exp $");
+__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.16 2018/01/05 17:52:06 kamil Exp $");
 #endif /* LIBC_SCCS and not lint */
 
+#include "namespace.h"
 #include "reentrant.h"
 #include 
 #include 



CVS commit: src/lib/libc/citrus

2017-07-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jul 13 16:00:30 UTC 2017

Modified Files:
src/lib/libc/citrus: citrus_none.c

Log Message:
s == NULL is illegal.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/citrus/citrus_none.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_none.c
diff -u src/lib/libc/citrus/citrus_none.c:1.21 src/lib/libc/citrus/citrus_none.c:1.22
--- src/lib/libc/citrus/citrus_none.c:1.21	Thu Jul 13 11:46:26 2017
+++ src/lib/libc/citrus/citrus_none.c	Thu Jul 13 12:00:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_none.c,v 1.21 2017/07/13 15:46:26 joerg Exp $	*/
+/*	$NetBSD: citrus_none.c,v 1.22 2017/07/13 16:00:30 christos Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_none.c,v 1.21 2017/07/13 15:46:26 joerg Exp $");
+__RCSID("$NetBSD: citrus_none.c,v 1.22 2017/07/13 16:00:30 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -513,7 +513,10 @@ _citrus_NONE_stdenc_mbtowc(struct _citru
 			   void * __restrict pspriv,
 			   size_t * __restrict nresult)
 {
-	if (s == NULL || *s == NULL) {
+
+	_DIAGASSERT(s != NULL);
+
+	if (*s == NULL) {
 		*nresult = 0;
 		return (0);
 	}



CVS commit: src/lib/libc/citrus

2017-07-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jul 13 15:46:26 UTC 2017

Modified Files:
src/lib/libc/citrus: citrus_none.c

Log Message:
Redo previous: catch NULL pointer earlier, check for empty string
latter.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/citrus/citrus_none.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_none.c
diff -u src/lib/libc/citrus/citrus_none.c:1.20 src/lib/libc/citrus/citrus_none.c:1.21
--- src/lib/libc/citrus/citrus_none.c:1.20	Thu Jul 13 15:44:45 2017
+++ src/lib/libc/citrus/citrus_none.c	Thu Jul 13 15:46:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_none.c,v 1.20 2017/07/13 15:44:45 joerg Exp $	*/
+/*	$NetBSD: citrus_none.c,v 1.21 2017/07/13 15:46:26 joerg Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_none.c,v 1.20 2017/07/13 15:44:45 joerg Exp $");
+__RCSID("$NetBSD: citrus_none.c,v 1.21 2017/07/13 15:46:26 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -513,7 +513,7 @@ _citrus_NONE_stdenc_mbtowc(struct _citru
 			   void * __restrict pspriv,
 			   size_t * __restrict nresult)
 {
-	if (s == NULL) {
+	if (s == NULL || *s == NULL) {
 		*nresult = 0;
 		return (0);
 	}
@@ -525,7 +525,7 @@ _citrus_NONE_stdenc_mbtowc(struct _citru
 	if (pwc != NULL)
 		*pwc = (_wc_t)(unsigned char) **s;
 
-	*nresult = *s == NULL ? 0 : 1;
+	*nresult = **s == '\0' ? 0 : 1;
 	return (0);
 }
 



CVS commit: src/lib/libc/citrus

2017-07-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jul 13 15:44:46 UTC 2017

Modified Files:
src/lib/libc/citrus: citrus_none.c

Log Message:
Spell NULL correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/citrus/citrus_none.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_none.c
diff -u src/lib/libc/citrus/citrus_none.c:1.19 src/lib/libc/citrus/citrus_none.c:1.20
--- src/lib/libc/citrus/citrus_none.c:1.19	Tue May 28 16:57:56 2013
+++ src/lib/libc/citrus/citrus_none.c	Thu Jul 13 15:44:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_none.c,v 1.19 2013/05/28 16:57:56 joerg Exp $	*/
+/*	$NetBSD: citrus_none.c,v 1.20 2017/07/13 15:44:45 joerg Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_none.c,v 1.19 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_none.c,v 1.20 2017/07/13 15:44:45 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -525,7 +525,7 @@ _citrus_NONE_stdenc_mbtowc(struct _citru
 	if (pwc != NULL)
 		*pwc = (_wc_t)(unsigned char) **s;
 
-	*nresult = *s == '\0' ? 0 : 1;
+	*nresult = *s == NULL ? 0 : 1;
 	return (0);
 }
 



CVS commit: src/lib/libc/citrus

2017-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 10 16:51:30 UTC 2017

Modified Files:
src/lib/libc/citrus: citrus_mmap.c

Log Message:
need 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_mmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_mmap.c
diff -u src/lib/libc/citrus/citrus_mmap.c:1.4 src/lib/libc/citrus/citrus_mmap.c:1.5
--- src/lib/libc/citrus/citrus_mmap.c:1.4	Sat Oct 15 19:00:01 2011
+++ src/lib/libc/citrus/citrus_mmap.c	Tue Jan 10 11:51:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mmap.c,v 1.4 2011/10/15 23:00:01 christos Exp $	*/
+/*	$NetBSD: citrus_mmap.c,v 1.5 2017/01/10 16:51:30 christos Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,10 +28,14 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mmap.c,v 1.4 2011/10/15 23:00:01 christos Exp $");
+__RCSID("$NetBSD: citrus_mmap.c,v 1.5 2017/01/10 16:51:30 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
+
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -40,7 +44,6 @@ __RCSID("$NetBSD: citrus_mmap.c,v 1.4 20
 #include 
 #include 
 #include 
-#include 
 
 #include "citrus_namespace.h"
 #include "citrus_region.h"



CVS commit: src/lib/libc/citrus/modules

2016-05-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 31 03:34:14 UTC 2016

Modified Files:
src/lib/libc/citrus/modules: citrus_johab.c

Log Message:
PR 51000 David Binderman: comment out unused assignment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/modules/citrus_johab.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_johab.c
diff -u src/lib/libc/citrus/modules/citrus_johab.c:1.5 src/lib/libc/citrus/modules/citrus_johab.c:1.6
--- src/lib/libc/citrus/modules/citrus_johab.c:1.5	Tue May 28 16:57:56 2013
+++ src/lib/libc/citrus/modules/citrus_johab.c	Tue May 31 03:34:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_johab.c,v 1.5 2013/05/28 16:57:56 joerg Exp $ */
+/* $NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -27,7 +27,7 @@
  */
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_johab.c,v 1.5 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -349,7 +349,7 @@ _citrus_JOHAB_stdenc_cstowc(_JOHABEncodi
 		l = ((idx >> 8) & 0xFF) - n;
 		t = (idx & 0xFF) - 0x21;
 		linear = (l * 94) + t;
-		l = (linear / 188) + m;
+		/*l = (linear / 188) + m;*/
 		t = linear % 188;
 		t += (t <= 0x4D) ? 0x31 : 0x43;
 		break;



CVS commit: src/lib/libc/citrus

2014-06-24 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Tue Jun 24 22:24:18 UTC 2014

Modified Files:
src/lib/libc/citrus: citrus_prop.c citrus_prop.h
src/lib/libc/citrus/modules: citrus_big5.c citrus_hz.c

Log Message:
Fix our iconv version for the issues that apply to us from CVE-2014-3951
(which are the:
- Consistently pass around context information using a simple pointer.
  This fixes some dereferencing bugs in Chinese character set conversions.
- Fix Simplified Chinese character set conversions by switching around the
  fields of an internal struct so it corresponds with the way variables of
  this type are initialised.
part)
Patch taken from FreeBSD and mutilated to fit.
FreeBSD credits: Manuel Mausz (reporter), Tijl Coosemans (report handler)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_prop.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_prop.h
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/citrus/modules/citrus_big5.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/modules/citrus_hz.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_prop.c
diff -u src/lib/libc/citrus/citrus_prop.c:1.4 src/lib/libc/citrus/citrus_prop.c:1.5
--- src/lib/libc/citrus/citrus_prop.c:1.4	Wed Mar 30 08:22:01 2011
+++ src/lib/libc/citrus/citrus_prop.c	Tue Jun 24 22:24:18 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */
+/* $NetBSD: citrus_prop.c,v 1.5 2014/06/24 22:24:18 spz Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -29,7 +29,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $");
+__RCSID("$NetBSD: citrus_prop.c,v 1.5 2014/06/24 22:24:18 spz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -350,7 +350,7 @@ name_found:
 static int
 _citrus_prop_parse_element(struct _memstream * __restrict ms,
 	const _citrus_prop_hint_t * __restrict hints,
-	void ** __restrict context)
+	void * __restrict context)
 {
 	int ch, errnum;
 #define _CITRUS_PROP_HINT_NAME_LEN_MAX	255
@@ -459,8 +459,7 @@ _citrus_prop_parse_variable(const _citru
 		if (ch == EOF || ch == '\0')
 			break;
 		_memstream_ungetc(&ms, ch);
-		errnum = _citrus_prop_parse_element(
-		&ms, hints, (void **)&context);
+		errnum = _citrus_prop_parse_element(&ms, hints, context);
 		if (errnum != 0)
 			return errnum;
 	}

Index: src/lib/libc/citrus/citrus_prop.h
diff -u src/lib/libc/citrus/citrus_prop.h:1.5 src/lib/libc/citrus/citrus_prop.h:1.6
--- src/lib/libc/citrus/citrus_prop.h:1.5	Mon May 23 14:52:32 2011
+++ src/lib/libc/citrus/citrus_prop.h	Tue Jun 24 22:24:18 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.h,v 1.5 2011/05/23 14:52:32 joerg Exp $ */
+/* $NetBSD: citrus_prop.h,v 1.6 2014/06/24 22:24:18 spz Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -41,7 +41,7 @@ typedef struct _citrus_prop_hint_t _citr
 
 #define _CITRUS_PROP_CB0_T(_func_, _type_) \
 typedef int (*_citrus_prop_##_func_##_cb_func_t) \
-	(void ** __restrict, const char *, _type_); \
+	(void * __restrict, const char *, _type_); \
 typedef struct { \
 	_citrus_prop_##_func_##_cb_func_t func; \
 } _citrus_prop_##_func_##_cb_t;
@@ -51,7 +51,7 @@ _CITRUS_PROP_CB0_T(str, const char *)
 
 #define _CITRUS_PROP_CB1_T(_func_, _type_) \
 typedef int (*_citrus_prop_##_func_##_cb_func_t) \
-	(void ** __restrict, const char *, _type_, _type_); \
+	(void * __restrict, const char *, _type_, _type_); \
 typedef struct { \
 	_citrus_prop_##_func_##_cb_func_t func; \
 } _citrus_prop_##_func_##_cb_t;

Index: src/lib/libc/citrus/modules/citrus_big5.c
diff -u src/lib/libc/citrus/modules/citrus_big5.c:1.14 src/lib/libc/citrus/modules/citrus_big5.c:1.15
--- src/lib/libc/citrus/modules/citrus_big5.c:1.14	Tue May 28 16:57:56 2013
+++ src/lib/libc/citrus/modules/citrus_big5.c	Tue Jun 24 22:24:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_big5.c,v 1.14 2013/05/28 16:57:56 joerg Exp $	*/
+/*	$NetBSD: citrus_big5.c,v 1.15 2014/06/24 22:24:18 spz Exp $	*/
 
 /*-
  * Copyright (c)2002, 2006 Citrus Project,
@@ -60,7 +60,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_big5.c,v 1.14 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_big5.c,v 1.15 2014/06/24 22:24:18 spz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -192,18 +192,18 @@ _citrus_BIG5_check_excludes(_BIG5Encodin
 }
 
 static int
-_citrus_BIG5_fill_rowcol(void ** __restrict ctx, const char * __restrict s,
+_citrus_BIG5_fill_rowcol(void * __restrict ctx, const char * __restrict s,
 	uint64_t start, uint64_t end)
 {
 	_BIG5EncodingInfo *ei;
 	int i;
 	uint64_t n;
 
-	_DIAGASSERT(ctx != NULL && *ctx != NULL);
+	_DIAGASSERT(ctx != NULL);
 
 	if (start > 0xFF || end > 0xFF)
 		return EINVAL;
-	ei = (_BIG5EncodingInfo *)*ctx;
+	ei = (_BIG5EncodingInfo *)ctx;
 	i = strcmp("row", s) ? 1 : 0;
 	i

CVS commit: src/lib/libc/citrus/modules

2014-01-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 18 15:21:41 UTC 2014

Modified Files:
src/lib/libc/citrus/modules: citrus_euc.c

Log Message:
revert previous, it causes other problem and I cannot easily debug it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/citrus/modules/citrus_euc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_euc.c
diff -u src/lib/libc/citrus/modules/citrus_euc.c:1.16 src/lib/libc/citrus/modules/citrus_euc.c:1.17
--- src/lib/libc/citrus/modules/citrus_euc.c:1.16	Thu Jan 16 15:28:51 2014
+++ src/lib/libc/citrus/modules/citrus_euc.c	Sat Jan 18 10:21:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $	*/
+/*	$NetBSD: citrus_euc.c,v 1.17 2014/01/18 15:21:41 christos Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -60,7 +60,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $");
+__RCSID("$NetBSD: citrus_euc.c,v 1.17 2014/01/18 15:21:41 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -273,8 +273,7 @@ _citrus_EUC_mbrtowc_priv(_EUCEncodingInf
 	wchar = 0;
 	while (len-- > 0)
 		wchar = (wchar << 8) | (*s1++ & 0xff);
-	if (wchar != (wchar & ~ei->mask) | ei->bits[cs])
-		goto encoding_error;
+	wchar = (wchar & ~ei->mask) | ei->bits[cs];
 
 	psenc->chlen = 0;
 	if (pwc)



CVS commit: src/lib/libc/citrus/modules

2014-01-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 16 20:28:51 UTC 2014

Modified Files:
src/lib/libc/citrus/modules: citrus_euc.c

Log Message:
PR/47602: Christos Zoulas: getwc() modifies input instead of returning EILSEQ.
Waited for almost a year for feedback and there was none.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/citrus/modules/citrus_euc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_euc.c
diff -u src/lib/libc/citrus/modules/citrus_euc.c:1.15 src/lib/libc/citrus/modules/citrus_euc.c:1.16
--- src/lib/libc/citrus/modules/citrus_euc.c:1.15	Tue May 28 12:57:56 2013
+++ src/lib/libc/citrus/modules/citrus_euc.c	Thu Jan 16 15:28:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_euc.c,v 1.15 2013/05/28 16:57:56 joerg Exp $	*/
+/*	$NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -60,7 +60,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_euc.c,v 1.15 2013/05/28 16:57:56 joerg Exp $");
+__RCSID("$NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -273,7 +273,8 @@ _citrus_EUC_mbrtowc_priv(_EUCEncodingInf
 	wchar = 0;
 	while (len-- > 0)
 		wchar = (wchar << 8) | (*s1++ & 0xff);
-	wchar = (wchar & ~ei->mask) | ei->bits[cs];
+	if (wchar != (wchar & ~ei->mask) | ei->bits[cs])
+		goto encoding_error;
 
 	psenc->chlen = 0;
 	if (pwc)



CVS commit: src/lib/libc/citrus

2013-09-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 19 21:19:13 UTC 2013

Modified Files:
src/lib/libc/citrus: citrus_module.c

Log Message:
look in the right place for the modules of compat binaries


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_module.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_module.c
diff -u src/lib/libc/citrus/citrus_module.c:1.10 src/lib/libc/citrus/citrus_module.c:1.11
--- src/lib/libc/citrus/citrus_module.c:1.10	Mon Oct 15 18:22:01 2012
+++ src/lib/libc/citrus/citrus_module.c	Thu Sep 19 17:19:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_module.c,v 1.10 2012/10/15 22:22:01 msaitoh Exp $	*/
+/*	$NetBSD: citrus_module.c,v 1.11 2013/09/19 21:19:13 christos Exp $	*/
 
 /*-
  * Copyright (c)1999, 2000, 2001, 2002 Citrus Project,
@@ -89,7 +89,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_module.c,v 1.10 2012/10/15 22:22:01 msaitoh Exp $");
+__RCSID("$NetBSD: citrus_module.c,v 1.11 2013/09/19 21:19:13 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -302,12 +302,24 @@ _citrus_load_module(_citrus_module_t *rh
 
 	if (_pathI18nModule == NULL) {
 		p = getenv("PATH_I18NMODULE");
-		if (p != NULL && !issetugid()) {
+		if (p == NULL || issetugid()) {
+			_pathI18nModule = _PATH_I18NMODULE;
+#ifdef MLIBDIR
+			p = strrchr(_pathI18nModule, '/');
+			if (p != NULL && MLIBDIR[0]) {
+snprintf(path, sizeof(path), "%.*s/%s/%s",
+(int)(p - _pathI18nModule),
+_pathI18nModule, MLIBDIR, p + 1);
+p = path;
+			} else
+p = NULL;
+#endif
+		}
+		if (p != NULL) {
 			_pathI18nModule = strdup(p);
 			if (_pathI18nModule == NULL)
 return ENOMEM;
-		} else
-			_pathI18nModule = _PATH_I18NMODULE;
+		}
 	}
 
 	(void)snprintf(path, sizeof(path), "lib%s", encname);



CVS commit: src/lib/libc/citrus

2013-09-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Sep 14 13:05:51 UTC 2013

Modified Files:
src/lib/libc/citrus: citrus_db_factory.c

Log Message:
GC put16.
XXX Use sys/endian.h


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/citrus_db_factory.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_db_factory.c
diff -u src/lib/libc/citrus/citrus_db_factory.c:1.9 src/lib/libc/citrus/citrus_db_factory.c:1.10
--- src/lib/libc/citrus/citrus_db_factory.c:1.9	Sat Feb  9 14:56:20 2008
+++ src/lib/libc/citrus/citrus_db_factory.c	Sat Sep 14 13:05:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_db_factory.c,v 1.9 2008/02/09 14:56:20 junyoung Exp $	*/
+/*	$NetBSD: citrus_db_factory.c,v 1.10 2013/09/14 13:05:51 joerg Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -32,7 +32,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_db_factory.c,v 1.9 2008/02/09 14:56:20 junyoung Exp $");
+__RCSID("$NetBSD: citrus_db_factory.c,v 1.10 2013/09/14 13:05:51 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -235,14 +235,6 @@ put8(struct _region *r, size_t *rofs, ui
 }
 
 static __inline void
-put16(struct _region *r, size_t *rofs, uint16_t val)
-{
-	val = htons(val);
-	memcpy(_region_offset(r, *rofs), &val, 2);
-	*rofs += 2;
-}
-
-static __inline void
 put32(struct _region *r, size_t *rofs, uint32_t val)
 {
 	val = htonl(val);



CVS commit: src/lib/libc/citrus

2013-06-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Jun 24 17:28:35 UTC 2013

Modified Files:
src/lib/libc/citrus: citrus_csmapper.h

Log Message:
Fix header guard, courtesy of clang.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/citrus_csmapper.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_csmapper.h
diff -u src/lib/libc/citrus/citrus_csmapper.h:1.2 src/lib/libc/citrus/citrus_csmapper.h:1.3
--- src/lib/libc/citrus/citrus_csmapper.h:1.2	Sat Feb  9 14:56:20 2008
+++ src/lib/libc/citrus/citrus_csmapper.h	Mon Jun 24 17:28:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_csmapper.h,v 1.2 2008/02/09 14:56:20 junyoung Exp $	*/
+/*	$NetBSD: citrus_csmapper.h,v 1.3 2013/06/24 17:28:35 joerg Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -27,7 +27,7 @@
  */
 
 #ifndef _CITRUS_CSMAPPER_H_
-#define _CITRUS_CSMAPPER_H
+#define _CITRUS_CSMAPPER_H_
 
 #define _citrus_csmapper		_citrus_mapper
 #define _citrus_csmapper_close		_citrus_mapper_close



CVS commit: src/lib/libc/citrus

2012-06-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  8 07:49:42 UTC 2012

Modified Files:
src/lib/libc/citrus: citrus_mapper.c

Log Message:
Henning Petersen in PR lib/46560: fix memory leak in error path


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/citrus_mapper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_mapper.c
diff -u src/lib/libc/citrus/citrus_mapper.c:1.9 src/lib/libc/citrus/citrus_mapper.c:1.10
--- src/lib/libc/citrus/citrus_mapper.c:1.9	Sat Nov 19 18:43:40 2011
+++ src/lib/libc/citrus/citrus_mapper.c	Fri Jun  8 07:49:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $	*/
+/*	$NetBSD: citrus_mapper.c,v 1.10 2012/06/08 07:49:42 martin Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_mapper.c,v 1.10 2012/06/08 07:49:42 martin Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -102,6 +102,7 @@ _citrus_mapper_create_area(
 	}
 	ma->ma_dir = strdup(area);
 	if (ma->ma_dir == NULL) {
+		free(ma);
 		ret = errno;
 		goto quit;
 	}



CVS commit: src/lib/libc/citrus

2012-05-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri May  4 16:45:05 UTC 2012

Modified Files:
src/lib/libc/citrus: citrus_lookup.c


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/citrus/citrus_lookup.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_lookup.c
diff -u src/lib/libc/citrus/citrus_lookup.c:1.6 src/lib/libc/citrus/citrus_lookup.c:1.7
--- src/lib/libc/citrus/citrus_lookup.c:1.6	Tue Feb  3 04:58:38 2009
+++ src/lib/libc/citrus/citrus_lookup.c	Fri May  4 16:45:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_lookup.c,v 1.6 2009/02/03 04:58:38 lukem Exp $	*/
+/*	$NetBSD: citrus_lookup.c,v 1.7 2012/05/04 16:45:05 joerg Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lookup.c,v 1.6 2009/02/03 04:58:38 lukem Exp $");
+__RCSID("$NetBSD: citrus_lookup.c,v 1.7 2012/05/04 16:45:05 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -276,7 +276,7 @@ _citrus_lookup_seq_open(struct _citrus_l
 
 	cl = malloc(sizeof(*cl));
 	if (cl == NULL)
-		return errno;
+		return ENOMEM;
 
 	cl->cl_key = NULL;
 	cl->cl_keylen = 0;



CVS commit: src/lib/libc/citrus/modules

2012-02-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Feb 12 13:51:29 UTC 2012

Modified Files:
src/lib/libc/citrus/modules: citrus_iconv_std.c citrus_ues.c
citrus_utf1632.c

Log Message:
Remove unused variables. From cppcheck via Henning Petersen in PR 45997.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/citrus/modules/citrus_iconv_std.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/modules/citrus_ues.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/citrus/modules/citrus_utf1632.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_iconv_std.c
diff -u src/lib/libc/citrus/modules/citrus_iconv_std.c:1.15 src/lib/libc/citrus/modules/citrus_iconv_std.c:1.16
--- src/lib/libc/citrus/modules/citrus_iconv_std.c:1.15	Mon Nov 13 19:08:19 2006
+++ src/lib/libc/citrus/modules/citrus_iconv_std.c	Sun Feb 12 13:51:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $	*/
+/*	$NetBSD: citrus_iconv_std.c,v 1.16 2012/02/12 13:51:29 wiz Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_iconv_std.c,v 1.16 2012/02/12 13:51:29 wiz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -418,7 +418,6 @@ _citrus_iconv_std_iconv_init_context(str
 {
 	const struct _citrus_iconv_std_shared *is = cv->cv_shared->ci_closure;
 	struct _citrus_iconv_std_context *sc;
-	int ret;
 	size_t szpssrc, szpsdst, sz;
 	char *ptr;
 

Index: src/lib/libc/citrus/modules/citrus_ues.c
diff -u src/lib/libc/citrus/modules/citrus_ues.c:1.2 src/lib/libc/citrus/modules/citrus_ues.c:1.3
--- src/lib/libc/citrus/modules/citrus_ues.c:1.2	Tue Dec  7 22:01:22 2010
+++ src/lib/libc/citrus/modules/citrus_ues.c	Sun Feb 12 13:51:29 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $ */
+/* $NetBSD: citrus_ues.c,v 1.3 2012/02/12 13:51:29 wiz Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $");
+__RCSID("$NetBSD: citrus_ues.c,v 1.3 2012/02/12 13:51:29 wiz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -212,7 +212,7 @@ _citrus_UES_mbrtowc_priv(_UESEncodingInf
 	_UESState * __restrict psenc, size_t * __restrict nresult)
 {
 	const char *s0;
-	int ch, head, tail, i, num;
+	int ch, head, tail, num;
 	wchar_t hi, wc;
 
 	_DIAGASSERT(ei != NULL);

Index: src/lib/libc/citrus/modules/citrus_utf1632.c
diff -u src/lib/libc/citrus/modules/citrus_utf1632.c:1.11 src/lib/libc/citrus/modules/citrus_utf1632.c:1.12
--- src/lib/libc/citrus/modules/citrus_utf1632.c:1.11	Sat Mar 20 18:15:32 2010
+++ src/lib/libc/citrus/modules/citrus_utf1632.c	Sun Feb 12 13:51:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $	*/
+/*	$NetBSD: citrus_utf1632.c,v 1.12 2012/02/12 13:51:29 wiz Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_utf1632.c,v 1.12 2012/02/12 13:51:29 wiz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -250,7 +250,6 @@ _citrus_UTF1632_wcrtomb_priv(_UTF1632Enc
 			 wchar_t wc, _UTF1632State *psenc,
 			 size_t *nresult)
 {
-	int ret;
 	wchar_t wc2;
 	static const char _bom[4] = {
 #if BYTE_ORDER == BIG_ENDIAN



CVS commit: src/lib/libc/citrus

2011-11-19 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sun Nov 20 07:43:53 UTC 2011

Modified Files:
src/lib/libc/citrus: citrus_csmapper.c

Log Message:
add comment about r1.6 -> r1.7 change.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_csmapper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_csmapper.c
diff -u src/lib/libc/citrus/citrus_csmapper.c:1.10 src/lib/libc/citrus/citrus_csmapper.c:1.11
--- src/lib/libc/citrus/citrus_csmapper.c:1.10	Sun Jan 11 02:46:24 2009
+++ src/lib/libc/citrus/citrus_csmapper.c	Sun Nov 20 07:43:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_csmapper.c,v 1.10 2009/01/11 02:46:24 christos Exp $	*/
+/*	$NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_csmapper.c,v 1.10 2009/01/11 02:46:24 christos Exp $");
+__RCSID("$NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -142,6 +142,7 @@ find_best_pivot_pvdb(const char *src, co
 		if (ret)
 			goto quit3;
 		if (_db_lookup_by_s(db3, dst, &r2, NULL) != 0)
+			/* don't break the loop, test all src/dst pairs. */
 			goto quit4;
 		/* r2: norm among pivot and dst */
 		ret = get32(&r2, &val32);



CVS commit: src/lib/libc/citrus

2011-11-19 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sat Nov 19 18:39:58 UTC 2011

Modified Files:
src/lib/libc/citrus: citrus_mapper.c citrus_stdenc.c

Log Message:
return EINVAL when module validation failed, pointed by nonaka-san(again).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/citrus_mapper.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_stdenc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_mapper.c
diff -u src/lib/libc/citrus/citrus_mapper.c:1.7 src/lib/libc/citrus/citrus_mapper.c:1.8
--- src/lib/libc/citrus/citrus_mapper.c:1.7	Fri Jul 25 14:05:25 2008
+++ src/lib/libc/citrus/citrus_mapper.c	Sat Nov 19 18:39:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $	*/
+/*	$NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $");
+__RCSID("$NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -251,8 +251,10 @@ mapper_open(struct _citrus_mapper_area *
 	if (!cm->cm_ops->mo_init ||
 	!cm->cm_ops->mo_uninit ||
 	!cm->cm_ops->mo_convert ||
-	!cm->cm_ops->mo_init_state)
+	!cm->cm_ops->mo_init_state) {
+		ret = EINVAL;
 		goto err;
+	}
 
 	/* allocate traits structure */
 	cm->cm_traits = malloc(sizeof(*cm->cm_traits));

Index: src/lib/libc/citrus/citrus_stdenc.c
diff -u src/lib/libc/citrus/citrus_stdenc.c:1.3 src/lib/libc/citrus/citrus_stdenc.c:1.4
--- src/lib/libc/citrus/citrus_stdenc.c:1.3	Sat Oct 29 18:02:04 2005
+++ src/lib/libc/citrus/citrus_stdenc.c	Sat Nov 19 18:39:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $	*/
+/*	$NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $");
+__RCSID("$NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -128,8 +128,10 @@ _citrus_stdenc_open(struct _citrus_stden
 	ce->ce_ops->eo_cstomb == NULL ||
 	ce->ce_ops->eo_mbtowc == NULL ||
 	ce->ce_ops->eo_wctomb == NULL ||
-	ce->ce_ops->eo_get_state_desc == NULL)
+	ce->ce_ops->eo_get_state_desc == NULL) {
+		ret = EINVAL;
 		goto bad;
+	}
 
 	/* allocate traits */
 	ce->ce_traits = malloc(sizeof(*ce->ce_traits));



CVS commit: src/lib/libc/citrus/modules

2011-11-19 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sat Nov 19 18:48:39 UTC 2011

Modified Files:
src/lib/libc/citrus/modules: citrus_mapper_std.c

Log Message:
fix memory leak, pointed by nonaka-san(again^3).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_mapper_std.c
diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10
--- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9	Sun Oct 30 21:48:27 2011
+++ src/lib/libc/citrus/modules/citrus_mapper_std.c	Sat Nov 19 18:48:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $	*/
+/*	$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003, 2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $");
+__RCSID("$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -185,8 +185,11 @@ rowcol_parse_variable_compat(struct _cit
 	n = be32toh(rcx->rcx_src_row_end);
 	if (m + n > 0) {
 		ret = set_linear_zone(lz, m, n);
-		if (ret != 0)
+		if (ret != 0) {
+			free(rc->rc_src_rowcol);
+			rc->rc_src_rowcol = NULL;
 			return ret;
+		}
 		++rc->rc_src_rowcol_len, ++lz;
 	}
 	m = be32toh(rcx->rcx_src_col_begin);



CVS commit: src/lib/libc/citrus

2011-11-19 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sat Nov 19 18:43:40 UTC 2011

Modified Files:
src/lib/libc/citrus: citrus_mapper.c

Log Message:
remove useless free(), pointed by nonaka-san(again^2).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/citrus_mapper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_mapper.c
diff -u src/lib/libc/citrus/citrus_mapper.c:1.8 src/lib/libc/citrus/citrus_mapper.c:1.9
--- src/lib/libc/citrus/citrus_mapper.c:1.8	Sat Nov 19 18:39:58 2011
+++ src/lib/libc/citrus/citrus_mapper.c	Sat Nov 19 18:43:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $	*/
+/*	$NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -103,7 +103,6 @@ _citrus_mapper_create_area(
 	ma->ma_dir = strdup(area);
 	if (ma->ma_dir == NULL) {
 		ret = errno;
-		free(ma->ma_dir);
 		goto quit;
 	}
 	_CITRUS_HASH_INIT(&ma->ma_cache, CM_HASH_SIZE);



CVS commit: src/lib/libc/citrus

2011-11-19 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sat Nov 19 18:34:22 UTC 2011

Modified Files:
src/lib/libc/citrus: citrus_ctype.c citrus_iconv.c

Log Message:
return EINVAL when module validation failed, pointed by nonaka-san(again).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_ctype.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/citrus_iconv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_ctype.c
diff -u src/lib/libc/citrus/citrus_ctype.c:1.5 src/lib/libc/citrus/citrus_ctype.c:1.6
--- src/lib/libc/citrus/citrus_ctype.c:1.5	Sat Jun 14 16:01:07 2008
+++ src/lib/libc/citrus/citrus_ctype.c	Sat Nov 19 18:34:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $	*/
+/*	$NetBSD: citrus_ctype.c,v 1.6 2011/11/19 18:34:21 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)1999, 2000, 2001, 2002 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_ctype.c,v 1.6 2011/11/19 18:34:21 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -113,8 +113,10 @@ _initctypemodule(_citrus_ctype_t cc, cha
 	cc->cc_ops->co_wcstombs == NULL ||
 	cc->cc_ops->co_wctomb == NULL ||
 	cc->cc_ops->co_btowc == NULL ||
-	cc->cc_ops->co_wctob == NULL)
+	cc->cc_ops->co_wctob == NULL) {
+		ret = EINVAL;
 		goto bad;
+	}
 
 	/* init and get closure */
 	ret = (*cc->cc_ops->co_init)(

Index: src/lib/libc/citrus/citrus_iconv.c
diff -u src/lib/libc/citrus/citrus_iconv.c:1.9 src/lib/libc/citrus/citrus_iconv.c:1.10
--- src/lib/libc/citrus/citrus_iconv.c:1.9	Wed Mar 30 08:22:01 2011
+++ src/lib/libc/citrus/citrus_iconv.c	Sat Nov 19 18:34:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $	*/
+/*	$NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $");
+__RCSID("$NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -222,8 +222,10 @@ open_shared(struct _citrus_iconv_shared 
 	ci->ci_ops->io_uninit_shared == NULL ||
 	ci->ci_ops->io_init_context == NULL ||
 	ci->ci_ops->io_uninit_context == NULL ||
-	ci->ci_ops->io_convert == NULL)
+	ci->ci_ops->io_convert == NULL) {
+		ret = EINVAL;
 		goto err;
+	}
 
 	/* initialize the converter */
 	ret = (*ci->ci_ops->io_init_shared)(ci, basedir, src, dst,



CVS commit: src/lib/libc/citrus/modules

2011-11-19 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sat Nov 19 18:20:13 UTC 2011

Modified Files:
src/lib/libc/citrus/modules: citrus_dechanyu.c citrus_viqr.c

Log Message:
remove unused variable, pointed by nonaka-san, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/modules/citrus_dechanyu.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/modules/citrus_viqr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_dechanyu.c
diff -u src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3 src/lib/libc/citrus/modules/citrus_dechanyu.c:1.4
--- src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3	Sat Jun 14 16:01:07 2008
+++ src/lib/libc/citrus/modules/citrus_dechanyu.c	Sat Nov 19 18:20:13 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $ */
+/* $NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2007 Citrus Project,
@@ -27,7 +27,7 @@
  */
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -187,7 +187,7 @@ _citrus_DECHanyu_mbrtowc_priv(_DECHanyuE
 	_DECHanyuState * __restrict psenc, size_t * __restrict nresult)
 {
 	const char *s0;
-	int ch, i;
+	int ch;
 	wchar_t wc;
 
 	/* ei may be unused */

Index: src/lib/libc/citrus/modules/citrus_viqr.c
diff -u src/lib/libc/citrus/modules/citrus_viqr.c:1.4 src/lib/libc/citrus/modules/citrus_viqr.c:1.5
--- src/lib/libc/citrus/modules/citrus_viqr.c:1.4	Sat Jun 14 16:01:08 2008
+++ src/lib/libc/citrus/modules/citrus_viqr.c	Sat Nov 19 18:20:13 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $ */
+/* $NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -29,7 +29,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -360,7 +360,7 @@ _citrus_VIQR_wcrtomb_priv(_VIQREncodingI
 	_VIQRState * __restrict psenc, size_t * __restrict nresult)
 {
 	mnemonic_t *m;
-	int ch, escape;
+	int ch;
 	const char *p;
 
 	_DIAGASSERT(ei != NULL);



CVS commit: src/lib/libc/citrus/modules

2011-10-30 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Oct 30 21:48:27 UTC 2011

Modified Files:
src/lib/libc/citrus/modules: citrus_mapper_std.c

Log Message:
Use boolean AND instead of bitwise one in _DIAGASSERT.
>From Henning Petersen in PR 45518.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/modules/citrus_mapper_std.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_mapper_std.c
diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.8 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9
--- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.8	Mon Sep 11 13:06:33 2006
+++ src/lib/libc/citrus/modules/citrus_mapper_std.c	Sun Oct 30 21:48:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper_std.c,v 1.8 2006/09/11 13:06:33 tnozaki Exp $	*/
+/*	$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $	*/
 
 /*-
  * Copyright (c)2003, 2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper_std.c,v 1.8 2006/09/11 13:06:33 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -426,7 +426,7 @@ _citrus_mapper_std_mapper_uninit(struct 
 {
 	struct _citrus_mapper_std *ms;
 
-	_DIAGASSERT(cm!=NULL & cm->cm_closure!=NULL);
+	_DIAGASSERT(cm!=NULL && cm->cm_closure!=NULL);
 
 	ms = cm->cm_closure;
 	if (ms->ms_uninit)



CVS commit: src/lib/libc/citrus/modules

2011-10-10 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Mon Oct 10 22:45:45 UTC 2011

Modified Files:
src/lib/libc/citrus/modules: citrus_iso2022.c

Log Message:
revert r1.21, still problem exists for posix2008 mbsnrtowcs(not yet commited),
but i have no time to investigate t_mbrtowc failure.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/citrus/modules/citrus_iso2022.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_iso2022.c
diff -u src/lib/libc/citrus/modules/citrus_iso2022.c:1.21 src/lib/libc/citrus/modules/citrus_iso2022.c:1.22
--- src/lib/libc/citrus/modules/citrus_iso2022.c:1.21	Fri Oct  7 18:59:13 2011
+++ src/lib/libc/citrus/modules/citrus_iso2022.c	Mon Oct 10 22:45:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $	*/
+/*	$NetBSD: citrus_iso2022.c,v 1.22 2011/10/10 22:45:45 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)1999, 2002 Citrus Project,
@@ -30,7 +30,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_iso2022.c,v 1.22 2011/10/10 22:45:45 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -695,7 +695,7 @@ _ISO2022_sgetwchar(_ISO2022EncodingInfo 
 			if (n < sp->len) {
 if (nmatch == n) {
 	if (result)
-		*result = string + n;
+		*result = string;
 	return (_ISO2022INVALID);
 }
 			} else {
@@ -755,7 +755,7 @@ asis:
 
 		/* we still need to wait for more characters to come */
 		if (result)
-			*result = string + n;
+			*result = string;
 		return (_ISO2022INVALID);
 
 	case CS94:
@@ -765,7 +765,7 @@ asis:
 
 		/* we still need to wait for more characters to come */
 		if (result)
-			*result = string + n;
+			*result = string;
 		return (_ISO2022INVALID);
 	}
 



CVS commit: src/lib/libc/citrus/modules

2011-10-07 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Fri Oct  7 18:59:13 UTC 2011

Modified Files:
src/lib/libc/citrus/modules: citrus_iso2022.c

Log Message:
update string pointer when input is partial escape sequence or multibyte.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/citrus/modules/citrus_iso2022.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_iso2022.c
diff -u src/lib/libc/citrus/modules/citrus_iso2022.c:1.20 src/lib/libc/citrus/modules/citrus_iso2022.c:1.21
--- src/lib/libc/citrus/modules/citrus_iso2022.c:1.20	Tue Dec  7 22:01:45 2010
+++ src/lib/libc/citrus/modules/citrus_iso2022.c	Fri Oct  7 18:59:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $	*/
+/*	$NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)1999, 2002 Citrus Project,
@@ -30,7 +30,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $");
+__RCSID("$NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -695,7 +695,7 @@ _ISO2022_sgetwchar(_ISO2022EncodingInfo 
 			if (n < sp->len) {
 if (nmatch == n) {
 	if (result)
-		*result = string;
+		*result = string + n;
 	return (_ISO2022INVALID);
 }
 			} else {
@@ -755,7 +755,7 @@ asis:
 
 		/* we still need to wait for more characters to come */
 		if (result)
-			*result = string;
+			*result = string + n;
 		return (_ISO2022INVALID);
 
 	case CS94:
@@ -765,7 +765,7 @@ asis:
 
 		/* we still need to wait for more characters to come */
 		if (result)
-			*result = string;
+			*result = string + n;
 		return (_ISO2022INVALID);
 	}
 



CVS commit: src/lib/libc/citrus/modules

2011-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 23 14:53:46 UTC 2011

Modified Files:
src/lib/libc/citrus/modules: citrus_big5.c

Log Message:
Make intermediate size variable size_t like the rest to avoid
unnecessary casting.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/citrus/modules/citrus_big5.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_big5.c
diff -u src/lib/libc/citrus/modules/citrus_big5.c:1.12 src/lib/libc/citrus/modules/citrus_big5.c:1.13
--- src/lib/libc/citrus/modules/citrus_big5.c:1.12	Sat Jun 14 16:01:07 2008
+++ src/lib/libc/citrus/modules/citrus_big5.c	Mon May 23 14:53:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_big5.c,v 1.12 2008/06/14 16:01:07 tnozaki Exp $	*/
+/*	$NetBSD: citrus_big5.c,v 1.13 2011/05/23 14:53:46 joerg Exp $	*/
 
 /*-
  * Copyright (c)2002, 2006 Citrus Project,
@@ -60,7 +60,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_big5.c,v 1.12 2008/06/14 16:01:07 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_big5.c,v 1.13 2011/05/23 14:53:46 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -393,7 +393,7 @@
 			  size_t n, wchar_t wc, _BIG5State * __restrict psenc,
 			  size_t * __restrict nresult)
 {
-	int l, ret;
+	size_t l, ret;
 
 	_DIAGASSERT(ei != NULL);
 	_DIAGASSERT(nresult != 0);



CVS commit: src/lib/libc/citrus

2011-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 23 14:52:32 UTC 2011

Modified Files:
src/lib/libc/citrus: citrus_prop.h

Log Message:
Use C99-style init in _CITRUS_PROP_HINT_END to avoid warnings for
uninitialised type field.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_prop.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_prop.h
diff -u src/lib/libc/citrus/citrus_prop.h:1.4 src/lib/libc/citrus/citrus_prop.h:1.5
--- src/lib/libc/citrus/citrus_prop.h:1.4	Wed Mar 30 08:22:01 2011
+++ src/lib/libc/citrus/citrus_prop.h	Mon May 23 14:52:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.h,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */
+/* $NetBSD: citrus_prop.h,v 1.5 2011/05/23 14:52:32 joerg Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -81,7 +81,7 @@
 #define _CITRUS_PROP_HINT_NUM(name, cb) \
 	{ name, _CITRUS_PROP_NUM, { .num = { cb } } }
 #define _CITRUS_PROP_HINT_END \
-	{ NULL }
+	{ .name = NULL }
 
 __BEGIN_DECLS
 int _citrus_prop_parse_variable(const _citrus_prop_hint_t * __restrict,



CVS commit: src/lib/libc/citrus/modules

2011-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 23 14:45:44 UTC 2011

Modified Files:
src/lib/libc/citrus/modules: citrus_iconv_none.c

Log Message:
Actually return something deterministic


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/modules/citrus_iconv_none.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_iconv_none.c
diff -u src/lib/libc/citrus/modules/citrus_iconv_none.c:1.2 src/lib/libc/citrus/modules/citrus_iconv_none.c:1.3
--- src/lib/libc/citrus/modules/citrus_iconv_none.c:1.2	Tue Jul  1 09:42:16 2003
+++ src/lib/libc/citrus/modules/citrus_iconv_none.c	Mon May 23 14:45:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iconv_none.c,v 1.2 2003/07/01 09:42:16 tshiozak Exp $	*/
+/*	$NetBSD: citrus_iconv_none.c,v 1.3 2011/05/23 14:45:44 joerg Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iconv_none.c,v 1.2 2003/07/01 09:42:16 tshiozak Exp $");
+__RCSID("$NetBSD: citrus_iconv_none.c,v 1.3 2011/05/23 14:45:44 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -87,6 +87,7 @@
 _citrus_iconv_none_iconv_init_context(struct _citrus_iconv *cv)
 {
 	cv->cv_closure = NULL;
+	return 0;
 }
 
 static void



CVS commit: src/lib/libc/citrus

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 08:22:02 UTC 2011

Modified Files:
src/lib/libc/citrus: citrus_iconv.c citrus_prop.c citrus_prop.h

Log Message:
>From Henning Petersen in PR # 44641: C99 primitive type 'bool' used
as a variable name. Also small KNF, as in FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/citrus_iconv.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_prop.c \
src/lib/libc/citrus/citrus_prop.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_iconv.c
diff -u src/lib/libc/citrus/citrus_iconv.c:1.8 src/lib/libc/citrus/citrus_iconv.c:1.9
--- src/lib/libc/citrus/citrus_iconv.c:1.8	Sat Sep  5 06:44:27 2009
+++ src/lib/libc/citrus/citrus_iconv.c	Wed Mar 30 08:22:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iconv.c,v 1.8 2009/09/05 06:44:27 dholland Exp $	*/
+/*	$NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,22 +28,25 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iconv.c,v 1.8 2009/09/05 06:44:27 dholland Exp $");
+__RCSID("$NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
 #include "reentrant.h"
+
+#include 
+#include 
+
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
 
 #include "citrus_namespace.h"
 #include "citrus_bcs.h"
@@ -65,7 +68,8 @@
 #ifdef _REENTRANT
 static rwlock_t lock = RWLOCK_INITIALIZER;
 #endif
-static int isinit = 0;
+
+static bool isinit = false;
 static _CITRUS_HASH_HEAD(, _citrus_iconv_shared, CI_HASH_SIZE) shared_pool;
 static TAILQ_HEAD(, _citrus_iconv_shared) shared_unused;
 static int shared_num_unused, shared_max_reuse;
@@ -82,7 +86,7 @@
 			shared_max_reuse = atoi(getenv(CI_ENV_MAX_REUSE));
 		if (shared_max_reuse < 0)
 			shared_max_reuse = CI_INITIAL_MAX_REUSE;
-		isinit = 1;
+		isinit = true;
 	}
 	rwlock_unlock(&lock);
 }

Index: src/lib/libc/citrus/citrus_prop.c
diff -u src/lib/libc/citrus/citrus_prop.c:1.3 src/lib/libc/citrus/citrus_prop.c:1.4
--- src/lib/libc/citrus/citrus_prop.c:1.3	Wed Nov 22 23:47:21 2006
+++ src/lib/libc/citrus/citrus_prop.c	Wed Mar 30 08:22:01 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.c,v 1.3 2006/11/22 23:47:21 tnozaki Exp $ */
+/* $NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -29,12 +29,13 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_prop.c,v 1.3 2006/11/22 23:47:21 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
-#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -51,7 +52,8 @@
 	_citrus_prop_type_t type;
 	union {
 		const char *str;
-		int bool, chr;
+		int chr;
+		bool boolean;
 		uint64_t num;
 	} u;
 } _citrus_prop_object_t;
@@ -228,7 +230,7 @@
 		if (_bcs_tolower(_memstream_getc(ms)) == 'r' &&
 		_bcs_tolower(_memstream_getc(ms)) == 'u' &&
 		_bcs_tolower(_memstream_getc(ms)) == 'e') {
-			obj->u.bool = 1;
+			obj->u.boolean = true;
 			return 0;
 		}
 		break;
@@ -237,7 +239,7 @@
 		_bcs_tolower(_memstream_getc(ms)) == 'l' &&
 		_bcs_tolower(_memstream_getc(ms)) == 's' &&
 		_bcs_tolower(_memstream_getc(ms)) == 'e') {
-			obj->u.bool = 0;
+			obj->u.boolean = false;
 			return 0;
 		}
 	}
@@ -406,11 +408,25 @@
 	errnum = (*hint->cb._func_.func)(context,	\
 	hint->name,	ostart.u._func_, oend.u._func_);\
 } while (/*CONSTCOND*/0)
+
 		switch (hint->type) {
-		case _CITRUS_PROP_BOOL: CALL0(bool); break;
-		case _CITRUS_PROP_STR : CALL0( str); break;
-		case _CITRUS_PROP_CHR : CALL1( chr); break;
-		case _CITRUS_PROP_NUM : CALL1( num); break;
+
+		case _CITRUS_PROP_BOOL:
+			CALL0(boolean);
+			break;
+
+		case _CITRUS_PROP_STR:
+			CALL0(str);
+			break;
+
+		case _CITRUS_PROP_CHR:
+			CALL1(chr);
+			break;
+
+		case _CITRUS_PROP_NUM:
+			CALL1(num);
+			break;
+
 		default:
 			abort();
 			/*NOTREACHED*/
Index: src/lib/libc/citrus/citrus_prop.h
diff -u src/lib/libc/citrus/citrus_prop.h:1.3 src/lib/libc/citrus/citrus_prop.h:1.4
--- src/lib/libc/citrus/citrus_prop.h:1.3	Thu Nov 23 13:59:03 2006
+++ src/lib/libc/citrus/citrus_prop.h	Wed Mar 30 08:22:01 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.h,v 1.3 2006/11/23 13:59:03 tnozaki Exp $ */
+/* $NetBSD: citrus_prop.h,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -45,7 +45,7 @@
 typedef struct { \
 	_citrus_prop_##_func_##_cb_func_t func; \
 } _citrus_prop_##_func_##_cb_t;
-_CITRUS_PROP_CB0_T(bool, int)
+_CITRUS_PROP_CB0_T(boolean, int)
 _CITRUS_PROP_CB0_T(str, const char *)
 

CVS commit: src/lib/libc/citrus/modules

2010-12-07 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec  7 22:01:45 UTC 2010

Modified Files:
src/lib/libc/citrus/modules: citrus_iso2022.c

Log Message:
Remove tautology.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/citrus/modules/citrus_iso2022.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_iso2022.c
diff -u src/lib/libc/citrus/modules/citrus_iso2022.c:1.19 src/lib/libc/citrus/modules/citrus_iso2022.c:1.20
--- src/lib/libc/citrus/modules/citrus_iso2022.c:1.19	Sat Jun 14 16:01:07 2008
+++ src/lib/libc/citrus/modules/citrus_iso2022.c	Tue Dec  7 22:01:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iso2022.c,v 1.19 2008/06/14 16:01:07 tnozaki Exp $	*/
+/*	$NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999, 2002 Citrus Project,
@@ -30,7 +30,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iso2022.c,v 1.19 2008/06/14 16:01:07 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -880,7 +880,7 @@
 
 	/* buffer is not empty */
 	p = psenc->ch;
-	while (psenc->chlen < sizeof(psenc->ch) && n >= 0) {
+	while (psenc->chlen < sizeof(psenc->ch)) {
 		if (n > 0) {
 			psenc->ch[psenc->chlen++] = *s0++;
 			n--;



CVS commit: src/lib/libc/citrus/modules

2010-12-07 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Dec  7 22:01:23 UTC 2010

Modified Files:
src/lib/libc/citrus/modules: citrus_ues.c

Log Message:
Mark function as static and give it an explicit return type.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/citrus/modules/citrus_ues.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_ues.c
diff -u src/lib/libc/citrus/modules/citrus_ues.c:1.1 src/lib/libc/citrus/modules/citrus_ues.c:1.2
--- src/lib/libc/citrus/modules/citrus_ues.c:1.1	Mon Nov 13 15:16:31 2006
+++ src/lib/libc/citrus/modules/citrus_ues.c	Tue Dec  7 22:01:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_ues.c,v 1.1 2006/11/13 15:16:31 tnozaki Exp $ */
+/* $NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_ues.c,v 1.1 2006/11/13 15:16:31 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -367,6 +367,7 @@
 }
 
 /*ARGSUSED*/
+static int
 _citrus_UES_stdenc_wctocs(_UESEncodingInfo * __restrict ei,
 	_csid_t * __restrict csid, _index_t * __restrict idx, wchar_t wc)
 {



CVS commit: src/lib/libc/citrus

2010-05-22 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sat May 22 08:13:18 UTC 2010

Modified Files:
src/lib/libc/citrus: citrus_lc_ctype.c citrus_lc_messages.c
citrus_lc_monetary.c citrus_lc_numeric.c citrus_lc_time.c

Log Message:
rune.h is not public, so merge with rune_local.h.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_lc_ctype.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/citrus_lc_messages.c \
src/lib/libc/citrus/citrus_lc_monetary.c \
src/lib/libc/citrus/citrus_lc_numeric.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_lc_time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_lc_ctype.c
diff -u src/lib/libc/citrus/citrus_lc_ctype.c:1.4 src/lib/libc/citrus/citrus_lc_ctype.c:1.5
--- src/lib/libc/citrus/citrus_lc_ctype.c:1.4	Sat Mar 27 15:25:21 2010
+++ src/lib/libc/citrus/citrus_lc_ctype.c	Sat May 22 08:13:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_ctype.c,v 1.4 2010/03/27 15:25:21 tnozaki Exp $ */
+/* $NetBSD: citrus_lc_ctype.c,v 1.5 2010/05/22 08:13:18 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.4 2010/03/27 15:25:21 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.5 2010/05/22 08:13:18 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "reentrant.h"
@@ -57,7 +57,6 @@
 #include "citrus_module.h"
 #include "citrus_ctype.h"
 
-#include "rune.h"
 #include "rune_local.h"
 #include "multibyte.h"
 

Index: src/lib/libc/citrus/citrus_lc_messages.c
diff -u src/lib/libc/citrus/citrus_lc_messages.c:1.2 src/lib/libc/citrus/citrus_lc_messages.c:1.3
--- src/lib/libc/citrus/citrus_lc_messages.c:1.2	Sun Jan 11 02:46:24 2009
+++ src/lib/libc/citrus/citrus_lc_messages.c	Sat May 22 08:13:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_messages.c,v 1.2 2009/01/11 02:46:24 christos Exp $ */
+/* $NetBSD: citrus_lc_messages.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_messages.c,v 1.2 2009/01/11 02:46:24 christos Exp $");
+__RCSID("$NetBSD: citrus_lc_messages.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -61,7 +61,7 @@
 #include "citrus_db.h"
 #include "citrus_db_hash.h"
 #include "citrus_memstream.h"
-#include "rune.h"
+#include "rune_local.h"
 
 /*
  * macro required by all template headers
Index: src/lib/libc/citrus/citrus_lc_monetary.c
diff -u src/lib/libc/citrus/citrus_lc_monetary.c:1.2 src/lib/libc/citrus/citrus_lc_monetary.c:1.3
--- src/lib/libc/citrus/citrus_lc_monetary.c:1.2	Sun Jan 11 02:46:24 2009
+++ src/lib/libc/citrus/citrus_lc_monetary.c	Sat May 22 08:13:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_monetary.c,v 1.2 2009/01/11 02:46:24 christos Exp $ */
+/* $NetBSD: citrus_lc_monetary.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_monetary.c,v 1.2 2009/01/11 02:46:24 christos Exp $");
+__RCSID("$NetBSD: citrus_lc_monetary.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -61,7 +61,7 @@
 #include "citrus_db.h"
 #include "citrus_db_hash.h"
 #include "citrus_memstream.h"
-#include "rune.h"
+#include "rune_local.h"
 
 #include "fix_grouping.h"
 #include "citrus_fix_grouping.h"
Index: src/lib/libc/citrus/citrus_lc_numeric.c
diff -u src/lib/libc/citrus/citrus_lc_numeric.c:1.2 src/lib/libc/citrus/citrus_lc_numeric.c:1.3
--- src/lib/libc/citrus/citrus_lc_numeric.c:1.2	Sun Jan 11 02:46:24 2009
+++ src/lib/libc/citrus/citrus_lc_numeric.c	Sat May 22 08:13:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_numeric.c,v 1.2 2009/01/11 02:46:24 christos Exp $ */
+/* $NetBSD: citrus_lc_numeric.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_numeric.c,v 1.2 2009/01/11 02:46:24 christos Exp $");
+__RCSID("$NetBSD: citrus_lc_numeric.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -61,7 +61,7 @@
 #include "citrus_db.h"
 #include "citrus_db_hash.h"
 #include "citrus_memstream.h"
-#include "rune.h"
+#include "rune_local.h"
 
 #include "fix_grouping.h"
 #include "citrus_fix_grouping.h"

Index: src/lib/libc/citrus/citrus_lc_time.c
diff -u src/lib/libc/citrus/citrus_lc_time.c:1.3 src/lib/libc/citrus/citrus_lc_time.c:1.4
--- src/lib/libc/citrus/citrus_lc_time.c:1.3	Mon Feb  9 14:39:48 2009
+++ src/lib/libc/citrus/citrus_lc_time.c	Sat May 22 08:13:18 2010
@@ -1,4 +1,4

CVS commit: src/lib/libc/citrus/modules

2010-03-20 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sat Mar 20 18:15:32 UTC 2010

Modified Files:
src/lib/libc/citrus/modules: citrus_utf1632.c

Log Message:
fix byte order mark related bug introduced by previous commit,
reported by Sverre Froyen via current-user, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/modules/citrus_utf1632.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_utf1632.c
diff -u src/lib/libc/citrus/modules/citrus_utf1632.c:1.10 src/lib/libc/citrus/modules/citrus_utf1632.c:1.11
--- src/lib/libc/citrus/modules/citrus_utf1632.c:1.10	Mon Mar 15 15:00:58 2010
+++ src/lib/libc/citrus/modules/citrus_utf1632.c	Sat Mar 20 18:15:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $	*/
+/*	$NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -155,9 +155,8 @@
 	goto refetch;
 }
 			}
-		} else {
-			psenc->current_endian = ei->preffered_endian;
 		}
+		psenc->current_endian = ei->preffered_endian;
 	}
 	endian = psenc->current_endian;
 



CVS commit: src/lib/libc/citrus/modules

2010-03-15 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Mon Mar 15 15:00:58 UTC 2010

Modified Files:
src/lib/libc/citrus/modules: citrus_utf1632.c

Log Message:
1. fix wrong byte order mark of utf-16, reported by NARUSE Yui -san.
patch provided by tshiozak@ -san.

2. don't eat 0xfeff/0xfffe if they don't appear at the first of bytestream.
noticed y tshiozak@ -san, patch provied by me.

thanks a lot.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_utf1632.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/modules/citrus_utf1632.c
diff -u src/lib/libc/citrus/modules/citrus_utf1632.c:1.9 src/lib/libc/citrus/modules/citrus_utf1632.c:1.10
--- src/lib/libc/citrus/modules/citrus_utf1632.c:1.9	Sat Jun 14 16:01:08 2008
+++ src/lib/libc/citrus/modules/citrus_utf1632.c	Mon Mar 15 15:00:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_utf1632.c,v 1.9 2008/06/14 16:01:08 tnozaki Exp $	*/
+/*	$NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_utf1632.c,v 1.9 2008/06/14 16:01:08 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -127,37 +127,39 @@
 		result++;
 	}
 
-	/* judge endian marker */
-	if ((ei->mode & _MODE_UTF32) == 0) {
-		/* UTF16 */
-		if (psenc->ch[0]==0xFE && psenc->ch[1]==0xFF) {
-			psenc->current_endian = _ENDIAN_BIG;
-			chlenbak = 0;
-			goto refetch;
-		} else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE) {
-			psenc->current_endian = _ENDIAN_LITTLE;
-			chlenbak = 0;
-			goto refetch;
-		}
-	} else {
-		/* UTF32 */
-		if (psenc->ch[0]==0x00 && psenc->ch[1]==0x00 &&
-		psenc->ch[2]==0xFE && psenc->ch[3]==0xFF) {
-			psenc->current_endian = _ENDIAN_BIG;
-			chlenbak = 0;
-			goto refetch;
-		} else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE &&
-			   psenc->ch[2]==0x00 && psenc->ch[3]==0x00) {
-			psenc->current_endian = _ENDIAN_LITTLE;
-			chlenbak = 0;
-			goto refetch;
+	if (psenc->current_endian == _ENDIAN_UNKNOWN) {
+		if ((ei->mode & _MODE_FORCE_ENDIAN) == 0) {
+			/* judge endian marker */
+			if ((ei->mode & _MODE_UTF32) == 0) {
+/* UTF16 */
+if (psenc->ch[0]==0xFE && psenc->ch[1]==0xFF) {
+	psenc->current_endian = _ENDIAN_BIG;
+	chlenbak = 0;
+	goto refetch;
+} else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE) {
+	psenc->current_endian = _ENDIAN_LITTLE;
+	chlenbak = 0;
+	goto refetch;
+}
+			} else {
+/* UTF32 */
+if (psenc->ch[0]==0x00 && psenc->ch[1]==0x00 &&
+psenc->ch[2]==0xFE && psenc->ch[3]==0xFF) {
+	psenc->current_endian = _ENDIAN_BIG;
+	chlenbak = 0;
+	goto refetch;
+} else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE &&
+	   psenc->ch[2]==0x00 && psenc->ch[3]==0x00) {
+	psenc->current_endian = _ENDIAN_LITTLE;
+	chlenbak = 0;
+	goto refetch;
+}
+			}
+		} else {
+			psenc->current_endian = ei->preffered_endian;
 		}
 	}
-	if ((ei->mode & _MODE_FORCE_ENDIAN) != 0 ||
-	psenc->current_endian == _ENDIAN_UNKNOWN)
-		endian = ei->preffered_endian;
-	else
-		endian = psenc->current_endian;
+	endian = psenc->current_endian;
 
 	/* get wc */
 	if ((ei->mode & _MODE_UTF32) == 0) {
@@ -186,13 +188,13 @@
 			wc <<= 10;
 			switch (endian) {
 			case _ENDIAN_LITTLE:
-if (psenc->ch[2]<0xDC || psenc->ch[2]>0xDF)
+if (psenc->ch[3]<0xDC || psenc->ch[3]>0xDF)
 	goto ilseq;
 wc |= psenc->ch[2];
 wc |= (wchar_t)(psenc->ch[3] & 3) << 8;
 break;
 			case _ENDIAN_BIG:
-if (psenc->ch[3]<0xDC || psenc->ch[3]>0xDF)
+if (psenc->ch[2]<0xDC || psenc->ch[2]>0xDF)
 	goto ilseq;
 wc |= psenc->ch[3];
 wc |= (wchar_t)(psenc->ch[2] & 3) << 8;



CVS commit: src/lib/libc/citrus

2009-09-04 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Sep  5 06:44:27 UTC 2009

Modified Files:
src/lib/libc/citrus: citrus_iconv.c

Log Message:
Add parentheses around a misleading string constant concatenation,
from (my own, very old) PR 36064.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/citrus_iconv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_iconv.c
diff -u src/lib/libc/citrus/citrus_iconv.c:1.7 src/lib/libc/citrus/citrus_iconv.c:1.8
--- src/lib/libc/citrus/citrus_iconv.c:1.7	Fri Jul 25 14:05:25 2008
+++ src/lib/libc/citrus/citrus_iconv.c	Sat Sep  5 06:44:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iconv.c,v 1.7 2008/07/25 14:05:25 christos Exp $	*/
+/*	$NetBSD: citrus_iconv.c,v 1.8 2009/09/05 06:44:27 dholland Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iconv.c,v 1.7 2008/07/25 14:05:25 christos Exp $");
+__RCSID("$NetBSD: citrus_iconv.c,v 1.8 2009/09/05 06:44:27 dholland Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -107,7 +107,7 @@
 	char *p, path[PATH_MAX];
 
 	/* iconv.dir path */
-	snprintf(path, (size_t)PATH_MAX, "%s/" _CITRUS_ICONV_DIR, curdir);
+	snprintf(path, (size_t)PATH_MAX, ("%s/" _CITRUS_ICONV_DIR), curdir);
 
 	/* lookup db */
 	cp = p = _lookup_simple(path, key, linebuf, linebufsize,



CVS commit: src/lib/libc/citrus

2009-04-12 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sun Apr 12 14:20:19 UTC 2009

Modified Files:
src/lib/libc/citrus: citrus_pivot_factory.c

Log Message:
fix -Wcast-qual issue


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/citrus/citrus_pivot_factory.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/citrus/citrus_pivot_factory.c
diff -u src/lib/libc/citrus/citrus_pivot_factory.c:1.6 src/lib/libc/citrus/citrus_pivot_factory.c:1.7
--- src/lib/libc/citrus/citrus_pivot_factory.c:1.6	Sat Feb  9 14:56:20 2008
+++ src/lib/libc/citrus/citrus_pivot_factory.c	Sun Apr 12 14:20:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_pivot_factory.c,v 1.6 2008/02/09 14:56:20 junyoung Exp $	*/
+/*	$NetBSD: citrus_pivot_factory.c,v 1.7 2009/04/12 14:20:19 lukem Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -32,7 +32,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_pivot_factory.c,v 1.6 2008/02/09 14:56:20 junyoung Exp $");
+__RCSID("$NetBSD: citrus_pivot_factory.c,v 1.7 2009/04/12 14:20:19 lukem Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -114,6 +114,7 @@
 	struct src_entry *se;
 	const char *p;
 	char key1[LINE_MAX], key2[LINE_MAX], data[LINE_MAX];
+	char *ep;
 	uint32_t val;
 
 	se = NULL; /* XXX gcc */
@@ -145,9 +146,8 @@
 	line = _bcs_skip_ws_len(p, &len);
 	_bcs_trunc_rws_len(line, &len);
 	snprintf(data, sizeof(data), "%.*s", (int)len, line);
-	/* LINTED: discard const */
-	val = strtoul(data, (char **)&p, 0);
-	if (*p != '\0')
+	val = strtoul(data, &ep, 0);
+	if (*ep != '\0')
 		return EFTYPE;
 
 	/* insert to DB */