comparison mcabber/src/hooks.c @ 1167:9726c78a91f3

Allow '~' (HOME directory) in config options
author Mikael Berthe <mikael@lilotux.net>
date Sun, 18 Feb 2007 11:03:49 +0100
parents 1a109ebf3f24
children ef40688d87bd
comparison
equal deleted inserted replaced
1166:c4da23bf8958 1167:9726c78a91f3
303 if (extcmd) { 303 if (extcmd) {
304 g_free(extcmd); 304 g_free(extcmd);
305 extcmd = NULL; 305 extcmd = NULL;
306 } 306 }
307 if (command) 307 if (command)
308 extcmd = g_strdup(command); 308 extcmd = expand_filename(command);
309 } 309 }
310 310
311 // hk_ext_cmd() 311 // hk_ext_cmd()
312 // Launch an external command (process) for the given event. 312 // Launch an external command (process) for the given event.
313 // For now, data should be NULL. 313 // For now, data should be NULL.
350 if (!arg_type || !arg_info) return; 350 if (!arg_type || !arg_info) return;
351 351
352 if (strchr("MG", type) && data && settings_opt_get_int("event_log_files")) { 352 if (strchr("MG", type) && data && settings_opt_get_int("event_log_files")) {
353 int fd; 353 int fd;
354 const char *prefix; 354 const char *prefix;
355 char *prefix_xp = NULL;
355 char *data_locale; 356 char *data_locale;
356 357
357 data_locale = from_utf8(data); 358 data_locale = from_utf8(data);
358 prefix = settings_opt_get("event_log_dir"); 359 prefix = settings_opt_get("event_log_dir");
359 if (!prefix) 360 if (prefix)
361 prefix = prefix_xp = expand_filename(prefix);
362 else
360 prefix = ut_get_tmpdir(); 363 prefix = ut_get_tmpdir();
361 datafname = g_strdup_printf("%s/mcabber-%d.XXXXXX", prefix, getpid()); 364 datafname = g_strdup_printf("%s/mcabber-%d.XXXXXX", prefix, getpid());
365 g_free(prefix_xp);
362 366
363 // XXX Some old systems may require us to set umask first. 367 // XXX Some old systems may require us to set umask first.
364 fd = mkstemp(datafname); 368 fd = mkstemp(datafname);
365 if (fd == -1) { 369 if (fd == -1) {
366 g_free(datafname); 370 g_free(datafname);