From 2b3e1f46e36ee0726dcf9d55593cadab9d42fcb1 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 21 Jul 2012 19:16:31 +0200 Subject: Use /scripts to (auto)load Lua/Perl/Python/Tcl scripts --- plugins/tcl/tclplugin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/tcl') diff --git a/plugins/tcl/tclplugin.c b/plugins/tcl/tclplugin.c index 30a0a1b5..168e0f54 100644 --- a/plugins/tcl/tclplugin.c +++ b/plugins/tcl/tclplugin.c @@ -89,8 +89,10 @@ static char unknown[] = { "}\n" }; +/* don't pollute the filesystem with script files, this only causes misuse of the folders + * only use ~/.config/hexchat/scripts/ and %APPDATA%\HexChat\scripts */ static char sourcedirs[] = { - "set files [lsort [glob -nocomplain -directory [xchatdir] \"*.tcl\"]]\n" + "set files [lsort [glob -nocomplain -directory [xchatdir] \"/scripts/*.tcl\"]]\n" "set init [lsearch -glob $files \"*/init.tcl\"]\n" "if { $init > 0 } {\n" "set initfile [lindex $files $init]\n" @@ -2037,7 +2039,7 @@ static int Command_Source(char *word[], char *word_eol[], void *userdata) } else { if (!strchr(word_eol[2], '/')) { Tcl_DStringAppend(&ds, xchatdir, strlen(xchatdir)); - Tcl_DStringAppend(&ds, "/", 1); + Tcl_DStringAppend(&ds, "/scripts/", 9); Tcl_DStringAppend(&ds, word_eol[2], strlen(word_eol[2])); } } -- cgit 1.4.1