Mercurial > ~mikael > mcabber > hg
diff mcabber/src/utils.c @ 559:4eb579399613
Fix a small bug in split_arg()
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 01 Dec 2005 23:47:16 +0100 |
parents | c4fee1a2c478 |
children | 8b3db0b555a1 |
line wrap: on
line diff
--- a/mcabber/src/utils.c Thu Dec 01 23:37:15 2005 +0100 +++ b/mcabber/src/utils.c Thu Dec 01 23:47:16 2005 +0100 @@ -388,6 +388,8 @@ // double quotes. // Return a null-terminated array of strings. This array should be freed // be the caller after use, for example with free_arg_lst(). +// If dontstriplast is true, the Nth argument isn't stripped (i.e. no +// processing of quote chars) char **split_arg(const char *arg, unsigned int n, int dontstriplast) { char **arglst; @@ -426,7 +428,7 @@ if (start < end) { *(arglst+i) = g_strndup(start, end-start); - if (!dontstriplast) + if (!dontstriplast || i+1 < n) strip_arg_special_chars(*(arglst+i)); }