API documentation error in blob.seek?

I think there’s a small error in your API doc on blob.seek.

It reads:

"Attempts to set pointer beyond the start or the end of the blob will leave the pointer at the start or the end, respectively."

I think it should read:

"Attempts to set pointer beyond the start or the end of the blob will leave the pointer at its current location."

This has caused me countless debugging hours, so I thought I should point it out to help others.

I wish it did move it to the start or end of the blob if your current pointer location is mid-blob. That would be handy. But it leaves it where it is.

So, either the doc is wrong (misleading), or I’ve found a bug in the API. Do we know which it is?

Thanks a bunch.
-Rod

Interesting, Rod. I certainly thought moving the pointer to the start or the end was the intended behaviour, but hopefully our resident Squirrel expert, @peter, can provide the correct answer. Whichever it is, I’ll update the documentation accordingly. Thanks for pointing this out.

The upstream Squirrel documentation doesn’t say what’s meant to happen if the target offset is out-of-range, but I don’t think we’ve ever changed it: it’s always left the pointer where it is. What also isn’t documented, though, is that seek() appears to return -1 if that happens, but 0 if it did successfully set the offset.

Peter