file: Avoid strange istringstream crash in cmake.org binaries on Alpine Linux

Somehow using istringstream and operator >> to parse an integer crashes on Alpine Linux, at least when compiled with the settings we use for the official cmake.org Linux binaries. Since !6839 (merged), this causes the file(READ) command to crash when parsing its LIMIT or OFFSET argument. Parse the input string with our dedicated helper to avoid the crash.

Fixes: #23872 (closed)
Backport: release

Merge request reports

Loading