From e0f6867a889b01a424a7cd072c68ebaca8e42812 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Thu, 1 Jun 2017 23:29:55 +0200 Subject: [PATCH] termptyesc: _csi_arg_get() now correctly handles missing arguments Only affects when multiple ones were expected --- src/bin/termptyesc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index 988c3955..b199bf56 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -96,9 +96,17 @@ _csi_arg_get(Eina_Unicode **ptr) if (!b) goto error; - while ((*b) && (*b < '0' || *b > '9')) + /* Skip potential '?', '>'.... */ + while ((*b) && ( (*b) != ';' && ((*b) < '0' || (*b) > '9'))) b++; + if (*b == ';') + { + b++; + *ptr = b; + return -1; + } + if (!*b) goto error; @@ -111,6 +119,11 @@ _csi_arg_get(Eina_Unicode **ptr) b++; } + if (*b == ';') + { + b++; + } + *ptr = b; return sum;