| 1433 return gaim_log_common_lister(GAIM_LOG_SYSTEM, ".system", account, ".txt", txt_logger); |
1435 return gaim_log_common_lister(GAIM_LOG_SYSTEM, ".system", account, ".txt", txt_logger); |
| 1434 } |
1436 } |
| 1435 |
1437 |
| 1436 static char *txt_logger_read(GaimLog *log, GaimLogReadFlags *flags) |
1438 static char *txt_logger_read(GaimLog *log, GaimLogReadFlags *flags) |
| 1437 { |
1439 { |
| 1438 char *read, *minus_header, *minus_header2; |
1440 char *read, *minus_header; |
| 1439 GaimLogCommonLoggerData *data = log->logger_data; |
1441 GaimLogCommonLoggerData *data = log->logger_data; |
| 1440 *flags = 0; |
1442 *flags = 0; |
| 1441 if (!data || !data->path) |
1443 if (!data || !data->path) |
| 1442 return g_strdup(_("<font color=\"red\"><b>Unable to find log path!</b></font>")); |
1444 return g_strdup(_("<font color=\"red\"><b>Unable to find log path!</b></font>")); |
| 1443 if (g_file_get_contents(data->path, &read, NULL, NULL)) { |
1445 if (g_file_get_contents(data->path, &read, NULL, NULL)) { |
| 1743 |
1745 |
| 1744 static char * old_logger_read (GaimLog *log, GaimLogReadFlags *flags) |
1746 static char * old_logger_read (GaimLog *log, GaimLogReadFlags *flags) |
| 1745 { |
1747 { |
| 1746 struct old_logger_data *data = log->logger_data; |
1748 struct old_logger_data *data = log->logger_data; |
| 1747 FILE *file = g_fopen(gaim_stringref_value(data->pathref), "rb"); |
1749 FILE *file = g_fopen(gaim_stringref_value(data->pathref), "rb"); |
| 1748 char *tmp, *read = g_malloc(data->length + 1); |
1750 char *read = g_malloc(data->length + 1); |
| 1749 fseek(file, data->offset, SEEK_SET); |
1751 fseek(file, data->offset, SEEK_SET); |
| 1750 fread(read, data->length, 1, file); |
1752 fread(read, data->length, 1, file); |
| 1751 fclose(file); |
1753 fclose(file); |
| 1752 read[data->length] = '\0'; |
1754 read[data->length] = '\0'; |
| 1753 *flags = 0; |
1755 *flags = 0; |