From a085d8c88bd45474d3f9d9a0d3d20ebf7de858f6 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 18 Apr 2018 13:21:50 +0300 Subject: [PATCH] shared/shell: Fix checking for variable size argument strsuffix returns 0 if the suffix matches. --- src/shared/shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/shell.c b/src/shared/shell.c index 9395598ee..e7f17e021 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -279,8 +279,8 @@ static int parse_args(char *arg, wordexp_t *w, char *del, int flags) return -EINVAL; } - /* If argument ends with ,,, set we_offs bypass strict checks */ - if (w->we_wordc && strsuffix(w->we_wordv[w->we_wordc -1], "...")) + /* If argument ends with ... set we_offs bypass strict checks */ + if (w->we_wordc && !strsuffix(w->we_wordv[w->we_wordc -1], "...")) w->we_offs = 1; free(str); -- 2.47.3