- while(fgets(buf,DIR_NAME_SIZE, fp) != NULL){
- if(!g_markup_parse_context_parse(context, buf, DIR_NAME_SIZE, &error)){
+ //while(fgets(buf,DIR_NAME_SIZE, fp) != NULL){
+ while(g_io_channel_read_line(iochan, &buf, &length, NULL, &error)
+ != G_IO_STATUS_EOF) {
+
+ if(error != NULL) {
+ g_warning("Can not read xml file: \n%s\n", error->message);
+ g_error_free(error);
+ }
+ if(!g_markup_parse_context_parse(context, buf, length, &error)){