mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 23:52:22 +02:00
/SCRIPT LOAD modifies the script name so that all non-alphanumeric
characters are translated to '_' char .. now this behaviour is done also when /SCRIPT UNLOAD is done, so people don't get confused why their "test-1" script can't be unloaded. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2145 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ed4d24b282
commit
ba445fe37e
3 changed files with 17 additions and 6 deletions
|
|
@ -165,11 +165,11 @@ void perl_scripts_deinit(void)
|
|||
my_perl = NULL;
|
||||
}
|
||||
|
||||
static char *script_file_get_name(const char *path)
|
||||
/* Modify the script name so that all non-alphanumeric characters are
|
||||
translated to '_' */
|
||||
void script_fix_name(char *name)
|
||||
{
|
||||
char *name, *ret, *p;
|
||||
|
||||
ret = name = g_strdup(g_basename(path));
|
||||
char *ret, *p;
|
||||
|
||||
p = strrchr(name, '.');
|
||||
if (p != NULL) *p = '\0';
|
||||
|
|
@ -179,8 +179,15 @@ static char *script_file_get_name(const char *path)
|
|||
*name = '_';
|
||||
name++;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
static char *script_file_get_name(const char *path)
|
||||
{
|
||||
char *name;
|
||||
|
||||
name = g_strdup(g_basename(path));
|
||||
script_fix_name(name);
|
||||
return name;
|
||||
}
|
||||
|
||||
static char *script_data_get_name(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue