Changeset 8661caa for storage_xml.c


Ignore:
Timestamp:
2008-08-04T14:45:24Z (16 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
87f525e
Parents:
4ac647d (diff), 718e05f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged in upstream r410.

Only conflict was the correction of jabber normalization which I had already done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    r4ac647d r8661caa  
    2929#include "arc.h"
    3030#include "md5.h"
     31#include <glib/gstdio.h>
     32
     33#if !GLIB_CHECK_VERSION(2,8,0)
     34/* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */
     35#define g_access access
     36#endif
    3137
    3238typedef enum
     
    243249static void xml_init( void )
    244250{
    245         if( access( global.conf->configdir, F_OK ) != 0 )
     251        if( g_access( global.conf->configdir, F_OK ) != 0 )
    246252                log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir );
    247         else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 )
     253        else if( g_access( global.conf->configdir, F_OK ) != 0 ||
     254                 g_access( global.conf->configdir, W_OK ) != 0 )
    248255                log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir );
    249256}
     
    372379        g_free( path2 );
    373380       
    374         if( !overwrite && access( path, F_OK ) != -1 )
     381        if( !overwrite && g_access( path, F_OK ) == 0 )
    375382                return STORAGE_ALREADY_EXISTS;
    376383       
     
    480487static storage_status_t xml_remove( const char *nick, const char *password )
    481488{
    482         char s[512];
     489        char s[512], *lc;
    483490        storage_status_t status;
    484491
     
    487494                return status;
    488495
    489         g_snprintf( s, 511, "%s%s%s", global.conf->configdir, nick, ".xml" );
     496        lc = g_strdup( nick );
     497        nick_lc( lc );
     498        g_snprintf( s, 511, "%s%s%s", global.conf->configdir, lc, ".xml" );
     499        g_free( lc );
     500       
    490501        if( unlink( s ) == -1 )
    491502                return STORAGE_OTHER_ERROR;
Note: See TracChangeset for help on using the changeset viewer.