Skip to content

Commit

Permalink
Fix Chapel version query (#1823)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bmcdonald3 authored Oct 4, 2022
1 parent 2ac4e79 commit ae57eff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ServerConfig.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ', '');
}

/*
Expand Down

0 comments on commit ae57eff

Please sign in to comment.