Changeset 30f248a


Ignore:
Timestamp:
2005-11-26T02:02:38Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
dfde8e0
Parents:
cb91b72
Message:

Lowered the line splitting limit a bit (and made it a bit prettier by trying to split on spaces, if possible). Should close #29.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    rcb91b72 r30f248a  
    645645                msg = buf;
    646646       
    647         while( strlen( msg ) > 450 )
     647        while( strlen( msg ) > 425 )
    648648        {
    649649                char tmp, *nl;
    650650               
    651                 tmp = msg[450];
    652                 msg[450] = 0;
    653                
    654                 /* If there's a newline in this string, split up there so we're not
    655                    going to split up lines. If there isn't a newline, well, too bad. */
    656                 if( ( nl = strrchr( msg, '\n' ) ) )
     651                tmp = msg[425];
     652                msg[425] = 0;
     653               
     654                /* If there's a newline/space in this string, split up there,
     655                   looks a bit prettier. */
     656                if( ( nl = strrchr( msg, '\n' ) ) || ( nl = strchr( msg, ' ' ) ) )
     657                {
     658                        msg[425] = tmp;
     659                        tmp = *nl;
    657660                        *nl = 0;
     661                }
    658662               
    659663                irc_msgfrom( irc, u->nick, msg );
    660                
    661                 msg[450] = tmp;
    662664               
    663665                /* Move on. */
    664666                if( nl )
    665667                {
    666                         *nl = '\n';
     668                        *nl = tmp;
    667669                        msg = nl + 1;
    668670                }
    669671                else
    670672                {
    671                         msg += 450;
     673                        msg[425] = tmp;
     674                        msg += 425;
    672675                }
    673676        }
Note: See TracChangeset for help on using the changeset viewer.