# HG changeset patch # User Mikael Berthe # Date 1270299573 -7200 # Node ID a98004eb58cdce36a19b85250b3338c89fbe0e55 # Parent 81cbb47f1aa6803a281276078e23c4dd7be8c08c [extsay] Expand extsay_script_path path name diff -r 81cbb47f1aa6 -r a98004eb58cd extsay-ng/extsayng.c --- a/extsay-ng/extsayng.c Sat Apr 03 12:19:14 2010 +0200 +++ b/extsay-ng/extsayng.c Sat Apr 03 14:59:33 2010 +0200 @@ -27,6 +27,7 @@ #include #include #include +#include #include static void extsayng_init(void); @@ -51,18 +52,20 @@ GError *err = NULL; gchar *argv[] = { "screen", "-r", "-X", "screen", NULL, NULL, NULL, NULL, NULL }; - gboolean ret; gchar strwinheight[32]; - gboolean winsplit = settings_opt_get_int("extsay_split_win"); + gchar *fpath; + gboolean winsplit, ret; // screen -r -X screen $path/extsay.sh [jid [winsplit [height]]] - argv[4] = (gchar*)settings_opt_get("extsay_script_path"); + fpath = (gchar*)settings_opt_get("extsay_script_path"); // Helper script path - if (!argv[4] || !argv[4][0]) { + if (!fpath || !fpath[0]) { scr_log_print(LPRINT_NORMAL, "Please set option 'extsay_script_path'."); return; } + fpath = expand_filename(fpath); + argv[4] = fpath; // Helper script parameter #1 if (args && *args) @@ -70,7 +73,8 @@ else argv[5] = "."; - // Update environment variables for the helper script + // Update parameters for the helper script + winsplit = settings_opt_get_int("extsay_split_win"); if (winsplit) { gint winheight = settings_opt_get_int("extsay_win_height"); argv[6] = "winsplit"; // Helper script parameter #2 @@ -87,6 +91,8 @@ if (!ret) scr_LogPrint(LPRINT_NORMAL, err->message); + + g_free(fpath); } static void do_extsayng(gchar *args)