summary refs log tree commit diff stats
path: root/plugins/lua
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2012-11-03 10:24:25 -0700
committerArnavion <arnavion@gmail.com>2012-11-03 19:04:02 -0700
commit5d9264aff6d7bcdd2f0595bfdf2a3a7a23330d46 (patch)
tree17765368da40d67405ec22c0e1d608f706fbe055 /plugins/lua
parente0b1724158d44370d34d108a5f07fe0b36e4e254 (diff)
Initial commit for utf8 everywhere.
Diffstat (limited to 'plugins/lua')
-rw-r--r--plugins/lua/lua.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c
index fb624e47..fd3926f5 100644
--- a/plugins/lua/lua.c
+++ b/plugins/lua/lua.c
@@ -429,7 +429,7 @@ lxc_autoload_from_path(const char *path)
 						strerror(errno));
 					break;
 				}
-				sprintf(file, "%s/%s", path, ent->d_name);
+				sprintf(file, "%s" G_DIR_SEPARATOR_S "%s", path, ent->d_name);
 				(void)lxc_load_file((const char *)file);
 				free(file);
 			}
@@ -510,22 +510,19 @@ static int lxc_cb_load(char *word[], char *word_eol[], void *userdata)
 
  	len = strlen(word[2]);
 	if (len > 4 && strcasecmp (".lua", word[2] + len - 4) == 0) {
-#ifdef WIN32
-		if (strrchr(word[2], '\\') != NULL)
-#else
-		if (strrchr(word[2], '/') != NULL)
-#endif
+		if (strrchr(word[2], G_DIR_SEPARATOR) != NULL)
 			strncpy(file, word[2], PATH_MAX);
-		else {
+		else
+		{
 			if (stat(word[2], st) == 0)
 			{
 				xdir = getcwd (buf, PATH_MAX);
-				snprintf (file, PATH_MAX, "%s/%s", xdir, word[2]);
+				snprintf (file, PATH_MAX, "%s" G_DIR_SEPARATOR_S "%s", xdir, word[2]);
 			}
 			else
 			{
 				xdir = hexchat_get_info (ph, "hexchatdirfs");
-				snprintf (file, PATH_MAX, "%s/addons/%s", xdir, word[2]);
+				snprintf (file, PATH_MAX, "%s" G_DIR_SEPARATOR_S "addons" G_DIR_SEPARATOR_S "%s", xdir, word[2]);
 			}
 		}