From musha@ms.tokyo.jcom.ne.jp Thu Aug 26 07:14:06 1999
Return-Path: <musha@ms.tokyo.jcom.ne.jp>
Received: from ms.tokyo.jcom.ne.jp (ms.tokyo.jcom.ne.jp [210.234.123.18])
	by hub.freebsd.org (Postfix) with ESMTP id BAB3E14E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Aug 1999 07:14:04 -0700 (PDT)
	(envelope-from musha@ms.tokyo.jcom.ne.jp)
Received: from daemon.my.domain (pc343031.tokyo.jcom.ne.jp [203.140.143.31])
	by ms.tokyo.jcom.ne.jp (8.9.1/3.7W 06/01/99) with ESMTP id XAA03369
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Aug 1999 23:12:26 +0900 (JST)
Received: by daemon.my.domain (8.9.3/3.7W) id XAA46711; Thu, 26 Aug 1999 23:11:54 +0900 (JST)
Received: by archon.my.domain (8.9.3/3.7W) id XAA02579; Thu, 26 Aug 1999 23:11:54 +0900 (JST)
Message-Id: <199908261411.XAA02579@archon.my.domain>
Date: Thu, 26 Aug 1999 23:11:54 +0900 (JST)
From: Akinori MUSHA aka knu <knu@and.or.jp>
Sender: musha@ms.tokyo.jcom.ne.jp
Reply-To: knu@and.or.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: Update port: japanese/gtkicq
X-Send-Pr-Version: 3.2

>Number:         13395
>Category:       ports
>Synopsis:       Patches for faultless Japanese message support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 26 07:20:01 PDT 1999
>Closed-Date:    Fri Aug 27 00:32:37 PDT 1999
>Last-Modified:  Fri Aug 27 00:33:42 PDT 1999
>Originator:     Akinori MUSHA aka knu
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
A.N.D.
>Environment:

	FreeBSD 3.2-STABLE i386

>Description:

	GtkICQ misdetects the Japanese code set sometimes.

>How-To-Repeat:

	When sending or receiving a short Japanese message,
gtkicq may misjudge code set of it. Not always but sometimes.

>Fix:
	
	Add the following patches to the port to perform
sure code set conversion between EUC and ShiftJIS. Libjcode's
code set auto-detection feature is rather unnecesary in this case.

[patch-aa]
*** src/histadd.c.orig	Tue Aug 17 01:17:01 1999
--- src/histadd.c	Tue Aug 17 01:22:06 1999
***************
*** 13,22 ****
  	time_t timedate;
  	struct tm *my_tm;
  	char pdate[46];
- 	int cx, cy, cz;
  	char *halves[] = { "AM", "PM" };
  	int half = 0;
- 	char buf[ 1024 ];
  
  	char *filename;
  	int file;
--- 13,20 ----
***************
*** 53,84 ****
  
  	write( file, pdate, strlen( pdate ) );
  
! 	strcpy( buf, "" );
! 	cy = cz = 0;
! 	for( cx = 0; cx < strlen( strings[ 2 ] ); cx ++ )
! 	{
! 		cy ++;
! 		if( strings[ 2 ][cx] == '\n' || cy == 70 ||
! 		    ( cy >= 60 && strings[ 2 ][cx] == ' ' ) )
! 		{
! 			write( file, ( strings[ 2 ] + cz ), cy );
! 			if( cy >= 60 && cy != 70 )
! 			{
! 				write( file, "\n", 1 );
! 			}
! 			if( cy == 70 )
! 			{
! 				write( file, "-\n", 2 );
! 			}
! 			cz += cy;
! 			cy = 0;
! 		}
! 	}			
! 
! 	if( cz != strlen( strings[ 2 ] ) )
! 	{
! 		write( file, ( strings[ 2 ] + cz ), strlen( strings[ 2 ] ) - cz );
! 	}
  
  	write( file, "\n", 1 );
  
--- 51,57 ----
  
  	write( file, pdate, strlen( pdate ) );
  
! 	write( file, strings[ 2 ], strlen( strings[ 2 ] ) );
  
  	write( file, "\n", 1 );
  
***************
*** 92,101 ****
  	time_t timedate;
  	struct tm *my_tm;
  	char pdate[42];
- 	int cx, cy, cz;
  	char *halves[] = { "AM", "PM" };
  	int half = 0;
- 	char buf[ 1024 ];
  
  	char *filename;
  	int file;
--- 65,72 ----
***************
*** 132,163 ****
  
  	write( file, pdate, strlen( pdate ) );
  
! 	strcpy( buf, "" );
! 	cy = cz = 0;
! 	for( cx = 0; cx < strlen( strings[ 2 ] ); cx ++ )
! 	{
! 		cy ++;
! 		if( strings[ 2 ][cx] == '\n' || cy == 70 ||
! 		    ( cy >= 60 && strings[ 2 ][cx] == ' ' ) )
! 		{
! 			write( file, ( strings[ 2 ] + cz ), cy );
! 			if( cy >= 60 && cy != 70 )
! 			{
! 				write( file, "\n", 1 );
! 			}
! 			if( cy == 70 )
! 			{
! 				write( file, "-\n", 2 );
! 			}
! 			cz += cy;
! 			cy = 0;
! 		}
! 	}			
! 
! 	if( cz != strlen( strings[ 2 ] ) )
! 	{
! 		write( file, ( strings[ 2 ] + cz ), strlen( strings[ 2 ] ) - cz );
! 	}
  	
  	write( file, "\n", 1 );
  
--- 103,109 ----
  
  	write( file, pdate, strlen( pdate ) );
  
! 	write( file, strings[ 2 ], strlen( strings[ 2 ] ) );
  	
  	write( file, "\n", 1 );
  
[patch-ab]
*** src/l10n_conv.c.orig	Tue Aug 17 01:17:43 1999
--- src/l10n_conv.c	Tue Aug 17 01:17:59 1999
***************
*** 10,18 ****
  #ifdef L10N
  #ifdef JAPANESE  
    if(!strcmp(to, "toLocal")){
!     return toStringEUC( t_in );
    }else if(!strcmp(to, "toNet")){
!     return toStringSJIS( t_in );
    }
  #else ifdef RUSSIAN
    if(!strcmp(to, "toLocal")){
--- 10,18 ----
  #ifdef L10N
  #ifdef JAPANESE  
    if(!strcmp(to, "toLocal")){
!     return toStringEUCfromSJIS( t_in );
    }else if(!strcmp(to, "toNet")){
!     return toStringSJISfromEUC( t_in );
    }
  #else ifdef RUSSIAN
    if(!strcmp(to, "toLocal")){

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: flathill 
State-Changed-When: Fri Aug 27 00:32:37 PDT 1999 
State-Changed-Why:  
Committed. Thanks! 
>Unformatted:
