Changes in storage_xml.c [542e44a:c351434]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
r542e44a rc351434 60 60 char *given_pass; 61 61 xml_pass_st pass_st; 62 int unknown_tag; 62 63 }; 63 64 … … 87 88 irc_t *irc = xd->irc; 88 89 89 if( g_strcasecmp( element_name, "user" ) == 0 ) 90 if( xd->unknown_tag > 0 ) 91 { 92 xd->unknown_tag ++; 93 } 94 else if( g_strcasecmp( element_name, "user" ) == 0 ) 90 95 { 91 96 char *nick = xml_attr( attr_names, attr_values, "nick" ); … … 225 230 else 226 231 { 232 xd->unknown_tag ++; 233 irc_usermsg( irc, "Warning: Unknown XML tag found in configuration file (%s). " 234 "This may happen when downgrading BitlBee versions. " 235 "This tag will be skipped and the information will be lost " 236 "once you save your settings.", element_name ); 237 /* 227 238 g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, 228 239 "Unkown element: %s", element_name ); 240 */ 229 241 } 230 242 } … … 234 246 struct xml_parsedata *xd = data; 235 247 236 if( g_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting ) 248 if( xd->unknown_tag > 0 ) 249 { 250 xd->unknown_tag --; 251 } 252 else if( g_strcasecmp( element_name, "setting" ) == 0 && xd->current_setting ) 237 253 { 238 254 g_free( xd->current_setting ); … … 404 420 return STORAGE_ALREADY_EXISTS; 405 421 406 strcat( path, " ~" );407 if( ( fd = open( path, O_WRONLY | O_CREAT | O_TRUNC, 0600) ) < 0 )422 strcat( path, ".XXXXXX" ); 423 if( ( fd = mkstemp( path ) ) < 0 ) 408 424 { 409 425 irc_usermsg( irc, "Error while opening configuration file." ); … … 499 515 close( fd ); 500 516 501 path2 = g_strndup( path, strlen( path ) - 1);517 path2 = g_strndup( path, strlen( path ) - 7 ); 502 518 if( rename( path, path2 ) != 0 ) 503 519 {
Note: See TracChangeset
for help on using the changeset viewer.