close Warning: Failed to sync with repository "(default)": [Errno 12] Cannot allocate memory; repository information may be out of date. Look in the Trac log for more information including mitigation strategies.

Ticket #974: use_g_ascii_str_functions.patch

File use_g_ascii_str_functions.patch, 68.9 KB (added by dreisner@…, at 2012-07-06T20:55:41Z)
  • conf.c

    === modified file 'conf.c'
     
    197197        if( ini == NULL ) return -1;
    198198        while( ini_read( ini ) )
    199199        {
    200                 if( g_strcasecmp( ini->section, "settings" ) == 0 )
     200                if( g_ascii_strcasecmp( ini->section, "settings" ) == 0 )
    201201                {
    202                         if( g_strcasecmp( ini->key, "runmode" ) == 0 )
     202                        if( g_ascii_strcasecmp( ini->key, "runmode" ) == 0 )
    203203                        {
    204                                 if( g_strcasecmp( ini->value, "daemon" ) == 0 )
     204                                if( g_ascii_strcasecmp( ini->value, "daemon" ) == 0 )
    205205                                        conf->runmode = RUNMODE_DAEMON;
    206                                 else if( g_strcasecmp( ini->value, "forkdaemon" ) == 0 )
     206                                else if( g_ascii_strcasecmp( ini->value, "forkdaemon" ) == 0 )
    207207                                        conf->runmode = RUNMODE_FORKDAEMON;
    208208                                else
    209209                                        conf->runmode = RUNMODE_INETD;
    210210                        }
    211                         else if( g_strcasecmp( ini->key, "pidfile" ) == 0 )
     211                        else if( g_ascii_strcasecmp( ini->key, "pidfile" ) == 0 )
    212212                        {
    213213                                g_free( conf->pidfile );
    214214                                conf->pidfile = g_strdup( ini->value );
    215215                        }
    216                         else if( g_strcasecmp( ini->key, "daemoninterface" ) == 0 )
     216                        else if( g_ascii_strcasecmp( ini->key, "daemoninterface" ) == 0 )
    217217                        {
    218218                                g_free( conf->iface_in );
    219219                                conf->iface_in = g_strdup( ini->value );
    220220                        }
    221                         else if( g_strcasecmp( ini->key, "daemonport" ) == 0 )
     221                        else if( g_ascii_strcasecmp( ini->key, "daemonport" ) == 0 )
    222222                        {
    223223                                g_free( conf->port );
    224224                                conf->port = g_strdup( ini->value );
    225225                        }
    226                         else if( g_strcasecmp( ini->key, "clientinterface" ) == 0 )
     226                        else if( g_ascii_strcasecmp( ini->key, "clientinterface" ) == 0 )
    227227                        {
    228228                                g_free( conf->iface_out );
    229229                                conf->iface_out = g_strdup( ini->value );
    230230                        }
    231                         else if( g_strcasecmp( ini->key, "authmode" ) == 0 )
     231                        else if( g_ascii_strcasecmp( ini->key, "authmode" ) == 0 )
    232232                        {
    233                                 if( g_strcasecmp( ini->value, "registered" ) == 0 )
     233                                if( g_ascii_strcasecmp( ini->value, "registered" ) == 0 )
    234234                                        conf->authmode = AUTHMODE_REGISTERED;
    235                                 else if( g_strcasecmp( ini->value, "closed" ) == 0 )
     235                                else if( g_ascii_strcasecmp( ini->value, "closed" ) == 0 )
    236236                                        conf->authmode = AUTHMODE_CLOSED;
    237237                                else
    238238                                        conf->authmode = AUTHMODE_OPEN;
    239239                        }
    240                         else if( g_strcasecmp( ini->key, "authpassword" ) == 0 )
     240                        else if( g_ascii_strcasecmp( ini->key, "authpassword" ) == 0 )
    241241                        {
    242242                                g_free( conf->auth_pass );
    243243                                conf->auth_pass = g_strdup( ini->value );
    244244                        }
    245                         else if( g_strcasecmp( ini->key, "operpassword" ) == 0 )
     245                        else if( g_ascii_strcasecmp( ini->key, "operpassword" ) == 0 )
    246246                        {
    247247                                g_free( conf->oper_pass );
    248248                                conf->oper_pass = g_strdup( ini->value );
    249249                        }
    250                         else if( g_strcasecmp( ini->key, "hostname" ) == 0 )
     250                        else if( g_ascii_strcasecmp( ini->key, "hostname" ) == 0 )
    251251                        {
    252252                                g_free( conf->hostname );
    253253                                conf->hostname = g_strdup( ini->value );
    254254                        }
    255                         else if( g_strcasecmp( ini->key, "configdir" ) == 0 )
     255                        else if( g_ascii_strcasecmp( ini->key, "configdir" ) == 0 )
    256256                        {
    257257                                g_free( conf->configdir );
    258258                                conf->configdir = g_strdup( ini->value );
    259259                        }
    260                         else if( g_strcasecmp( ini->key, "motdfile" ) == 0 )
     260                        else if( g_ascii_strcasecmp( ini->key, "motdfile" ) == 0 )
    261261                        {
    262262                                g_free( conf->motdfile );
    263263                                conf->motdfile = g_strdup( ini->value );
    264264                        }
    265                         else if( g_strcasecmp( ini->key, "account_storage" ) == 0 )
     265                        else if( g_ascii_strcasecmp( ini->key, "account_storage" ) == 0 )
    266266                        {
    267267                                g_free( conf->primary_storage );
    268268                                conf->primary_storage = g_strdup( ini->value );
    269269                        }
    270                         else if( g_strcasecmp( ini->key, "account_storage_migrate" ) == 0 )
     270                        else if( g_ascii_strcasecmp( ini->key, "account_storage_migrate" ) == 0 )
    271271                        {
    272272                                g_strfreev( conf->migrate_storage );
    273273                                conf->migrate_storage = g_strsplit_set( ini->value, " \t,;", -1 );
    274274                        }
    275                         else if( g_strcasecmp( ini->key, "pinginterval" ) == 0 )
     275                        else if( g_ascii_strcasecmp( ini->key, "pinginterval" ) == 0 )
    276276                        {
    277277                                if( sscanf( ini->value, "%d", &i ) != 1 )
    278278                                {
     
    281281                                }
    282282                                conf->ping_interval = i;
    283283                        }
    284                         else if( g_strcasecmp( ini->key, "pingtimeout" ) == 0 )
     284                        else if( g_ascii_strcasecmp( ini->key, "pingtimeout" ) == 0 )
    285285                        {
    286286                                if( sscanf( ini->value, "%d", &i ) != 1 )
    287287                                {
     
    290290                                }
    291291                                conf->ping_timeout = i;
    292292                        }
    293                         else if( g_strcasecmp( ini->key, "proxy" ) == 0 )
     293                        else if( g_ascii_strcasecmp( ini->key, "proxy" ) == 0 )
    294294                        {
    295295                                url_t *url = g_new0( url_t, 1 );
    296296                               
     
    314314                               
    315315                                g_free( url );
    316316                        }
    317                         else if( g_strcasecmp( ini->key, "user" ) == 0 )
     317                        else if( g_ascii_strcasecmp( ini->key, "user" ) == 0 )
    318318                        {
    319319                                g_free( conf->user );
    320320                                conf->user = g_strdup( ini->value );
    321321                        }
    322                         else if( g_strcasecmp( ini->key, "ft_max_size" ) == 0 )
     322                        else if( g_ascii_strcasecmp( ini->key, "ft_max_size" ) == 0 )
    323323                        {
    324324                                size_t ft_max_size;
    325325                                if( sscanf( ini->value, "%zu", &ft_max_size ) != 1 )
     
    329329                                }
    330330                                conf->ft_max_size = ft_max_size;
    331331                        }
    332                         else if( g_strcasecmp( ini->key, "ft_max_kbps" ) == 0 )
     332                        else if( g_ascii_strcasecmp( ini->key, "ft_max_kbps" ) == 0 )
    333333                        {
    334334                                if( sscanf( ini->value, "%d", &i ) != 1 )
    335335                                {
     
    338338                                }
    339339                                conf->ft_max_kbps = i;
    340340                        }
    341                         else if( g_strcasecmp( ini->key, "ft_listen" ) == 0 )
     341                        else if( g_ascii_strcasecmp( ini->key, "ft_listen" ) == 0 )
    342342                        {
    343343                                g_free( conf->ft_listen );
    344344                                conf->ft_listen = g_strdup( ini->value );
    345345                        }
    346                         else if( g_strcasecmp( ini->key, "protocols" ) == 0 )
     346                        else if( g_ascii_strcasecmp( ini->key, "protocols" ) == 0 )
    347347                        {
    348348                                g_strfreev( conf->protocols );
    349349                                conf->protocols = g_strsplit_set( ini->value, " \t,;", -1 );
    350350                        }
    351                         else if( g_strcasecmp( ini->key, "cafile" ) == 0 )
     351                        else if( g_ascii_strcasecmp( ini->key, "cafile" ) == 0 )
    352352                        {
    353353                                g_free( conf->cafile );
    354354                                conf->cafile = g_strdup( ini->value );
     
    360360                                /* For now just ignore unknown keys... */
    361361                        }
    362362                }
    363                 else if( g_strcasecmp( ini->section, "defaults" ) != 0 )
     363                else if( g_ascii_strcasecmp( ini->section, "defaults" ) != 0 )
    364364                {
    365365                        fprintf( stderr, "Error: Unknown section [%s] in configuration file (line %d). "
    366366                                         "BitlBee configuration must be put in a [settings] section!\n", ini->section, ini->line );
     
    380380        if( ini == NULL ) return;
    381381        while( ini_read( ini ) )
    382382        {
    383                 if( g_strcasecmp( ini->section, "defaults" ) == 0 )
     383                if( g_ascii_strcasecmp( ini->section, "defaults" ) == 0 )
    384384                {
    385385                        set_t *s = set_find( &irc->b->set, ini->key );
    386386                       
  • help.c

    === modified file 'help.c'
     
    134134
    135135        for( h = *help; h; h = h->next )
    136136        {
    137                 if( h->title != NULL && g_strcasecmp( h->title, title ) == 0 )
     137                if( h->title != NULL && g_ascii_strcasecmp( h->title, title ) == 0 )
    138138                        break;
    139139        }
    140140        if( h && h->length > 0 )
     
    177177       
    178178        for( h = *help; h; h = h->next )
    179179        {
    180                 if( g_strcasecmp( h->title, title ) == 0 )
     180                if( g_ascii_strcasecmp( h->title, title ) == 0 )
    181181                        return 0;
    182182               
    183183                l = h;
  • ipc.c

    === modified file 'ipc.c'
     
    6161        }
    6262       
    6363        /* CLIENT == On initial connects, HELLO is after /RESTARTs. */
    64         if( g_strcasecmp( cmd[0], "CLIENT" ) == 0 )
     64        if( g_ascii_strcasecmp( cmd[0], "CLIENT" ) == 0 )
    6565                ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n",
    6666                                     (int) ( child ? child->pid : -1 ), cmd[2], cmd[1], cmd[3] );
    6767}
     
    522522                return;
    523523       
    524524        for( i = 0; commands[i].command; i ++ )
    525                 if( g_strcasecmp( commands[i].command, cmd[0] ) == 0 )
     525                if( g_ascii_strcasecmp( commands[i].command, cmd[0] ) == 0 )
    526526                {
    527527                        /* There is no typo in this line: */
    528528                        for( j = 1; cmd[j]; j ++ ); j --;
  • irc.c

    === modified file 'irc.c'
     
    894894        gsize test_bytes = 0;
    895895        GIConv ic, oc;
    896896
    897         if( g_strcasecmp( value, "none" ) == 0 )
     897        if( g_ascii_strcasecmp( value, "none" ) == 0 )
    898898                value = g_strdup( "utf-8" );
    899899
    900900        if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 )
  • irc_channel.c

    === modified file 'irc_channel.c'
     
    587587                else
    588588                        ic->last_target = iu;
    589589        }
    590         else if( g_strcasecmp( set_getstr( &irc->b->set, "default_target" ), "last" ) == 0 &&
     590        else if( g_ascii_strcasecmp( set_getstr( &irc->b->set, "default_target" ), "last" ) == 0 &&
    591591                 ic->last_target && g_slist_find( irc->users, ic->last_target ) )
    592592                iu = ic->last_target;
    593593        else
  • irc_commands.c

    === modified file 'irc_commands.c'
     
    335335        }
    336336       
    337337        /* Don't treat CTCP actions as real CTCPs, just convert them right now. */
    338         if( g_strncasecmp( cmd[2], "\001ACTION", 7 ) == 0 )
     338        if( g_ascii_strncasecmp( cmd[2], "\001ACTION", 7 ) == 0 )
    339339        {
    340340                cmd[2] += 4;
    341341                memcpy( cmd[2], "/me", 3 );
     
    762762                return;
    763763       
    764764        for( i = 0; irc_commands[i].command; i++ )
    765                 if( g_strcasecmp( irc_commands[i].command, cmd[0] ) == 0 )
     765                if( g_ascii_strcasecmp( irc_commands[i].command, cmd[0] ) == 0 )
    766766                {
    767767                        /* There should be no typo in the next line: */
    768768                        for( n_arg = 0; cmd[n_arg]; n_arg ++ ); n_arg --;
  • irc_im.c

    === modified file 'irc_im.c'
     
    237237                }
    238238        }
    239239       
    240         if( ( g_strcasecmp( set_getstr( &bee->set, "strip_html" ), "always" ) == 0 ) ||
     240        if( ( g_ascii_strcasecmp( set_getstr( &bee->set, "strip_html" ), "always" ) == 0 ) ||
    241241            ( ( bu->ic->flags & OPT_DOES_HTML ) && set_getbool( &bee->set, "strip_html" ) ) )
    242242        {
    243243                char *s = g_strdup( msg );
     
    479479
    480480static gboolean bee_irc_user_ctcp( irc_user_t *iu, char *const *ctcp )
    481481{
    482         if( ctcp[1] && g_strcasecmp( ctcp[0], "DCC" ) == 0
    483                     && g_strcasecmp( ctcp[1], "SEND" ) == 0 )
     482        if( ctcp[1] && g_ascii_strcasecmp( ctcp[0], "DCC" ) == 0
     483                    && g_ascii_strcasecmp( ctcp[1], "SEND" ) == 0 )
    484484        {
    485485                if( iu->bu && iu->bu->ic && iu->bu->ic->acc->prpl->transfer_request )
    486486                {
     
    491491                        return TRUE;
    492492                }
    493493        }
    494         else if( g_strcasecmp( ctcp[0], "TYPING" ) == 0 )
     494        else if( g_ascii_strcasecmp( ctcp[0], "TYPING" ) == 0 )
    495495        {
    496496                if( iu->bu && iu->bu->ic && iu->bu->ic->acc->prpl->send_typing && ctcp[1] )
    497497                {
     
    505505                        return TRUE;
    506506                }
    507507        }
    508         else if( g_strcasecmp( ctcp[0], "HELP" ) == 0 && iu->bu )
     508        else if( g_ascii_strcasecmp( ctcp[0], "HELP" ) == 0 && iu->bu )
    509509        {
    510510                GString *supp = g_string_new( "Supported CTCPs:" );
    511511                GList *l;
  • irc_send.c

    === modified file 'irc_send.c'
     
    338338                }
    339339                if( *s == 0 || *s == '\n' )
    340340                {
    341                         if( g_strncasecmp( line, "/me ", 4 ) == 0 && ( !prefix || !*prefix ) &&
    342                             g_strcasecmp( type, "PRIVMSG" ) == 0 )
     341                        if( g_ascii_strncasecmp( line, "/me ", 4 ) == 0 && ( !prefix || !*prefix ) &&
     342                            g_ascii_strcasecmp( type, "PRIVMSG" ) == 0 )
    343343                        {
    344344                                strcpy( raw_msg, "\001ACTION " );
    345345                                strncat( raw_msg, line + 4, s - line - 4 );
  • irc_user.c

    === modified file 'irc_user.c'
     
    229229
    230230static gboolean root_ctcp( irc_user_t *iu, char * const *ctcp )
    231231{
    232         if( g_strcasecmp( ctcp[0], "VERSION" ) == 0 )
     232        if( g_ascii_strcasecmp( ctcp[0], "VERSION" ) == 0 )
    233233        {
    234234                irc_send_msg_f( iu, "NOTICE", iu->irc->user->nick, "\001%s %s\001",
    235235                                ctcp[0], PACKAGE " " BITLBEE_VERSION " " ARCH "/" CPU );
    236236        }
    237         else if( g_strcasecmp( ctcp[0], "PING" ) == 0 )
     237        else if( g_ascii_strcasecmp( ctcp[0], "PING" ) == 0 )
    238238        {
    239239                irc_send_msg_f( iu, "NOTICE", iu->irc->user->nick, "\001%s %s\001",
    240240                                ctcp[0], ctcp[1] ? : "" );
  • lib/misc.c

    === modified file 'lib/misc.c'
     
    176176                        taglen = in - cs - 1;   /* not <0 because the above loop runs at least once */
    177177                        if( *in )
    178178                        {
    179                                 if( g_strncasecmp( cs+1, "b", taglen) == 0 )
    180                                         *(s++) = '\x02';
    181                                 else if( g_strncasecmp( cs+1, "/b", taglen) == 0 )
    182                                         *(s++) = '\x02';
    183                                 else if( g_strncasecmp( cs+1, "i", taglen) == 0 )
    184                                         *(s++) = '\x1f';
    185                                 else if( g_strncasecmp( cs+1, "/i", taglen) == 0 )
    186                                         *(s++) = '\x1f';
    187                                 else if( g_strncasecmp( cs+1, "br", taglen) == 0 )
     179                                if( g_ascii_strncasecmp( cs+1, "b", taglen) == 0 )
     180                                        *(s++) = '\x02';
     181                                else if( g_ascii_strncasecmp( cs+1, "/b", taglen) == 0 )
     182                                        *(s++) = '\x02';
     183                                else if( g_ascii_strncasecmp( cs+1, "i", taglen) == 0 )
     184                                        *(s++) = '\x1f';
     185                                else if( g_ascii_strncasecmp( cs+1, "/i", taglen) == 0 )
     186                                        *(s++) = '\x1f';
     187                                else if( g_ascii_strncasecmp( cs+1, "br", taglen) == 0 )
    188188                                        *(s++) = '\n';
    189189                                in ++;
    190190                        }
     
    204204                        matched = 0;
    205205                       
    206206                        for( i = 0; *ent[i].code; i ++ )
    207                                 if( g_strncasecmp( ent[i].code, cs, strlen( ent[i].code ) ) == 0 )
     207                                if( g_ascii_strncasecmp( ent[i].code, cs, strlen( ent[i].code ) ) == 0 )
    208208                                {
    209209                                        int j;
    210210                                       
     
    366366{
    367367        int i;
    368368       
    369         if( g_strncasecmp( src, "::ffff:", 7 ) != 0 )
     369        if( g_ascii_strncasecmp( src, "::ffff:", 7 ) != 0 )
    370370                return src;
    371371       
    372372        for( i = 7; src[i]; i ++ )
     
    485485        if( *value == 0 )
    486486                return 0;
    487487       
    488         if( ( g_strcasecmp( value, "true" ) == 0 ) || ( g_strcasecmp( value, "yes" ) == 0 ) || ( g_strcasecmp( value, "on" ) == 0 ) )
     488        if( ( g_ascii_strcasecmp( value, "true" ) == 0 ) || ( g_ascii_strcasecmp( value, "yes" ) == 0 ) || ( g_ascii_strcasecmp( value, "on" ) == 0 ) )
    489489                return 1;
    490         if( ( g_strcasecmp( value, "false" ) == 0 ) || ( g_strcasecmp( value, "no" ) == 0 ) || ( g_strcasecmp( value, "off" ) == 0 ) )
     490        if( ( g_ascii_strcasecmp( value, "false" ) == 0 ) || ( g_ascii_strcasecmp( value, "no" ) == 0 ) || ( g_ascii_strcasecmp( value, "off" ) == 0 ) )
    491491                return 1;
    492492       
    493493        while( *value )
     
    503503{
    504504        int i;
    505505       
    506         if( ( g_strcasecmp( value, "true" ) == 0 ) || ( g_strcasecmp( value, "yes" ) == 0 ) || ( g_strcasecmp( value, "on" ) == 0 ) )
     506        if( ( g_ascii_strcasecmp( value, "true" ) == 0 ) || ( g_ascii_strcasecmp( value, "yes" ) == 0 ) || ( g_ascii_strcasecmp( value, "on" ) == 0 ) )
    507507                return 1;
    508         if( ( g_strcasecmp( value, "false" ) == 0 ) || ( g_strcasecmp( value, "no" ) == 0 ) || ( g_strcasecmp( value, "off" ) == 0 ) )
     508        if( ( g_ascii_strcasecmp( value, "false" ) == 0 ) || ( g_ascii_strcasecmp( value, "no" ) == 0 ) || ( g_ascii_strcasecmp( value, "off" ) == 0 ) )
    509509                return 0;
    510510       
    511511        if( sscanf( value, "%d", &i ) == 1 )
     
    744744        while( ( i + hlen ) < len )
    745745        {
    746746                /* Maybe this is a bit over-commented, but I just hate this part... */
    747                 if( g_strncasecmp( text + i, header, hlen ) == 0 )
     747                if( g_ascii_strncasecmp( text + i, header, hlen ) == 0 )
    748748                {
    749749                        /* Skip to the (probable) end of the header */
    750750                        i += hlen;
  • lib/url.c

    === modified file 'lib/url.c'
     
    4242        }
    4343        else
    4444        {
    45                 if( g_strncasecmp( set_url, "http", i - set_url ) == 0 )
     45                if( g_ascii_strncasecmp( set_url, "http", i - set_url ) == 0 )
    4646                        url->proto = PROTO_HTTP;
    47                 else if( g_strncasecmp( set_url, "https", i - set_url ) == 0 )
     47                else if( g_ascii_strncasecmp( set_url, "https", i - set_url ) == 0 )
    4848                        url->proto = PROTO_HTTPS;
    49                 else if( g_strncasecmp( set_url, "socks4", i - set_url ) == 0 )
     49                else if( g_ascii_strncasecmp( set_url, "socks4", i - set_url ) == 0 )
    5050                        url->proto = PROTO_SOCKS4;
    51                 else if( g_strncasecmp( set_url, "socks5", i - set_url ) == 0 )
     51                else if( g_ascii_strncasecmp( set_url, "socks5", i - set_url ) == 0 )
    5252                        url->proto = PROTO_SOCKS5;
    5353                else
    5454                        return 0;
  • lib/xmltree.c

    === modified file 'lib/xmltree.c'
     
    2929
    3030#include "xmltree.h"
    3131
    32 #define g_strcasecmp g_ascii_strcasecmp
    33 #define g_strncasecmp g_ascii_strncasecmp
     32#define g_ascii_strcasecmp g_ascii_strcasecmp
     33#define g_ascii_strncasecmp g_ascii_strncasecmp
    3434
    3535static void xt_start_element( GMarkupParseContext *ctx, const gchar *element_name, const gchar **attr_names, const gchar **attr_values, gpointer data, GError **error )
    3636{
     
    183183                            /* If handler.name == NULL it means it should always match. */
    184184                        if( ( xt->handlers[i].name == NULL ||
    185185                              /* If it's not, compare. There should always be a name. */
    186                               g_strcasecmp( xt->handlers[i].name, node->name ) == 0 ) &&
     186                              g_ascii_strcasecmp( xt->handlers[i].name, node->name ) == 0 ) &&
    187187                            /* If handler.parent == NULL, it's a match. */
    188188                            ( xt->handlers[i].parent == NULL ||
    189189                              /* If there's a parent node, see if the name matches. */
    190                               ( node->parent ? g_strcasecmp( xt->handlers[i].parent, node->parent->name ) == 0 :
     190                              ( node->parent ? g_ascii_strcasecmp( xt->handlers[i].parent, node->parent->name ) == 0 :
    191191                              /* If there's no parent, the handler should mention <root> as a parent. */
    192192                                               strcmp( xt->handlers[i].parent, "<root>" ) == 0 ) ) )
    193193                        {
     
    476476        {
    477477                char *colon;
    478478               
    479                 if( g_strcasecmp( node->name, name ) == 0 ||
     479                if( g_ascii_strcasecmp( node->name, name ) == 0 ||
    480480                    ( ( colon = strchr( node->name, ':' ) ) &&
    481                       g_strcasecmp( colon + 1, name ) == 0 ) )
     481                      g_ascii_strcasecmp( colon + 1, name ) == 0 ) )
    482482                        break;
    483483               
    484484                node = node->next;
     
    512512                       
    513513                        while( node )
    514514                        {
    515                                 if( g_strncasecmp( node->name, name, n ) == 0 ||
     515                                if( g_ascii_strncasecmp( node->name, name, n ) == 0 ||
    516516                                    ( ( colon = strchr( node->name, ':' ) ) &&
    517                                       g_strncasecmp( colon + 1, name, n ) == 0 ) )
     517                                      g_ascii_strncasecmp( colon + 1, name, n ) == 0 ) )
    518518                                        break;
    519519                               
    520520                                node = node->next;
     
    536536                return NULL;
    537537       
    538538        for( i = 0; node->attr[i].key; i ++ )
    539                 if( g_strcasecmp( node->attr[i].key, key ) == 0 )
     539                if( g_ascii_strcasecmp( node->attr[i].key, key ) == 0 )
    540540                        break;
    541541       
    542542        /* This is an awful hack that only takes care of namespace prefixes
  • nick.c

    === modified file 'nick.c'
     
    143143                                while( isdigit( *fmt ) )
    144144                                        len = len * 10 + ( *(fmt++) - '0' );
    145145                        }
    146                         else if( g_strncasecmp( fmt, "nick", 4 ) == 0 )
     146                        else if( g_ascii_strncasecmp( fmt, "nick", 4 ) == 0 )
    147147                        {
    148148                                part = bu->nick ? : bu->handle;
    149149                                fmt += 4;
    150150                                ok |= TRUE;
    151151                                break;
    152152                        }
    153                         else if( g_strncasecmp( fmt, "handle", 6 ) == 0 )
     153                        else if( g_ascii_strncasecmp( fmt, "handle", 6 ) == 0 )
    154154                        {
    155155                                part = bu->handle;
    156156                                fmt += 6;
    157157                                ok |= TRUE;
    158158                                break;
    159159                        }
    160                         else if( g_strncasecmp( fmt, "full_name", 9 ) == 0 )
     160                        else if( g_ascii_strncasecmp( fmt, "full_name", 9 ) == 0 )
    161161                        {
    162162                                part = bu->fullname;
    163163                                fmt += 9;
    164164                                ok |= part && *part;
    165165                                break;
    166166                        }
    167                         else if( g_strncasecmp( fmt, "first_name", 10 ) == 0 )
     167                        else if( g_ascii_strncasecmp( fmt, "first_name", 10 ) == 0 )
    168168                        {
    169169                                part = bu->fullname;
    170170                                fmt += 10;
     
    172172                                chop = ' ';
    173173                                break;
    174174                        }
    175                         else if( g_strncasecmp( fmt, "group", 5 ) == 0 )
     175                        else if( g_ascii_strncasecmp( fmt, "group", 5 ) == 0 )
    176176                        {
    177177                                part = bu->group ? bu->group->name : NULL;
    178178                                fmt += 5;
    179179                                break;
    180180                        }
    181                         else if( g_strncasecmp( fmt, "account", 7 ) == 0 )
     181                        else if( g_ascii_strncasecmp( fmt, "account", 7 ) == 0 )
    182182                        {
    183183                                part = bu->ic->acc->tag;
    184184                                fmt += 7;
  • otr.c

    === modified file 'otr.c'
     
    425425                                        color=5;   /* red */
    426426
    427427                                /* in a query window, keep "/me " uncolored at the beginning */
    428                                 if(g_strncasecmp(msg, "/me ", 4) == 0
     428                                if(g_ascii_strncasecmp(msg, "/me ", 4) == 0
    429429                                   && irc_user_msgdest(iu) == irc->user->nick) {
    430430                                        msg += 4;  /* skip */
    431431                                        pre = "/me ";
     
    472472        /* consider OTR plaintext to be HTML if otr_does_html is set */
    473473        if(ctx && ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED &&
    474474           set_getbool(&ic->bee->set, "otr_does_html") &&
    475            (g_strncasecmp(msg, "<html>", 6) != 0)) {
     475           (g_ascii_strncasecmp(msg, "<html>", 6) != 0)) {
    476476                emsg = escape_html(msg);
    477477        }
    478478       
  • protocols/account.c

    === modified file 'protocols/account.c'
     
    266266       
    267267        for( a = bee->accounts; a; a = a->next )
    268268        {
    269                 if( g_strcasecmp( id, a->prpl->name ) == 0 )
     269                if( g_ascii_strcasecmp( id, a->prpl->name ) == 0 )
    270270                {
    271271                        if( !ret )
    272272                                ret = a;
     
    290290        account_t *a;
    291291       
    292292        for( a = bee->accounts; a; a = a->next )
    293                 if( a->tag && g_strcasecmp( tag, a->tag ) == 0 )
     293                if( a->tag && g_ascii_strcasecmp( tag, a->tag ) == 0 )
    294294                        return a;
    295295       
    296296        return NULL;
  • protocols/bee_chat.c

    === modified file 'protocols/bee_chat.c'
     
    8787        char *s;
    8888       
    8989        /* Gaim sends own messages through this too. IRC doesn't want this, so kill them */
    90         if( g_strcasecmp( who, ic->acc->user ) == 0 )
     90        if( g_ascii_strcasecmp( who, ic->acc->user ) == 0 )
    9191                return;
    9292       
    9393        bu = bee_user_by_handle( bee, ic, who );
    9494       
    9595        s = set_getstr( &ic->bee->set, "strip_html" );
    96         if( ( g_strcasecmp( s, "always" ) == 0 ) ||
     96        if( ( g_ascii_strcasecmp( s, "always" ) == 0 ) ||
    9797            ( ( ic->flags & OPT_DOES_HTML ) && s ) )
    9898                strip_html( msg );
    9999       
     
    132132       
    133133        if( who == NULL)
    134134                bu = NULL;
    135         else if( g_strcasecmp( who, ic->acc->user ) == 0 )
     135        else if( g_ascii_strcasecmp( who, ic->acc->user ) == 0 )
    136136                bu = bee->user;
    137137        else
    138138                bu = bee_user_by_handle( bee, ic, who );
    139139       
    140         if( ( g_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
     140        if( ( g_ascii_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
    141141            ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) )
    142142                strip_html( topic );
    143143       
     
    182182                imcb_log( ic, "User %s removed from conversation %p (%s)", handle, c, reason ? reason : "" );
    183183       
    184184        /* It might be yourself! */
    185         if( g_strcasecmp( handle, ic->acc->user ) == 0 )
     185        if( g_ascii_strcasecmp( handle, ic->acc->user ) == 0 )
    186186        {
    187187                if( c->joined == 0 )
    188188                        return;
     
    204204        struct im_connection *ic = c->ic;
    205205        char *buf = NULL;
    206206       
    207         if( ( ic->flags & OPT_DOES_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
     207        if( ( ic->flags & OPT_DOES_HTML ) && ( g_ascii_strncasecmp( msg, "<html>", 6 ) != 0 ) )
    208208        {
    209209                buf = escape_html( msg );
    210210                msg = buf;
  • protocols/bee_user.c

    === modified file 'protocols/bee_user.c'
     
    9393        char *buf = NULL;
    9494        int st;
    9595       
    96         if( ( bu->ic->flags & OPT_DOES_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
     96        if( ( bu->ic->flags & OPT_DOES_HTML ) && ( g_ascii_strncasecmp( msg, "<html>", 6 ) != 0 ) )
    9797        {
    9898                buf = escape_html( msg );
    9999                msg = buf;
     
    164164       
    165165        if( !( bu = bee_user_by_handle( bee, ic, handle ) ) )
    166166        {
    167                 if( g_strcasecmp( set_getstr( &ic->bee->set, "handle_unknown" ), "add" ) == 0 )
     167                if( g_ascii_strcasecmp( set_getstr( &ic->bee->set, "handle_unknown" ), "add" ) == 0 )
    168168                {
    169169                        bu = bee_user_new( bee, ic, handle, BEE_USER_LOCAL );
    170170                }
    171171                else
    172172                {
    173                         if( g_strcasecmp( set_getstr( &ic->bee->set, "handle_unknown" ), "ignore" ) != 0 )
     173                        if( g_ascii_strcasecmp( set_getstr( &ic->bee->set, "handle_unknown" ), "ignore" ) != 0 )
    174174                        {
    175175                                imcb_log( ic, "imcb_buddy_status() for unknown handle %s:\n"
    176176                                              "flags = %d, state = %s, message = %s", handle, flags,
     
    254254        {
    255255                char *h = set_getstr( &bee->set, "handle_unknown" );
    256256               
    257                 if( g_strcasecmp( h, "ignore" ) == 0 )
     257                if( g_ascii_strcasecmp( h, "ignore" ) == 0 )
    258258                {
    259259                        return;
    260260                }
    261                 else if( g_strncasecmp( h, "add", 3 ) == 0 )
     261                else if( g_ascii_strncasecmp( h, "add", 3 ) == 0 )
    262262                {
    263263                        bu = bee_user_new( bee, ic, handle, BEE_USER_LOCAL );
    264264                }
  • protocols/jabber/io.c

    === modified file 'protocols/jabber/io.c'
     
    204204                   this by hand. :-( */
    205205                if( !( jd->flags & JFLAG_STREAM_STARTED ) && jd->xt && jd->xt->root )
    206206                {
    207                         if( g_strcasecmp( jd->xt->root->name, "stream:stream" ) == 0 )
     207                        if( g_ascii_strcasecmp( jd->xt->root->name, "stream:stream" ) == 0 )
    208208                        {
    209209                                jd->flags |= JFLAG_STREAM_STARTED;
    210210                               
     
    326326        struct xt_node *c, *reply;
    327327        int trytls;
    328328       
    329         trytls = g_strcasecmp( set_getstr( &ic->acc->set, "tls" ), "try" ) == 0;
     329        trytls = g_ascii_strcasecmp( set_getstr( &ic->acc->set, "tls" ), "try" ) == 0;
    330330        c = xt_find_node( node->children, "starttls" );
    331331        if( c && !jd->ssl )
    332332        {
  • protocols/jabber/jabber.c

    === modified file 'protocols/jabber/jabber.c'
     
    333333        char *s;
    334334        int st;
    335335       
    336         if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
     336        if( g_ascii_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
    337337                return jabber_write( ic, message, strlen( message ) );
    338338       
    339         if( g_strcasecmp( who, JABBER_OAUTH_HANDLE ) == 0 &&
     339        if( g_ascii_strcasecmp( who, JABBER_OAUTH_HANDLE ) == 0 &&
    340340            !( jd->flags & OPT_LOGGED_IN ) && jd->fd == -1 )
    341341        {
    342342                if( sasl_oauth2_get_refresh_token( ic, message ) )
     
    437437{
    438438        struct jabber_data *jd = ic->proto_data;
    439439       
    440         if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
     440        if( g_ascii_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
    441441        {
    442442                jd->flags |= JFLAG_XMLCONSOLE;
    443443                imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL );
     
    452452{
    453453        struct jabber_data *jd = ic->proto_data;
    454454       
    455         if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
     455        if( g_ascii_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 )
    456456        {
    457457                jd->flags &= ~JFLAG_XMLCONSOLE;
    458458                /* Not necessary for now. And for now the code isn't too
     
    608608
    609609void *jabber_buddy_action( struct bee_user *bu, const char *action, char * const args[], void *data )
    610610{
    611         if( g_strcasecmp( action, "VERSION" ) == 0 )
     611        if( g_ascii_strcasecmp( action, "VERSION" ) == 0 )
    612612        {
    613613                struct jabber_buddy *bud;
    614614               
     
    647647        ret->chat_free_settings = jabber_chat_free_settings;
    648648        ret->keepalive = jabber_keepalive;
    649649        ret->send_typing = jabber_send_typing;
    650         ret->handle_cmp = g_strcasecmp;
     650        ret->handle_cmp = g_ascii_strcasecmp;
    651651        ret->transfer_request = jabber_si_transfer_request;
    652652        ret->buddy_action_list = jabber_buddy_action_list;
    653653        ret->buddy_action = jabber_buddy_action;
  • protocols/jabber/jabber_util.c

    === modified file 'protocols/jabber/jabber_util.c'
     
    6767
    6868char *set_eval_tls( set_t *set, char *value )
    6969{
    70         if( g_strcasecmp( value, "try" ) == 0 )
     70        if( g_ascii_strcasecmp( value, "try" ) == 0 )
    7171                return value;
    7272        else
    7373                return set_eval_bool( set, value );
     
    245245                return NULL;
    246246       
    247247        for( i = 0; jabber_away_state_list[i].full_name; i ++ )
    248                 if( g_strcasecmp( jabber_away_state_list[i].code, code ) == 0 )
     248                if( g_ascii_strcasecmp( jabber_away_state_list[i].code, code ) == 0 )
    249249                        return jabber_away_state_list + i;
    250250       
    251251        return NULL;
     
    259259                return NULL;
    260260       
    261261        for( i = 0; jabber_away_state_list[i].full_name; i ++ )
    262                 if( g_strcasecmp( jabber_away_state_list[i].full_name, name ) == 0 )
     262                if( g_ascii_strcasecmp( jabber_away_state_list[i].full_name, name ) == 0 )
    263263                        return jabber_away_state_list + i;
    264264       
    265265        return NULL;
  • protocols/jabber/sasl.c

    === modified file 'protocols/jabber/sasl.c'
     
    8989        c = node->children;
    9090        while( ( c = xt_find_node( c, "mechanism" ) ) )
    9191        {
    92                 if( c->text && g_strcasecmp( c->text, "PLAIN" ) == 0 )
     92                if( c->text && g_ascii_strcasecmp( c->text, "PLAIN" ) == 0 )
    9393                        sup_plain = 1;
    94                 else if( c->text && g_strcasecmp( c->text, "DIGEST-MD5" ) == 0 )
     94                else if( c->text && g_ascii_strcasecmp( c->text, "DIGEST-MD5" ) == 0 )
    9595                        sup_digest = 1;
    96                 else if( c->text && g_strcasecmp( c->text, "X-OAUTH2" ) == 0 )
     96                else if( c->text && g_ascii_strcasecmp( c->text, "X-OAUTH2" ) == 0 )
    9797                        sup_gtalk = 1;
    98                 else if( c->text && g_strcasecmp( c->text, "X-FACEBOOK-PLATFORM" ) == 0 )
     98                else if( c->text && g_ascii_strcasecmp( c->text, "X-FACEBOOK-PLATFORM" ) == 0 )
    9999                        sup_fb = 1;
    100                 else if( c->text && g_strcasecmp( c->text, "X-MESSENGER-OAUTH2" ) == 0 )
     100                else if( c->text && g_ascii_strcasecmp( c->text, "X-MESSENGER-OAUTH2" ) == 0 )
    101101                        sup_ms = 1;
    102102               
    103103                if( c->text )
     
    206206        while( isspace( *data ) || *data == ',' )
    207207                data ++;
    208208       
    209         if( g_strncasecmp( data, field, len ) == 0 && data[len] == '=' )
     209        if( g_ascii_strncasecmp( data, field, len ) == 0 && data[len] == '=' )
    210210        {
    211211                i = strlen( field ) + 1;
    212212        }
     
    229229                                while( isspace( data[i] ) || data[i] == ',' )
    230230                                        i ++;
    231231                               
    232                                 if( g_strncasecmp( data + i, field, len ) == 0 &&
     232                                if( g_ascii_strncasecmp( data + i, field, len ) == 0 &&
    233233                                    data[i+len] == '=' )
    234234                                {
    235235                                        i += len + 1;
  • protocols/msn/msn.c

    === modified file 'protocols/msn/msn.c'
     
    372372
    373373void *msn_buddy_action( struct bee_user *bu, const char *action, char * const args[], void *data )
    374374{
    375         if( g_strcasecmp( action, "NUDGE" ) == 0 )
     375        if( g_ascii_strcasecmp( action, "NUDGE" ) == 0 )
    376376                msn_buddy_msg( bu->ic, bu->handle, NUDGE_MESSAGE, 0 );
    377377       
    378378        return NULL;
     
    403403        ret->add_deny = msn_add_deny;
    404404        ret->rem_deny = msn_rem_deny;
    405405        ret->send_typing = msn_send_typing;
    406         ret->handle_cmp = g_strcasecmp;
     406        ret->handle_cmp = g_ascii_strcasecmp;
    407407        ret->buddy_data_add = msn_buddy_data_add;
    408408        ret->buddy_data_free = msn_buddy_data_free;
    409409        ret->buddy_action_list = msn_buddy_action_list;
  • protocols/msn/msn_util.c

    === modified file 'protocols/msn/msn_util.c'
     
    6464        {
    6565                int i;
    6666                for( i = 0; i < md->groupcount; i ++ )
    67                         if( g_strcasecmp( md->grouplist[i], group ) == 0 )
     67                        if( g_ascii_strcasecmp( md->grouplist[i], group ) == 0 )
    6868                        {
    6969                                g_snprintf( groupid, sizeof( groupid ), " %d", i );
    7070                                break;
     
    7979                        for( l = md->grpq; l; l = l->next )
    8080                        {
    8181                                ga = l->data;
    82                                 if( g_strcasecmp( ga->group, group ) == 0 )
     82                                if( g_ascii_strcasecmp( ga->group, group ) == 0 )
    8383                                        break;
    8484                        }
    8585                       
     
    145145        {
    146146                int i;
    147147                for( i = 0; i < md->groupcount; i ++ )
    148                         if( g_strcasecmp( md->grouplist[i], group ) == 0 )
     148                        if( g_ascii_strcasecmp( md->grouplist[i], group ) == 0 )
    149149                        {
    150150                                g_snprintf( groupid, sizeof( groupid ), " %d", i );
    151151                                break;
     
    501501        {
    502502                struct msn_group *mg = l->data;
    503503               
    504                 if( g_strcasecmp( mg->name, name ) == 0 )
     504                if( g_ascii_strcasecmp( mg->name, name ) == 0 )
    505505                        return mg;
    506506        }
    507507       
     
    517517        {
    518518                struct msn_group *mg = l->data;
    519519               
    520                 if( g_strcasecmp( mg->id, id ) == 0 )
     520                if( g_ascii_strcasecmp( mg->id, id ) == 0 )
    521521                        return mg;
    522522        }
    523523       
  • protocols/msn/ns.c

    === modified file 'protocols/msn/ns.c'
     
    532532                {
    533533                        struct msn_groupadd *ga = l->data;
    534534                        next = l->next;
    535                         if( g_strcasecmp( ga->group, group ) == 0 )
     535                        if( g_ascii_strcasecmp( ga->group, group ) == 0 )
    536536                        {
    537537                                if( !msn_buddy_list_add( ic, "FL", ga->who, ga->who, group ) )
    538538                                        return 0;
     
    606606       
    607607        if( strcmp( cmd[0], "MSG" ) == 0 )
    608608        {
    609                 if( g_strcasecmp( cmd[1], "Hotmail" ) == 0 )
     609                if( g_ascii_strcasecmp( cmd[1], "Hotmail" ) == 0 )
    610610                {
    611611                        char *ct = get_rfc822_header( msg, "Content-Type:", msglen );
    612612                       
    613613                        if( !ct )
    614614                                return( 1 );
    615615                       
    616                         if( g_strncasecmp( ct, "application/x-msmsgssystemmessage", 33 ) == 0 )
     616                        if( g_ascii_strncasecmp( ct, "application/x-msmsgssystemmessage", 33 ) == 0 )
    617617                        {
    618618                                char *mtype;
    619619                                char *arg1;
     
    633633                                g_free( arg1 );
    634634                                g_free( mtype );
    635635                        }
    636                         else if( g_strncasecmp( ct, "text/x-msmsgsprofile", 20 ) == 0 )
     636                        else if( g_ascii_strncasecmp( ct, "text/x-msmsgsprofile", 20 ) == 0 )
    637637                        {
    638638                                /* We don't care about this profile for now... */
    639639                        }
    640                         else if( g_strncasecmp( ct, "text/x-msmsgsinitialemailnotification", 37 ) == 0 )
     640                        else if( g_ascii_strncasecmp( ct, "text/x-msmsgsinitialemailnotification", 37 ) == 0 )
    641641                        {
    642642                                if( set_getbool( &ic->acc->set, "mail_notifications" ) )
    643643                                {
     
    651651                                        g_free( folders );
    652652                                }
    653653                        }
    654                         else if( g_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 )
     654                        else if( g_ascii_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 )
    655655                        {
    656656                                if( set_getbool( &ic->acc->set, "mail_notifications" ) )
    657657                                {
     
    665665                                        g_free( fromname );
    666666                                }
    667667                        }
    668                         else if( g_strncasecmp( ct, "text/x-msmsgsactivemailnotification", 35 ) == 0 )
     668                        else if( g_ascii_strncasecmp( ct, "text/x-msmsgsactivemailnotification", 35 ) == 0 )
    669669                        {
    670670                                /* Sorry, but this one really is *USELESS* */
    671671                        }
     
    797797        domain ++;
    798798       
    799799        if( ( d = adl->children ) == NULL ||
    800             g_strcasecmp( xt_find_attr( d, "n" ), domain ) != 0 )
     800            g_ascii_strcasecmp( xt_find_attr( d, "n" ), domain ) != 0 )
    801801        {
    802802                d = xt_new_node( "d", NULL, NULL );
    803803                xt_add_attr( d, "n", domain );
  • protocols/msn/sb.c

    === modified file 'protocols/msn/sb.c'
     
    506506                        return( 0 );
    507507                }
    508508               
    509                 if( sb->who && g_strcasecmp( cmd[1], sb->who ) == 0 )
     509                if( sb->who && g_ascii_strcasecmp( cmd[1], sb->who ) == 0 )
    510510                {
    511511                        /* The user we wanted to talk to is finally there, let's send the queued messages then. */
    512512                        struct msn_message *m;
     
    689689                if( !ct )
    690690                        return( 1 );
    691691               
    692                 if( g_strncasecmp( ct, "text/plain", 10 ) == 0 )
     692                if( g_ascii_strncasecmp( ct, "text/plain", 10 ) == 0 )
    693693                {
    694694                        g_free( ct );
    695695                       
     
    711711                }
    712712#if 0
    713713                // Disable MSN ft support for now.
    714                 else if( g_strncasecmp( ct, "text/x-msmsgsinvite", 19 ) == 0 )
     714                else if( g_ascii_strncasecmp( ct, "text/x-msmsgsinvite", 19 ) == 0 )
    715715                {
    716716                        char *command = get_rfc822_header( body, "Invitation-Command:", blen );
    717717                        char *cookie = get_rfc822_header( body, "Invitation-Cookie:", blen );
     
    730730                        icookie = strtoul( cookie, NULL, 10 );
    731731                        g_free( cookie );
    732732                       
    733                         if( g_strncasecmp( command, "INVITE", 6 ) == 0 ) {
     733                        if( g_ascii_strncasecmp( command, "INVITE", 6 ) == 0 ) {
    734734                                msn_invitation_invite( sb, cmd[1], icookie, body, blen );
    735                         } else if( g_strncasecmp( command, "ACCEPT", 6 ) == 0 ) {
     735                        } else if( g_ascii_strncasecmp( command, "ACCEPT", 6 ) == 0 ) {
    736736                                msn_invitation_accept( sb, cmd[1], icookie, body, blen );
    737                         } else if( g_strncasecmp( command, "CANCEL", 6 ) == 0 ) {
     737                        } else if( g_ascii_strncasecmp( command, "CANCEL", 6 ) == 0 ) {
    738738                                msn_invitation_cancel( sb, cmd[1], icookie, body, blen );
    739739                        } else {
    740740                                imcb_log( ic, "Warning: Received invalid invitation with "
     
    744744                        g_free( command );
    745745                }
    746746#endif
    747                 else if( g_strncasecmp( ct, "application/x-msnmsgrp2p", 24 ) == 0 )
     747                else if( g_ascii_strncasecmp( ct, "application/x-msnmsgrp2p", 24 ) == 0 )
    748748                {
    749749                        /* Not currently implemented. Don't warn about it since
    750750                           this seems to be used for avatars now. */
    751751                        g_free( ct );
    752752                }
    753                 else if( g_strncasecmp( ct, "text/x-msmsgscontrol", 20 ) == 0 )
     753                else if( g_ascii_strncasecmp( ct, "text/x-msmsgscontrol", 20 ) == 0 )
    754754                {
    755755                        char *who = get_rfc822_header( msg, "TypingUser:", msglen );
    756756                       
  • protocols/msn/soap.c

    === modified file 'protocols/msn/soap.c'
     
    699699        if( ( p = xt_find_path( node, "groupIds/guid" ) ) )
    700700                group_id = p->text;
    701701       
    702         if( type && g_strcasecmp( type, "me" ) == 0 )
     702        if( type && g_ascii_strcasecmp( type, "me" ) == 0 )
    703703        {
    704704                set_t *set = set_find( &ic->acc->set, "display_name" );
    705705                g_free( set->value );
  • protocols/msn/tables.c

    === modified file 'protocols/msn/tables.c'
     
    4444        int i;
    4545       
    4646        for( i = 0; *msn_away_state_list[i].code; i ++ )
    47                 if( g_strcasecmp( msn_away_state_list[i].code, code ) == 0 )
     47                if( g_ascii_strcasecmp( msn_away_state_list[i].code, code ) == 0 )
    4848                        return( msn_away_state_list + i );
    4949       
    5050        return NULL;
     
    5555        int i;
    5656       
    5757        for( i = 0; *msn_away_state_list[i].code; i ++ )
    58                 if( g_strcasecmp( msn_away_state_list[i].name, name ) == 0 )
     58                if( g_ascii_strcasecmp( msn_away_state_list[i].name, name ) == 0 )
    5959                        return( msn_away_state_list + i );
    6060       
    6161        return NULL;
  • protocols/nogaim.c

    === modified file 'protocols/nogaim.c'
     
    9797 
    9898        for (i = 0; global.conf->protocols && global.conf->protocols[i]; i++)
    9999        {
    100                 if (g_strcasecmp(p->name, global.conf->protocols[i]) == 0)
     100                if (g_ascii_strcasecmp(p->name, global.conf->protocols[i]) == 0)
    101101                        refused = FALSE;
    102102        }
    103103
     
    115115        {
    116116                struct prpl *proto = gl->data;
    117117               
    118                 if( g_strcasecmp( proto->name, name ) == 0 )
     118                if( g_ascii_strcasecmp( proto->name, name ) == 0 )
    119119                        return proto;
    120120        }
    121121       
     
    203203        text = g_strdup_vprintf( format, params );
    204204        va_end( params );
    205205
    206         if( ( g_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
     206        if( ( g_ascii_strcasecmp( set_getstr( &ic->bee->set, "strip_html" ), "always" ) == 0 ) ||
    207207            ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->bee->set, "strip_html" ) ) )
    208208                strip_html( text );
    209209       
     
    534534{
    535535        char *buf = NULL;
    536536       
    537         if( ( c->ic->flags & OPT_DOES_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
     537        if( ( c->ic->flags & OPT_DOES_HTML ) && ( g_ascii_strncasecmp( msg, "<html>", 6 ) != 0 ) )
    538538        {
    539539                buf = escape_html( msg );
    540540                msg = buf;
     
    594594        int i, j;
    595595       
    596596        for( m = gcm; m; m = m->next )
    597                 if( g_strncasecmp( m->data, away, strlen( m->data ) ) == 0 )
     597                if( g_ascii_strncasecmp( m->data, away, strlen( m->data ) ) == 0 )
    598598                {
    599599                        /* At least the Yahoo! module works better if message
    600600                           contains no data unless it adds something to what
     
    610610                int keep_message;
    611611               
    612612                for( j = 0; imc_away_alias_list[i][j]; j ++ )
    613                         if( g_strncasecmp( away, imc_away_alias_list[i][j], strlen( imc_away_alias_list[i][j] ) ) == 0 )
     613                        if( g_ascii_strncasecmp( away, imc_away_alias_list[i][j], strlen( imc_away_alias_list[i][j] ) ) == 0 )
    614614                        {
    615615                                keep_message = strlen( away ) != strlen( imc_away_alias_list[i][j] );
    616616                                break;
     
    623623                for( j = 0; imc_away_alias_list[i][j]; j ++ )
    624624                {
    625625                        for( m = gcm; m; m = m->next )
    626                                 if( g_strcasecmp( imc_away_alias_list[i][j], m->data ) == 0 )
     626                                if( g_ascii_strcasecmp( imc_away_alias_list[i][j], m->data ) == 0 )
    627627                                {
    628628                                        if( !keep_message )
    629629                                                *message = NULL;
  • protocols/oscar/oscar.c

    === modified file 'protocols/oscar/oscar.c'
     
    18411841        if (state == NULL)
    18421842                state = "";
    18431843
    1844         if (!g_strcasecmp(state, _("Visible"))) {
     1844        if (!g_ascii_strcasecmp(state, _("Visible"))) {
    18451845                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
    18461846                return;
    1847         } else if (!g_strcasecmp(state, _("Invisible"))) {
     1847        } else if (!g_ascii_strcasecmp(state, _("Invisible"))) {
    18481848                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE);
    18491849                return;
    18501850        } else if (message == NULL) {
     
    18941894
    18951895        if (state == NULL) {
    18961896                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
    1897         } else if (!g_strcasecmp(state, "Away")) {
     1897        } else if (!g_ascii_strcasecmp(state, "Away")) {
    18981898                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY);
    18991899                ic->away = g_strdup(msg);
    19001900                od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY;
    1901         } else if (!g_strcasecmp(state, "Do Not Disturb")) {
     1901        } else if (!g_ascii_strcasecmp(state, "Do Not Disturb")) {
    19021902                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY);
    19031903                ic->away = g_strdup(msg);
    19041904                od->sess->aim_icq_state = AIM_MTYPE_AUTODND;
    1905         } else if (!g_strcasecmp(state, "Not Available")) {
     1905        } else if (!g_ascii_strcasecmp(state, "Not Available")) {
    19061906                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY);
    19071907                ic->away = g_strdup(msg);
    19081908                od->sess->aim_icq_state = AIM_MTYPE_AUTONA;
    1909         } else if (!g_strcasecmp(state, "Occupied")) {
     1909        } else if (!g_ascii_strcasecmp(state, "Occupied")) {
    19101910                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY);
    19111911                ic->away = g_strdup(msg);
    19121912                od->sess->aim_icq_state = AIM_MTYPE_AUTOBUSY;
    1913         } else if (!g_strcasecmp(state, "Free For Chat")) {
     1913        } else if (!g_ascii_strcasecmp(state, "Free For Chat")) {
    19141914                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT);
    19151915                ic->away = g_strdup(msg);
    19161916                od->sess->aim_icq_state = AIM_MTYPE_AUTOFFC;
    1917         } else if (!g_strcasecmp(state, "Invisible")) {
     1917        } else if (!g_ascii_strcasecmp(state, "Invisible")) {
    19181918                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE);
    19191919                ic->away = g_strdup(msg);
    19201920        } else {
     
    23242324
    23252325        if ((encoding == NULL) || encoding[0] == '\0') {
    23262326                /*              gaim_debug_info("oscar", "Empty encoding, assuming UTF-8\n");*/
    2327         } else if (!g_strcasecmp(encoding, "iso-8859-1")) {
     2327        } else if (!g_ascii_strcasecmp(encoding, "iso-8859-1")) {
    23282328                do_iconv("iso-8859-1", "UTF-8", text, utf8, textlen, 8192);
    2329         } else if (!g_strcasecmp(encoding, "ISO-8859-1-Windows-3.1-Latin-1")) {
     2329        } else if (!g_ascii_strcasecmp(encoding, "ISO-8859-1-Windows-3.1-Latin-1")) {
    23302330                do_iconv("Windows-1252", "UTF-8", text, utf8, textlen, 8192);
    2331         } else if (!g_strcasecmp(encoding, "unicode-2-0")) {
     2331        } else if (!g_ascii_strcasecmp(encoding, "unicode-2-0")) {
    23322332                do_iconv("UCS-2BE", "UTF-8", text, utf8, textlen, 8192);
    2333         } else if (g_strcasecmp(encoding, "us-ascii") && strcmp(encoding, "utf-8")) {
     2333        } else if (g_ascii_strcasecmp(encoding, "us-ascii") && strcmp(encoding, "utf-8")) {
    23342334                /*              gaim_debug_warning("oscar", "Unrecognized character encoding \"%s\", "
    23352335                  "attempting to convert to UTF-8 anyway\n", encoding);*/
    23362336                do_iconv(encoding, "UTF-8", text, utf8, textlen, 8192);
  • protocols/purple/purple.c

    === modified file 'protocols/purple/purple.c'
     
    368368                        break;
    369369
    370370                if( state_txt != NULL &&
    371                     g_strcasecmp( state_txt, purple_status_type_get_name( pst ) ) == 0 )
     371                    g_ascii_strcasecmp( state_txt, purple_status_type_get_name( pst ) ) == 0 )
    372372                        break;
    373373        }
    374374       
     
    13031303        funcs.get_info = purple_get_info;
    13041304        funcs.keepalive = purple_keepalive;
    13051305        funcs.send_typing = purple_send_typing;
    1306         funcs.handle_cmp = g_strcasecmp;
     1306        funcs.handle_cmp = g_ascii_strcasecmp;
    13071307        /* TODO(wilmer): Set these only for protocols that support them? */
    13081308        funcs.chat_msg = purple_chat_msg;
    13091309        funcs.chat_with = purple_chat_with;
     
    13361336               
    13371337                /* libpurple doesn't define a protocol called OSCAR, but we
    13381338                   need it to be compatible with normal BitlBee. */
    1339                 if( g_strcasecmp( prot->info->id, "prpl-aim" ) == 0 )
     1339                if( g_ascii_strcasecmp( prot->info->id, "prpl-aim" ) == 0 )
    13401340                {
    13411341                        ret = g_memdup( &funcs, sizeof( funcs ) );
    13421342                        ret->name = "oscar";
  • protocols/skype/skype.c

    === modified file 'protocols/skype/skype.c'
     
    12721272        int i;
    12731273
    12741274        for (i = 0; skype_away_state_list[i].full_name; i++)
    1275                 if (g_strcasecmp(skype_away_state_list[i].full_name, name) == 0)
     1275                if (g_ascii_strcasecmp(skype_away_state_list[i].full_name, name) == 0)
    12761276                        return skype_away_state_list + i;
    12771277
    12781278        return NULL;
     
    15631563        args = args;
    15641564        data = data;
    15651565
    1566         if (!g_strcasecmp(action, "CALL"))
     1566        if (!g_ascii_strcasecmp(action, "CALL"))
    15671567                skype_call(bu->ic, bu->handle);
    1568         else if (!g_strcasecmp(action, "HANGUP"))
     1568        else if (!g_ascii_strcasecmp(action, "HANGUP"))
    15691569                skype_hangup(bu->ic);
    15701570
    15711571        return NULL;
     
    15911591        ret->chat_leave = skype_chat_leave;
    15921592        ret->chat_invite = skype_chat_invite;
    15931593        ret->chat_with = skype_chat_with;
    1594         ret->handle_cmp = g_strcasecmp;
     1594        ret->handle_cmp = g_ascii_strcasecmp;
    15951595        ret->chat_topic = skype_chat_topic;
    15961596#if BITLBEE_VERSION_CODE > BITLBEE_VER(3, 0, 1)
    15971597        ret->buddy_action_list = skype_buddy_action_list;
  • protocols/twitter/twitter.c

    === modified file 'protocols/twitter/twitter.c'
     
    8282
    8383        if (set_getbool(&ic->acc->set, "oauth") && !td->oauth_info)
    8484                twitter_oauth_start(ic);
    85         else if (g_strcasecmp(set_getstr(&ic->acc->set, "mode"), "one") != 0 &&
     85        else if (g_ascii_strcasecmp(set_getstr(&ic->acc->set, "mode"), "one") != 0 &&
    8686                 !(td->flags & TWITTER_HAVE_FRIENDS)) {
    8787                imcb_log(ic, "Getting contact list");
    8888                twitter_get_friends_ids(ic, -1);
     
    189189
    190190static char *set_eval_mode(set_t * set, char *value)
    191191{
    192         if (g_strcasecmp(value, "one") == 0 ||
    193             g_strcasecmp(value, "many") == 0 || g_strcasecmp(value, "chat") == 0)
     192        if (g_ascii_strcasecmp(value, "one") == 0 ||
     193            g_ascii_strcasecmp(value, "many") == 0 || g_ascii_strcasecmp(value, "chat") == 0)
    194194                return value;
    195195        else
    196196                return NULL;
     
    387387        struct twitter_data *td = ic->proto_data;
    388388        int plen = strlen(td->prefix);
    389389
    390         if (g_strncasecmp(who, td->prefix, plen) == 0 && who[plen] == '_' &&
    391             g_strcasecmp(who + plen + 1, ic->acc->user) == 0) {
     390        if (g_ascii_strncasecmp(who, td->prefix, plen) == 0 && who[plen] == '_' &&
     391            g_ascii_strcasecmp(who + plen + 1, ic->acc->user) == 0) {
    392392                if (set_getbool(&ic->acc->set, "oauth") &&
    393393                    td->oauth_info && td->oauth_info->token == NULL) {
    394394                        char pin[strlen(message) + 1], *s;
     
    506506                return;
    507507        } else if (!set_getbool(&ic->acc->set, "commands")) {
    508508                /* Not supporting commands. */
    509         } else if (g_strcasecmp(cmd[0], "undo") == 0) {
     509        } else if (g_ascii_strcasecmp(cmd[0], "undo") == 0) {
    510510                guint64 id;
    511511
    512512                if (cmd[1] == NULL)
     
    521521
    522522                g_free(cmds);
    523523                return;
    524         } else if (g_strcasecmp(cmd[0], "follow") == 0 && cmd[1]) {
     524        } else if (g_ascii_strcasecmp(cmd[0], "follow") == 0 && cmd[1]) {
    525525                twitter_add_buddy(ic, cmd[1], NULL);
    526526                g_free(cmds);
    527527                return;
    528         } else if (g_strcasecmp(cmd[0], "unfollow") == 0 && cmd[1]) {
     528        } else if (g_ascii_strcasecmp(cmd[0], "unfollow") == 0 && cmd[1]) {
    529529                twitter_remove_buddy(ic, cmd[1], NULL);
    530530                g_free(cmds);
    531531                return;
    532         } else if ((g_strcasecmp(cmd[0], "report") == 0 ||
    533                     g_strcasecmp(cmd[0], "spam") == 0) && cmd[1]) {
     532        } else if ((g_ascii_strcasecmp(cmd[0], "report") == 0 ||
     533                    g_ascii_strcasecmp(cmd[0], "spam") == 0) && cmd[1]) {
    534534                char * screen_name;
    535535                guint64 id;
    536536                screen_name = cmd[1];
     
    547547                twitter_report_spam(ic, screen_name);
    548548                g_free(cmds);
    549549                return;
    550         } else if (g_strcasecmp(cmd[0], "rt") == 0 && cmd[1]) {
     550        } else if (g_ascii_strcasecmp(cmd[0], "rt") == 0 && cmd[1]) {
    551551                struct twitter_user_data *tud;
    552552                bee_user_t *bu;
    553553                guint64 id;
     
    573573
    574574                g_free(cmds);
    575575                return;
    576         } else if (g_strcasecmp(cmd[0], "reply") == 0 && cmd[1] && cmd[2]) {
     576        } else if (g_ascii_strcasecmp(cmd[0], "reply") == 0 && cmd[1] && cmd[2]) {
    577577                struct twitter_user_data *tud;
    578578                bee_user_t *bu = NULL;
    579579                guint64 id = 0;
     
    605605                }
    606606                message = new = g_strdup_printf("@%s %s", bu->handle, message + (cmd[2] - cmd[0]));
    607607                in_reply_to = id;
    608         } else if (g_strcasecmp(cmd[0], "post") == 0) {
     608        } else if (g_ascii_strcasecmp(cmd[0], "post") == 0) {
    609609                message += 5;
    610610        }
    611611
     
    669669        ret->rem_deny = twitter_rem_deny;
    670670        ret->buddy_data_add = twitter_buddy_data_add;
    671671        ret->buddy_data_free = twitter_buddy_data_free;
    672         ret->handle_cmp = g_strcasecmp;
     672        ret->handle_cmp = g_ascii_strcasecmp;
    673673
    674674        register_protocol(ret);
    675675
  • protocols/twitter/twitter_lib.c

    === modified file 'protocols/twitter/twitter_lib.c'
     
    152152                // The buddy is not in the list, add the buddy and set the status to logged in.
    153153                imcb_add_buddy(ic, name, NULL);
    154154                imcb_rename_buddy(ic, name, fullname);
    155                 if (g_strcasecmp(mode, "chat") == 0) {
     155                if (g_ascii_strcasecmp(mode, "chat") == 0) {
    156156                        /* Necessary so that nicks always get translated to the
    157157                           exact Twitter username. */
    158158                        imcb_buddy_nick_hint(ic, name, name);
    159159                        imcb_chat_add_buddy(td->timeline_gc, name);
    160                 } else if (g_strcasecmp(mode, "many") == 0)
     160                } else if (g_ascii_strcasecmp(mode, "many") == 0)
    161161                        imcb_buddy_status(ic, name, OPT_LOGGED_IN, NULL, NULL);
    162162        }
    163163}
     
    233233        // The root <statuses> node should hold the list of statuses <status>
    234234        // Walk over the nodes children.
    235235        for (child = node->children; child; child = child->next) {
    236                 if (g_strcasecmp("ids", child->name) == 0) {
     236                if (g_ascii_strcasecmp("ids", child->name) == 0) {
    237237                        struct xt_node *idc;
    238238                        for (idc = child->children; idc; idc = idc->next)
    239                                 if (g_strcasecmp(idc->name, "id") == 0)
     239                                if (g_ascii_strcasecmp(idc->name, "id") == 0)
    240240                                        txl->list = g_slist_prepend(txl->list,
    241241                                                g_memdup(idc->text, idc->text_len + 1));
    242                 } else if (g_strcasecmp("next_cursor", child->name) == 0) {
     242                } else if (g_ascii_strcasecmp("next_cursor", child->name) == 0) {
    243243                        twitter_xt_next_cursor(child, txl);
    244244                }
    245245        }
     
    284284        }
    285285
    286286        /* Create the room now that we "logged in". */
    287         if (!td->timeline_gc && g_strcasecmp(set_getstr(&ic->acc->set, "mode"), "chat") == 0)
     287        if (!td->timeline_gc && g_ascii_strcasecmp(set_getstr(&ic->acc->set, "mode"), "chat") == 0)
    288288                twitter_groupchat_init(ic);
    289289
    290290        txl = g_new0(struct twitter_xml_list, 1);
     
    407407
    408408        // Walk over the nodes children.
    409409        for (child = node->children; child; child = child->next) {
    410                 if (g_strcasecmp("name", child->name) == 0) {
     410                if (g_ascii_strcasecmp("name", child->name) == 0) {
    411411                        txu->name = g_memdup(child->text, child->text_len + 1);
    412                 } else if (g_strcasecmp("screen_name", child->name) == 0) {
     412                } else if (g_ascii_strcasecmp("screen_name", child->name) == 0) {
    413413                        txu->screen_name = g_memdup(child->text, child->text_len + 1);
    414414                }
    415415        }
     
    432432        // The root <users> node should hold the list of users <user>
    433433        // Walk over the nodes children.
    434434        for (child = node->children; child; child = child->next) {
    435                 if (g_strcasecmp("user", child->name) == 0) {
     435                if (g_ascii_strcasecmp("user", child->name) == 0) {
    436436                        txu = g_new0(struct twitter_xml_user, 1);
    437437                        twitter_xt_get_user(child, txu);
    438438                        // Put the item in the front of the list.
     
    463463
    464464        // Walk over the nodes children.
    465465        for (child = node->children; child; child = child->next) {
    466                 if (g_strcasecmp("text", child->name) == 0) {
     466                if (g_ascii_strcasecmp("text", child->name) == 0) {
    467467                        txs->text = g_memdup(child->text, child->text_len + 1);
    468                 } else if (g_strcasecmp("retweeted_status", child->name) == 0) {
     468                } else if (g_ascii_strcasecmp("retweeted_status", child->name) == 0) {
    469469                        rt = child;
    470                 } else if (g_strcasecmp("created_at", child->name) == 0) {
     470                } else if (g_ascii_strcasecmp("created_at", child->name) == 0) {
    471471                        struct tm parsed;
    472472
    473473                        /* Very sensitive to changes to the formatting of
     
    475475                           is UTC since C time handling functions suck. */
    476476                        if (strptime(child->text, TWITTER_TIME_FORMAT, &parsed) != NULL)
    477477                                txs->created_at = mktime_utc(&parsed);
    478                 } else if (g_strcasecmp("user", child->name) == 0) {
     478                } else if (g_ascii_strcasecmp("user", child->name) == 0) {
    479479                        txs->user = g_new0(struct twitter_xml_user, 1);
    480480                        twitter_xt_get_user(child, txs->user);
    481                 } else if (g_strcasecmp("id", child->name) == 0) {
     481                } else if (g_ascii_strcasecmp("id", child->name) == 0) {
    482482                        txs->id = g_ascii_strtoull(child->text, NULL, 10);
    483                 } else if (g_strcasecmp("in_reply_to_status_id", child->name) == 0) {
     483                } else if (g_ascii_strcasecmp("in_reply_to_status_id", child->name) == 0) {
    484484                        txs->reply_to = g_ascii_strtoull(child->text, NULL, 10);
    485485                }
    486486        }
     
    549549        // The root <statuses> node should hold the list of statuses <status>
    550550        // Walk over the nodes children.
    551551        for (child = node->children; child; child = child->next) {
    552                 if (g_strcasecmp("status", child->name) == 0) {
     552                if (g_ascii_strcasecmp("status", child->name) == 0) {
    553553                        txs = g_new0(struct twitter_xml_status, 1);
    554554                        twitter_xt_get_status(child, txs);
    555555                        // Put the item in the front of the list.
     
    564564                                        tud->last_time = txs->created_at;
    565565                                }
    566566                        }
    567                 } else if (g_strcasecmp("next_cursor", child->name) == 0) {
     567                } else if (g_ascii_strcasecmp("next_cursor", child->name) == 0) {
    568568                        twitter_xt_next_cursor(child, txl);
    569569                }
    570570        }
     
    659659                msg = twitter_msg_add_id(ic, status, "");
    660660
    661661                // Say it!
    662                 if (g_strcasecmp(td->user, status->user->screen_name) == 0) {
     662                if (g_ascii_strcasecmp(td->user, status->user->screen_name) == 0) {
    663663                        imcb_chat_log(gc, "You: %s", msg ? msg : status->text);
    664664                } else {
    665665                        twitter_add_buddy(ic, status->user->screen_name, status->user->name);
     
    688688        gboolean mode_one;
    689689        guint64 last_id = 0;
    690690
    691         mode_one = g_strcasecmp(set_getstr(&ic->acc->set, "mode"), "one") == 0;
     691        mode_one = g_ascii_strcasecmp(set_getstr(&ic->acc->set, "mode"), "one") == 0;
    692692
    693693        if (mode_one) {
    694694                g_snprintf(from, sizeof(from) - 1, "%s_%s", td->prefix, ic->acc->user);
     
    789789        }
    790790
    791791        // See if the user wants to see the messages in a groupchat window or as private messages.
    792         if (g_strcasecmp(set_getstr(&ic->acc->set, "mode"), "chat") == 0)
     792        if (g_ascii_strcasecmp(set_getstr(&ic->acc->set, "mode"), "chat") == 0)
    793793                twitter_groupchat(ic, output);
    794794        else
    795795                twitter_private_message_chat(ic, output);
  • protocols/yahoo/yahoo.c

    === modified file 'protocols/yahoo/yahoo.c'
     
    7373        /* This should get rid of the markup noise at the beginning of the string. */
    7474        while( *in )
    7575        {
    76                 if( g_strncasecmp( in, "<font", 5 ) == 0 ||
    77                     g_strncasecmp( in, "<fade", 5 ) == 0 ||
    78                     g_strncasecmp( in, "<alt", 4 ) == 0 )
     76                if( g_ascii_strncasecmp( in, "<font", 5 ) == 0 ||
     77                    g_ascii_strncasecmp( in, "<fade", 5 ) == 0 ||
     78                    g_ascii_strncasecmp( in, "<alt", 4 ) == 0 )
    7979                {
    8080                        char *s = strchr( in, '>' );
    8181                        if( !s )
     
    142142        yd->logged_in = FALSE;
    143143        yd->current_status = YAHOO_STATUS_AVAILABLE;
    144144       
    145         if( ( s = strchr( acc->user, '@' ) ) && g_strcasecmp( s, "@yahoo.com" ) == 0 )
     145        if( ( s = strchr( acc->user, '@' ) ) && g_ascii_strcasecmp( s, "@yahoo.com" ) == 0 )
    146146                imcb_error( ic, "Your Yahoo! username should just be a username. "
    147147                                "Do not include any @domain part." );
    148148       
     
    208208        {
    209209                /* Use these states only if msg doesn't contain additional
    210210                   info since away messages are only supported with CUSTOM. */
    211                 if( g_strcasecmp( state, "Be Right Back" ) == 0 )
     211                if( g_ascii_strcasecmp( state, "Be Right Back" ) == 0 )
    212212                        yd->current_status = YAHOO_STATUS_BRB;
    213                 else if( g_strcasecmp( state, "Busy" ) == 0 )
     213                else if( g_ascii_strcasecmp( state, "Busy" ) == 0 )
    214214                        yd->current_status = YAHOO_STATUS_BUSY;
    215                 else if( g_strcasecmp( state, "Not At Home" ) == 0 )
     215                else if( g_ascii_strcasecmp( state, "Not At Home" ) == 0 )
    216216                        yd->current_status = YAHOO_STATUS_NOTATHOME;
    217                 else if( g_strcasecmp( state, "Not At Desk" ) == 0 )
     217                else if( g_ascii_strcasecmp( state, "Not At Desk" ) == 0 )
    218218                        yd->current_status = YAHOO_STATUS_NOTATDESK;
    219                 else if( g_strcasecmp( state, "Not In Office" ) == 0 )
     219                else if( g_ascii_strcasecmp( state, "Not In Office" ) == 0 )
    220220                        yd->current_status = YAHOO_STATUS_NOTINOFFICE;
    221                 else if( g_strcasecmp( state, "On Phone" ) == 0 )
     221                else if( g_ascii_strcasecmp( state, "On Phone" ) == 0 )
    222222                        yd->current_status = YAHOO_STATUS_ONPHONE;
    223                 else if( g_strcasecmp( state, "On Vacation" ) == 0 )
     223                else if( g_ascii_strcasecmp( state, "On Vacation" ) == 0 )
    224224                        yd->current_status = YAHOO_STATUS_ONVACATION;
    225                 else if( g_strcasecmp( state, "Out To Lunch" ) == 0 )
     225                else if( g_ascii_strcasecmp( state, "Out To Lunch" ) == 0 )
    226226                        yd->current_status = YAHOO_STATUS_OUTTOLUNCH;
    227                 else if( g_strcasecmp( state, "Stepped Out" ) == 0 )
     227                else if( g_ascii_strcasecmp( state, "Stepped Out" ) == 0 )
    228228                        yd->current_status = YAHOO_STATUS_STEPPEDOUT;
    229                 else if( g_strcasecmp( state, "Invisible" ) == 0 )
     229                else if( g_ascii_strcasecmp( state, "Invisible" ) == 0 )
    230230                        yd->current_status = YAHOO_STATUS_INVISIBLE;
    231231                else
    232232                        yd->current_status = YAHOO_STATUS_CUSTOM;
     
    286286                {
    287287                        struct byahoo_buddygroups *bg = bgl->data;
    288288                       
    289                         if( g_strcasecmp( bg->buddy, who ) == 0 &&
    290                             g_strcasecmp( bg->group, bu->group->name ) == 0 )
     289                        if( g_ascii_strcasecmp( bg->buddy, who ) == 0 &&
     290                            g_ascii_strcasecmp( bg->group, bu->group->name ) == 0 )
    291291                        {
    292292                                g_free( bg->group );
    293293                                bg->group = g_strdup( group );
     
    309309        {
    310310                struct byahoo_buddygroups *bg = bgl->data;
    311311               
    312                 if( g_strcasecmp( bg->buddy, who ) == 0 )
     312                if( g_ascii_strcasecmp( bg->buddy, who ) == 0 )
    313313                        yahoo_remove_buddy( yd->y2_id, who, bg->group );
    314314        }
    315315}
     
    398398        ret->chat_leave = byahoo_chat_leave;
    399399        ret->chat_with = byahoo_chat_with;
    400400
    401         ret->handle_cmp = g_strcasecmp;
     401        ret->handle_cmp = g_ascii_strcasecmp;
    402402       
    403403        ret->auth_allow = byahoo_auth_allow;
    404404        ret->auth_deny = byahoo_auth_deny;
     
    865865        char txt[1024];
    866866        YList *m;
    867867       
    868         if( g_strcasecmp( who, ic->acc->user ) == 0 )
     868        if( g_ascii_strcasecmp( who, ic->acc->user ) == 0 )
    869869                /* WTF, Yahoo! seems to echo these now? */
    870870                return;
    871871       
     
    879879        inv->ic = ic;
    880880       
    881881        for( m = members; m; m = m->next )
    882                 if( g_strcasecmp( m->data, ic->acc->user ) != 0 )
     882                if( g_ascii_strcasecmp( m->data, ic->acc->user ) != 0 )
    883883                        imcb_chat_add_buddy( inv->c, m->data );
    884884       
    885885        g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", room, who, msg );
  • query.c

    === modified file 'query.c'
     
    6565                irc->queries = q;
    6666        }
    6767       
    68         if( g_strcasecmp( set_getstr( &irc->b->set, "query_order" ), "lifo" ) == 0 || irc->queries == q )
     68        if( g_ascii_strcasecmp( set_getstr( &irc->b->set, "query_order" ), "lifo" ) == 0 || irc->queries == q )
    6969                query_display( irc, q );
    7070       
    7171        return( q );
     
    186186{
    187187        query_t *q;
    188188       
    189         if( g_strcasecmp( set_getstr( &irc->b->set, "query_order" ), "fifo" ) == 0 )
     189        if( g_ascii_strcasecmp( set_getstr( &irc->b->set, "query_order" ), "fifo" ) == 0 )
    190190                q = irc->queries;
    191191        else
    192192                for( q = irc->queries; q && q->next; q = q->next );
  • root_commands.c

    === modified file 'root_commands.c'
     
    5555       
    5656        len = strlen( cmd[0] );
    5757        for( i = 0; root_commands[i].command; i++ )
    58                 if( g_strncasecmp( root_commands[i].command, cmd[0], len ) == 0 )
     58                if( g_ascii_strncasecmp( root_commands[i].command, cmd[0], len ) == 0 )
    5959                {
    6060                        if( root_commands[i+1].command &&
    61                             g_strncasecmp( root_commands[i+1].command, cmd[0], len ) == 0 )
     61                            g_ascii_strncasecmp( root_commands[i+1].command, cmd[0], len ) == 0 )
    6262                                /* Only match on the first letters if the match is unique. */
    6363                                break;
    6464                       
     
    315315        char *set_name = NULL, *value = NULL;
    316316        gboolean del = FALSE;
    317317       
    318         if( cmd[1] && g_strncasecmp( cmd[1], "-del", 4 ) == 0 )
     318        if( cmd[1] && g_ascii_strncasecmp( cmd[1], "-del", 4 ) == 0 )
    319319        {
    320320                MIN_ARGS( 2, 0 );
    321321                set_name = cmd[2];
     
    405405       
    406406        len = strlen( cmd[1] );
    407407       
    408         if( len >= 1 && g_strncasecmp( cmd[1], "add", len ) == 0 )
     408        if( len >= 1 && g_ascii_strncasecmp( cmd[1], "add", len ) == 0 )
    409409        {
    410410                struct prpl *prpl;
    411411               
     
    470470               
    471471                return;
    472472        }
    473         else if( len >= 1 && g_strncasecmp( cmd[1], "list", len ) == 0 )
     473        else if( len >= 1 && g_ascii_strncasecmp( cmd[1], "list", len ) == 0 )
    474474        {
    475475                int i = 0;
    476476               
     
    502502        {
    503503                /* Try the following two only if cmd[2] == NULL */
    504504        }
    505         else if( len >= 2 && g_strncasecmp( cmd[1], "on", len ) == 0 )
     505        else if( len >= 2 && g_ascii_strncasecmp( cmd[1], "on", len ) == 0 )
    506506        {
    507507                if ( irc->b->accounts )
    508508                {
     
    525525               
    526526                return;
    527527        }
    528         else if( len >= 2 && g_strncasecmp( cmd[1], "off", len ) == 0 )
     528        else if( len >= 2 && g_ascii_strncasecmp( cmd[1], "off", len ) == 0 )
    529529        {
    530530                irc_rootmsg( irc, "Deactivating all active (re)connections..." );
    531531               
     
    546546        /* At least right now, don't accept on/off/set/del as account IDs even
    547547           if they're a proper match, since people not familiar with the new
    548548           syntax yet may get a confusing/nasty surprise. */
    549         if( g_strcasecmp( cmd[1], "on" ) == 0 ||
    550             g_strcasecmp( cmd[1], "off" ) == 0 ||
    551             g_strcasecmp( cmd[1], "set" ) == 0 ||
    552             g_strcasecmp( cmd[1], "del" ) == 0 ||
     549        if( g_ascii_strcasecmp( cmd[1], "on" ) == 0 ||
     550            g_ascii_strcasecmp( cmd[1], "off" ) == 0 ||
     551            g_ascii_strcasecmp( cmd[1], "set" ) == 0 ||
     552            g_ascii_strcasecmp( cmd[1], "del" ) == 0 ||
    553553            ( a = account_get( irc->b, cmd[1] ) ) == NULL )
    554554        {
    555555                irc_rootmsg( irc, "Could not find account `%s'. Note that the syntax "
     
    558558                return;
    559559        }
    560560       
    561         if( len >= 1 && g_strncasecmp( cmd[2], "del", len ) == 0 )
     561        if( len >= 1 && g_ascii_strncasecmp( cmd[2], "del", len ) == 0 )
    562562        {
    563563                if( a->ic )
    564564                {
     
    570570                        irc_rootmsg( irc, "Account deleted" );
    571571                }
    572572        }
    573         else if( len >= 2 && g_strncasecmp( cmd[2], "on", len ) == 0 )
     573        else if( len >= 2 && g_ascii_strncasecmp( cmd[2], "on", len ) == 0 )
    574574        {
    575575                if( a->ic )
    576576                        irc_rootmsg( irc, "Account already online" );
     
    580580                else
    581581                        account_on( irc->b, a );
    582582        }
    583         else if( len >= 2 && g_strncasecmp( cmd[2], "off", len ) == 0 )
     583        else if( len >= 2 && g_ascii_strncasecmp( cmd[2], "off", len ) == 0 )
    584584        {
    585585                if( a->ic )
    586586                {
     
    596596                        irc_rootmsg( irc, "Account already offline" );
    597597                }
    598598        }
    599         else if( len >= 1 && g_strncasecmp( cmd[2], "set", len ) == 0 )
     599        else if( len >= 1 && g_ascii_strncasecmp( cmd[2], "set", len ) == 0 )
    600600        {
    601601                cmd_set_real( irc, cmd + 2, &a->set, cmd_account_set_checkflags );
    602602        }
     
    613613       
    614614        len = strlen( cmd[1] );
    615615       
    616         if( len >= 1 && g_strncasecmp( cmd[1], "list", len ) == 0 )
     616        if( len >= 1 && g_ascii_strncasecmp( cmd[1], "list", len ) == 0 )
    617617        {
    618618                GSList *l;
    619619                int i = 0;
     
    642642                   syntax (only works when used inside a channel). */
    643643                if( ( ic = irc->root->last_channel ) &&
    644644                    ( len = strlen( cmd[1] ) ) &&
    645                     g_strncasecmp( cmd[1], "set", len ) == 0 )
     645                    g_ascii_strncasecmp( cmd[1], "set", len ) == 0 )
    646646                        cmd_set_real( irc, cmd + 1, &ic->set, NULL );
    647647                else
    648648                        irc_rootmsg( irc, "Could not find channel `%s'", cmd[1] );
     
    653653        MIN_ARGS( 2 );
    654654        len = strlen( cmd[2] );
    655655       
    656         if( len >= 1 && g_strncasecmp( cmd[2], "set", len ) == 0 )
     656        if( len >= 1 && g_ascii_strncasecmp( cmd[2], "set", len ) == 0 )
    657657        {
    658658                cmd_set_real( irc, cmd + 2, &ic->set, NULL );
    659659        }
    660         else if( len >= 1 && g_strncasecmp( cmd[2], "del", len ) == 0 )
     660        else if( len >= 1 && g_ascii_strncasecmp( cmd[2], "del", len ) == 0 )
    661661        {
    662662                if( !( ic->flags & IRC_CHANNEL_JOINED ) &&
    663663                    ic != ic->irc->default_channel )
     
    681681        account_t *a;
    682682        int add_on_server = 1;
    683683       
    684         if( g_strcasecmp( cmd[1], "-tmp" ) == 0 )
     684        if( g_ascii_strcasecmp( cmd[1], "-tmp" ) == 0 )
    685685        {
    686686                MIN_ARGS( 3 );
    687687                add_on_server = 0;
     
    812812static void cmd_rename( irc_t *irc, char **cmd )
    813813{
    814814        irc_user_t *iu, *old;
    815         gboolean del = g_strcasecmp( cmd[1], "-del" ) == 0;
     815        gboolean del = g_ascii_strcasecmp( cmd[1], "-del" ) == 0;
    816816       
    817817        iu = irc_user_by_name( irc, cmd[del ? 2 : 1] );
    818818       
     
    10581058                }
    10591059        }
    10601060       
    1061         if( g_strcasecmp( cmd[0], "yes" ) == 0 )
     1061        if( g_ascii_strcasecmp( cmd[0], "yes" ) == 0 )
    10621062                query_answer( irc, q, 1 );
    1063         else if( g_strcasecmp( cmd[0], "no" ) == 0 )
     1063        else if( g_ascii_strcasecmp( cmd[0], "no" ) == 0 )
    10641064                query_answer( irc, q, 0 );
    10651065}
    10661066
     
    10771077        char *format;
    10781078        int n_online = 0, n_away = 0, n_offline = 0;
    10791079       
    1080         if( cmd[1] && g_strcasecmp( cmd[1], "all" ) == 0 )
     1080        if( cmd[1] && g_ascii_strcasecmp( cmd[1], "all" ) == 0 )
    10811081                online = offline = away = 1;
    1082         else if( cmd[1] && g_strcasecmp( cmd[1], "offline" ) == 0 )
     1082        else if( cmd[1] && g_ascii_strcasecmp( cmd[1], "offline" ) == 0 )
    10831083                offline = 1;
    1084         else if( cmd[1] && g_strcasecmp( cmd[1], "away" ) == 0 )
     1084        else if( cmd[1] && g_ascii_strcasecmp( cmd[1], "away" ) == 0 )
    10851085                away = 1;
    1086         else if( cmd[1] && g_strcasecmp( cmd[1], "online" ) == 0 )
     1086        else if( cmd[1] && g_ascii_strcasecmp( cmd[1], "online" ) == 0 )
    10871087                online = 1;
    10881088        else
    10891089                online = away = 1;
     
    11831183{
    11841184        account_t *acc;
    11851185       
    1186         if( g_strcasecmp( cmd[1], "add" ) == 0 )
     1186        if( g_ascii_strcasecmp( cmd[1], "add" ) == 0 )
    11871187        {
    11881188                char *channel, *s;
    11891189                struct irc_channel *ic;
     
    12381238                }
    12391239                g_free( channel );
    12401240        }
    1241         else if( g_strcasecmp( cmd[1], "with" ) == 0 )
     1241        else if( g_ascii_strcasecmp( cmd[1], "with" ) == 0 )
    12421242        {
    12431243                irc_user_t *iu;
    12441244               
     
    12581258                        irc_rootmsg( irc, "Can't open a groupchat with %s.", cmd[2] );
    12591259                }
    12601260        }
    1261         else if( g_strcasecmp( cmd[1], "list" ) == 0 ||
    1262                  g_strcasecmp( cmd[1], "set" ) == 0 ||
    1263                  g_strcasecmp( cmd[1], "del" ) == 0 )
     1261        else if( g_ascii_strcasecmp( cmd[1], "list" ) == 0 ||
     1262                 g_ascii_strcasecmp( cmd[1], "set" ) == 0 ||
     1263                 g_ascii_strcasecmp( cmd[1], "del" ) == 0 )
    12641264        {
    12651265                irc_rootmsg( irc, "Warning: The \002chat\002 command was mostly replaced with the \002channel\002 command." );
    12661266                cmd_channel( irc, cmd );
     
    12771277        int len;
    12781278       
    12791279        len = strlen( cmd[1] );
    1280         if( g_strncasecmp( cmd[1], "list", len ) == 0 )
     1280        if( g_ascii_strncasecmp( cmd[1], "list", len ) == 0 )
    12811281        {
    12821282                int n = 0;
    12831283               
     
    14361436       
    14371437        for( i = 0; root_commands[i].command; i++ )
    14381438        {
    1439                 if( g_strcasecmp( root_commands[i].command, command ) == 0 )
     1439                if( g_ascii_strcasecmp( root_commands[i].command, command ) == 0 )
    14401440                        return FALSE;
    1441                 else if( g_strcasecmp( root_commands[i].command, command ) > 0 )
     1441                else if( g_ascii_strcasecmp( root_commands[i].command, command ) > 0 )
    14421442                        break;
    14431443        }
    14441444        memmove( root_commands + i + 1, root_commands + i,
  • set.c

    === modified file 'set.c'
     
    6868       
    6969        while( s )
    7070        {
    71                 if( g_strcasecmp( s->key, key ) == 0 ||
    72                     ( s->old_key && g_strcasecmp( s->old_key, key ) == 0 ) )
     71                if( g_ascii_strcasecmp( s->key, key ) == 0 ||
     72                    ( s->old_key && g_ascii_strcasecmp( s->old_key, key ) == 0 ) )
    7373                        break;
    7474                s = s->next;
    7575        }
     
    172172       
    173173        while( s )
    174174        {
    175                 if( g_strcasecmp( s->key, key ) == 0 )
     175                if( g_ascii_strcasecmp( s->key, key ) == 0 )
    176176                        break;
    177177                s = (t=s)->next;
    178178        }
  • storage_xml.c

    === modified file 'storage_xml.c'
     
    6666        int i;
    6767       
    6868        for( i = 0; attr_names[i]; i ++ )
    69                 if( g_strcasecmp( attr_names[i], key ) == 0 )
     69                if( g_ascii_strcasecmp( attr_names[i], key ) == 0 )
    7070                        return (char*) attr_values[i];
    7171       
    7272        return NULL;
     
    9090        {
    9191                xd->unknown_tag ++;
    9292        }
    93         else if( g_strcasecmp( element_name, "user" ) == 0 )
     93        else if( g_ascii_strcasecmp( element_name, "user" ) == 0 )
    9494        {
    9595                char *nick = xml_attr( attr_names, attr_values, "nick" );
    9696                char *pass = xml_attr( attr_names, attr_values, "password" );
     
    124124                /* Let's not parse anything else if we only have to check
    125125                   the password. */
    126126        }
    127         else if( g_strcasecmp( element_name, "account" ) == 0 )
     127        else if( g_ascii_strcasecmp( element_name, "account" ) == 0 )
    128128        {
    129129                char *protocol, *handle, *server, *password = NULL, *autoconnect, *tag;
    130130                char *pass_b64 = NULL;
     
    170170                g_free( pass_cr );
    171171                g_free( password );
    172172        }
    173         else if( g_strcasecmp( element_name, "setting" ) == 0 )
     173        else if( g_ascii_strcasecmp( element_name, "setting" ) == 0 )
    174174        {
    175175                char *setting;
    176176               
     
    195195                        g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
    196196                                     "Missing attributes for %s element", element_name );
    197197        }
    198         else if( g_strcasecmp( element_name, "buddy" ) == 0 )
     198        else if( g_ascii_strcasecmp( element_name, "buddy" ) == 0 )
    199199        {
    200200                char *handle, *nick;
    201201               
     
    212212                                     "Missing attributes for %s element", element_name );
    213213                }
    214214        }
    215         else if( g_strcasecmp( element_name, "channel" ) == 0 )
     215        else if( g_ascii_strcasecmp( element_name, "channel" ) == 0 )
    216216        {
    217217                char *name, *type;
    218218               
     
    236236        }
    237237        /* Backward compatibility: Keep this around for a while for people
    238238           switching from BitlBee 1.2.4+. */
    239         else if( g_strcasecmp( element_name, "chat" ) == 0 )
     239        else if( g_ascii_strcasecmp( element_name, "chat" ) == 0 )
    240240        {
    241241                char *handle, *channel;
    242242               
     
    287287        {
    288288                xd->unknown_tag --;
    289289        }
    290         else if( g_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting )
     290        else if( g_ascii_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting )
    291291        {
    292292                g_free( xd->current_setting );
    293293                xd->current_setting = NULL;
    294294        }
    295         else if( g_strcasecmp( element_name, "account" ) == 0 )
     295        else if( g_ascii_strcasecmp( element_name, "account" ) == 0 )
    296296        {
    297297                xd->current_account = NULL;
    298298        }
    299         else if( g_strcasecmp( element_name, "channel" ) == 0 ||
    300                  g_strcasecmp( element_name, "chat" ) == 0 )
     299        else if( g_ascii_strcasecmp( element_name, "channel" ) == 0 ||
     300                 g_ascii_strcasecmp( element_name, "chat" ) == 0 )
    301301        {
    302302                xd->current_channel = NULL;
    303303        }
     
    317317                   the password, or if we didn't get the chance to check it
    318318                   yet. */
    319319        }
    320         else if( g_strcasecmp( g_markup_parse_context_get_element( ctx ), "setting" ) == 0 && xd->current_setting )
     320        else if( g_ascii_strcasecmp( g_markup_parse_context_get_element( ctx ), "setting" ) == 0 && xd->current_setting )
    321321        {
    322322                if( xd->current_account )
    323323                {