comparison mcabber/src/histolog.c @ 727:1c3620668857

Expand tabs when reading history files
author Mikael Berthe <mikael@lilotux.net>
date Sun, 05 Mar 2006 22:29:14 +0100
parents ee03b56b93ee
children 39f67cade02c
comparison
equal deleted inserted replaced
726:51be2bc1a820 727:1c3620668857
31 #include "hbuf.h" 31 #include "hbuf.h"
32 #include "jabglue.h" 32 #include "jabglue.h"
33 #include "utils.h" 33 #include "utils.h"
34 #include "logprint.h" 34 #include "logprint.h"
35 #include "settings.h" 35 #include "settings.h"
36 #include "utils.h"
36 37
37 static guint UseFileLogging; 38 static guint UseFileLogging;
38 static guint FileLoadLogs; 39 static guint FileLoadLogs;
39 static char *RootDir; 40 static char *RootDir;
40 41
121 void hlog_read_history(const char *jid, GList **p_buddyhbuf, guint width) 122 void hlog_read_history(const char *jid, GList **p_buddyhbuf, guint width)
122 { 123 {
123 char *filename; 124 char *filename;
124 guchar type, info; 125 guchar type, info;
125 char *data, *tail; 126 char *data, *tail;
127 char *xtext;
126 time_t timestamp; 128 time_t timestamp;
127 guint prefix_flags; 129 guint prefix_flags;
128 guint len; 130 guint len;
129 FILE *fp; 131 FILE *fp;
130 struct stat bufstat; 132 struct stat bufstat;
215 if (type == 'M') { 217 if (type == 'M') {
216 if (info == 'S') 218 if (info == 'S')
217 prefix_flags = HBB_PREFIX_OUT; 219 prefix_flags = HBB_PREFIX_OUT;
218 else 220 else
219 prefix_flags = HBB_PREFIX_IN; 221 prefix_flags = HBB_PREFIX_IN;
220 hbuf_add_line(p_buddyhbuf, &data[26], timestamp, 222 xtext = ut_expand_tabs(&data[26]); // Expand tabs
221 prefix_flags, width); 223 hbuf_add_line(p_buddyhbuf, xtext, timestamp, prefix_flags, width);
224 if (xtext != &data[26])
225 g_free(xtext);
222 err = 0; 226 err = 0;
223 } 227 }
224 } 228 }
225 fclose(fp); 229 fclose(fp);
226 g_free(data); 230 g_free(data);