Mercurial > hg
changeset 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 | db019a5f874f |
children | 64cb4de94972 |
files | mcabber/src/utils.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
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)); }