TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

parse has bug?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
sunrie



Joined: 29 Oct 2006
Posts: 11

PostPosted: Wed Nov 29, 2006 6:43 am    Post subject: parse has bug? Reply with quote

In misc.c line 264
Code:

                            sprintf(gtd->cmds[0], "%c", left[cnt]);
                            sprintf(temp, "parse {%c}", left[cnt]);

Cause parse chinese incorrect!
After I add code for --enable-big5, it correct.
Code:

#ifdef BIG5
                        if (left[cnt] & 0x80 && left[cnt+1] != 0)
                        {
                                sprintf(gtd->cmds[0], "%c%c", left[cnt], left[cnt+1]);
                                sprintf(temp, "parse {%c%c}", left[cnt], left[cnt+1]);
                                cnt++;
                        }
                        else
                        {
                                sprintf(gtd->cmds[0], "%c", left[cnt]);
                                sprintf(temp, "parse {%c}", left[cnt]);
                        }
#else
                                sprintf(gtd->cmds[0], "%c", left[cnt]);
                                sprintf(temp, "parse {%c}", left[cnt]);
#endif
[/code]
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Wed Nov 29, 2006 7:21 am    Post subject: Reply with quote

Definitely broken, does the following code work as well?

Code:

#ifdef BIG5
               if (left[cnt] & 0x80 && left[cnt+1] != 0)
               {
                    sprintf(gtd->cmds[0], "%c%c", left[cnt], left[++cnt]);
               }
               else
               {   
                    sprintf(gtd->cmds[0], "%c", left[cnt]);
               }
#else
               sprintf(gtd->cmds[0], "%c", left[cnt]);
#endif
               sprintf(temp, "parse {%s}", gtd->cmds[0]);
               do_internal_variable(ses, temp);
Back to top
View user's profile Send private message Send e-mail
sunrie



Joined: 29 Oct 2006
Posts: 11

PostPosted: Wed Nov 29, 2006 11:37 am    Post subject: Reply with quote

same as above, but more simple
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Wed Nov 29, 2006 4:03 pm    Post subject: Reply with quote

simple is your friend :wink:
Back to top
View user's profile Send private message Send e-mail
sunrie



Joined: 29 Oct 2006
Posts: 11

PostPosted: Wed Nov 29, 2006 10:05 pm    Post subject: Reply with quote

My "C" language not well, I use "Java" mostly.
Otherwise, I will add "multi actions for one line" by myself, but too difficult for me.
Expect add this feature!
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Thu Nov 30, 2006 6:20 am    Post subject: Reply with quote

I've considered doing this, but it would only complicate the program without any real gain.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group