Hi, First, welcome to the list! :) Thanks for the contribution but this patch is a hack and it shouldn't be done this way. The real solution is much easier.. wherever we see : font measure $font $msg replace it with : font measure $font -displayof . $msg
The problem is that '-d' is interpreted as a shorthand for -displayof, and it's only because we don't specify -displayof which will take '.' as the default displayof... By enforcing it, we make sure that it won't misinterpret our $msg value. so it's easy.. grep 'font measure', each one that *doesn't* have -displayof, add it to it. Thanks, KaKaRoTo On Tue, Dec 18, 2007 at 01:42:58AM +0100, José Ramón Rubio Largo wrote: > Hi. > My name is Jose Ramon, I'm from Spain and I'm new writing in this list, so > at first hi everyone and sorry about my english!! I like amsn project and > I'm reading its source code the last days... so I'll try collaborate it in > my few free time. > > I've seen http://www.amsn-project.net/wiki/Forums_TODO web and I send you a > possible solution about the Critical bug > http://www.amsn-project.net/forums/viewtopic.php?p=25112 that if someone has > a '-d' in his nickname, amsn will crash!! It's my first patch and I'm > learning TCL/TK now, but I think this patch could work fine, although I also > think it's only provisional because the really bug is from "measure" > operation from TCL/TK. With this patch, our amsn won't crash with these > nicks. > > Files: > abook.diff: I modify parseCustomNickStyled function to solve it when our > contacts have "-d" in theirs nickname. > smileys.diff: I modify parseMessageToList to solve it when our nickname > have "-d". > > > Have fun! > > > > -- > -- > ======================================= > José Ramón Rubio Largo > E-mail: [EMAIL PROTECTED] > ( http://linuxcpp.extreblog.com ) > ======================================= > --- abook.tcl 2007-12-15 21:26:16.000000000 +0100 > +++ abook.tcl 2007-12-18 00:24:19.000000000 +0100 > @@ -787,7 +787,7 @@ > set l [lreplace $l $listpos > $listpos] > incr llength -1 > > - if { $p1 ne "" } { > + if { $p1 ne "" && $p1 ne "-d"} { > set l [linsert $l > $listpos [list text $p1]] > incr llength 1 > incr listpos 1 > @@ -799,7 +799,7 @@ > incr llength 1 > } > > - if { $p3 ne "" } { > + if { $p3 ne "" $$ $p3 ne "-d"} { > set l [linsert $l > $listpos [list text $p3]] > incr llength 1 > #We must parse p3 > --- smileys.tcl 2007-11-04 17:16:18.000000000 +0100 > +++ smileys.tcl 2007-12-18 00:24:00.000000000 +0100 > @@ -612,6 +612,12 @@ > set p1 [string range [lindex $l > $listpos 1] 0 [expr {$pos - 1}]] > set p2 $image_name > set p3 [string range [lindex $l > $listpos 1] [expr {$pos + [string length $symbol]}] end] > + if { $p1 eq "-d" || [string match $p1 > "-displayof"]} { > + set p1 "" > + } > + if { $p3 eq "-d" || [string match $p3 > "-displayof"]} { > + set p3 "" > + } > > #TODO: #need to change for an 'in-place' lreplace (here and below) > if { $p2 == "__newline__" } { > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Amsn-devel mailing list > Amsn-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/amsn-devel ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel