Commit 3c6b9f27 authored by Michael Beck's avatar Michael Beck
Browse files

combo error

[r20762]
parent 0834a04c
#include <stdlib.h>
char *test(char *name) {
char *p, *trunc = NULL;
int plen;
int min_part = 3;
do {
p = strrchr(name, '.');
p = p ? p+1 : name;
while (*p) {
plen = strcspn(p, '.');
p += plen;
if (plen > min_part) trunc = p-1;
if (*p) p++;
}
} while (trunc == NULL && --min_part != 0);
return p;
}
int main() {
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment