summary refs log tree commit diff stats
path: root/plugins/tcl
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-07-21 19:16:31 +0200
committerBerke Viktor <bviktor@hexchat.org>2012-07-21 19:16:31 +0200
commit2b3e1f46e36ee0726dcf9d55593cadab9d42fcb1 (patch)
tree64549cbaf816a1d17e303b284ab8ead97290d2c1 /plugins/tcl
parent9ea3ac9ddd66e7c85c9a066770da5e7a0ed9c598 (diff)
Use <configdir>/scripts to (auto)load Lua/Perl/Python/Tcl scripts
Diffstat (limited to 'plugins/tcl')
-rw-r--r--plugins/tcl/tclplugin.c6
1 files changed, 4 insertions, 2 deletions
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]));
             }
         }