This is the version of poorman:
char *p, *s = args[0];
...
p = strchr(s, '\\');
while(p) {
s = ++p;
p = strchr(p, '\\');
}
...
note: for _TCHARuse , and _tcschr strchr
strchrsimilar to: while((*p) && (*p != '\\')) p++;
returning NULL to a safe place if chrnot found. Therefore, if you really do not like to depend on another lib, you can use this:
char *p, *s = args[0];
...
p = s;
while(*p && (*p != '\\')) p++;
while(*p) {
s = ++p;
while (*p && (*p != '\\')) p++;
}
...
The smaller, the better use asm.
source
share