vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 421e98a356ad80941aa54e59893d162c3589d688 parent 282c845f1d1799aa9736f75f1b823b0bb662a55c Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 12 Feb 2020 15:24:08 +0100 sam: move parse_number code, no functional change Diffstat:
| M | sam.c | | | 18 | +++++++++--------- |
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/sam.c b/sam.c @@ -584,6 +584,15 @@ static char *parse_delimited(const char **s, int type) { return chunk; } +static int parse_number(const char **s) { + char *end = NULL; + int number = strtoull(*s, &end, 10); + if (end == *s) + return 0; + *s = end; + return number; +} + static char *parse_text(const char **s) { skip_spaces(s); if (**s != '\n') { @@ -658,15 +667,6 @@ static Regex *parse_regex(Vis *vis, const char **s) { return regex; } -static int parse_number(const char **s) { - char *end = NULL; - int number = strtoull(*s, &end, 10); - if (end == *s) - return 0; - *s = end; - return number; -} - static enum SamError parse_count(const char **s, Count *count) { count->mod = **s == '%';