notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drc: rm write irq check
[picodrive.git]
/
tools
/
textfilter.c
diff --git
a/tools/textfilter.c
b/tools/textfilter.c
index
bcac838
..
90354c2
100644
(file)
--- a/
tools/textfilter.c
+++ b/
tools/textfilter.c
@@
-25,17
+25,19
@@
static int check_defines(const char **defs, int defcount, char *tdef)
static void do_counters(char *str)
{
static void do_counters(char *str)
{
- static int counter
s[4] = { 1, 1, 1, 1 }
;
+ static int counter
_id = -1, counter
;
char buff[1024];
char buff[1024];
- int counter;
char *s = str;
while ((s = strstr(s, "@@")))
{
char *s = str;
while ((s = strstr(s, "@@")))
{
- if (s[2] < '0' || s[2] > '
3
') { s++; continue; }
+ if (s[2] < '0' || s[2] > '
9
') { s++; continue; }
- counter = s[2] - '0';
- snprintf(buff, sizeof(buff), "%i%s", counters[counter]++, s + 3);
+ if (counter_id != s[2] - '0') {
+ counter_id = s[2] - '0';
+ counter = 1;
+ }
+ snprintf(buff, sizeof(buff), "%i%s", counter++, s + 3);
strcpy(s, buff);
}
}
strcpy(s, buff);
}
}