From ccea49c845c436bcb51310e9b5d05dcc62b554bf Mon Sep 17 00:00:00 2001 From: Ben McDonald <46734217+bmcdonald3@users.noreply.github.com> Date: Tue, 4 Oct 2022 14:27:01 -0400 Subject: [PATCH] Fix Chapel version query In version 1.28 and prior, the `chplVersion` string is prefixed with "version", but that has been removed since, so this string split was resulting in an empty array, meaning that the index into the array was out of bounds. This PR just does a replace on the string for "version ", so it works both for the old string that contained "version " and the new string that does not. --- src/ServerConfig.chpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ServerConfig.chpl b/src/ServerConfig.chpl index c15192507d..ebb6e6beb9 100644 --- a/src/ServerConfig.chpl +++ b/src/ServerConfig.chpl @@ -83,9 +83,9 @@ module ServerConfig */ proc getChplVersion() throws { use Version; - var ver = chplVersion:string; - var verArray = ver.split('version'); - return verArray[1]; + // Prior to 1.28, chplVersion had a prepended version that has + // since been removed + return (chplVersion:string).replace('version ', ''); } /*