From 98d24a4fe8d38d08227e73b7b20c64daa7ce1a89 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 7 Apr 2019 18:42:47 +0200 Subject: [PATCH] style --- client/cliparser/argtable3.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/client/cliparser/argtable3.c b/client/cliparser/argtable3.c index f8e4c2387..e1bedbb4f 100644 --- a/client/cliparser/argtable3.c +++ b/client/cliparser/argtable3.c @@ -2960,10 +2960,19 @@ static int trex_class(TRex *exp) { while (*exp->_p != ']' && exp->_p != exp->_eol) { if (*exp->_p == '-' && first != -1) { int r, t; - if (*exp->_p++ == ']') trex_error(exp, _SC("unfinished range")); + if (*exp->_p++ == ']') { + trex_error(exp, _SC("unfinished range")); + } + r = trex_newnode(exp, OP_RANGE); - if (first > *exp->_p) trex_error(exp, _SC("invalid range")); - if (exp->_nodes[first].type == OP_CCLASS) trex_error(exp, _SC("cannot use character classes in ranges")); + if (first > *exp->_p) { + trex_error(exp, _SC("invalid range")); + } + + if (exp->_nodes[first].type == OP_CCLASS) { + trex_error(exp, _SC("cannot use character classes in ranges")); + } + exp->_nodes[r].left = exp->_nodes[first].type; t = trex_escapechar(exp); exp->_nodes[r].right = t; @@ -2984,8 +2993,6 @@ static int trex_class(TRex *exp) { if (first != -1) { int c = first; exp->_nodes[chain].next = c; - chain = c; - first = -1; } /* hack? */ exp->_nodes[ret].left = exp->_nodes[ret].next; @@ -4541,8 +4548,9 @@ void arg_print_formatted(FILE *fp, const unsigned colwidth = (rmargin - lmargin) + 1; /* Someone doesn't like us... */ - if (line_end < line_start) - { fprintf(fp, "%s\n", text); } + if (line_end == line_start) { + fprintf(fp, "%s\n", text); + } while (line_end - 1 > line_start) { /* Eat leading whitespaces. This is essential because while