"Robert Wimmer" <seppwimmer@xxxxxxxxxxx> writes:
> text *t = PG_GETARG_TEXT_P(0);
> l = VARSIZE(t) - VARHDRSZ;
> for (i = 0; i < l; i++) { if ( (t->vl_dat[i] < '0') || (t->vl_dat[i] >
> '9')) break; }
> if (i==l) ret = 0;
> else ret = i;
I think you need to rethink your return convention --- success and
failure at the first character both return 0.
Directly using the vl_dat field doesn't seem like good style (you won't
find it anywhere in the backend sources) but it works.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
message can get through to the mailing list cleanly
|