mirror of
https://github.com/irssi/irssi.git
synced 2026-08-24 02:52:20 +02:00
Merge 85d1330e8c into e948aaa4ba
This commit is contained in:
commit
33b267155e
3 changed files with 18 additions and 1 deletions
|
|
@ -857,7 +857,12 @@ static void parse_command(const char *command, int expand_aliases,
|
||||||
|
|
||||||
cmd = orig = g_strconcat("command ", command, NULL);
|
cmd = orig = g_strconcat("command ", command, NULL);
|
||||||
args = strchr(cmd+8, ' ');
|
args = strchr(cmd+8, ' ');
|
||||||
if (args != NULL) *args++ = '\0'; else args = "";
|
if (args == NULL)
|
||||||
|
args = "";
|
||||||
|
else {
|
||||||
|
*args++ = '\0';
|
||||||
|
strchomp(args);
|
||||||
|
}
|
||||||
|
|
||||||
/* check if there's an alias for command. Don't allow
|
/* check if there's an alias for command. Don't allow
|
||||||
recursive aliases */
|
recursive aliases */
|
||||||
|
|
|
||||||
|
|
@ -1019,3 +1019,12 @@ char **strsplit_len(const char *str, int len, gboolean onspace)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void strchomp(char *str) {
|
||||||
|
char *i, *j;
|
||||||
|
|
||||||
|
for (i = j = str; *i; i++)
|
||||||
|
if (!isspace(*i)) *j++ = *i;
|
||||||
|
|
||||||
|
*j = '\0';
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,4 +121,7 @@ int find_substr(const char *list, const char *item);
|
||||||
/* split `str' into `len' sized substrings */
|
/* split `str' into `len' sized substrings */
|
||||||
char **strsplit_len(const char *str, int len, gboolean onspace);
|
char **strsplit_len(const char *str, int len, gboolean onspace);
|
||||||
|
|
||||||
|
/* trim trailing whitespace */
|
||||||
|
void strchomp(char *str);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue