]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Loosen version check on data file read
authormartin f. krafft <redacted>
Thu, 23 Feb 2017 18:41:29 +0000 (07:41 +1300)
committermartin f. krafft <redacted>
Thu, 23 Feb 2017 18:44:48 +0000 (07:44 +1300)
The versioning of the data file allows for making changes to the format,
but if the script version increases without the data file-format being
changed, things are expected to work as before, and thus there ought not
be an error spouted.

Let's only use the versioning to patch up handling for formats of the
past.

Signed-off-by: martin f. krafft <redacted>
scripts/ctrlact.pl

index aa9dcfbd51134d9a47dab6b08a850f469e378ee9..da39804c6c8fff231543c7363eae2d544ec8429b 100644 (file)
@@ -432,14 +432,14 @@ sub load_mappings {
 
        my $nrcols = 4;
        if ($version eq $VERSION) {
-               # current version
+               # current version, i.e. no special handling is required. If
+               # previous versions require special handling, then massage the
+               # data or do whatever is required in the following
+               # elsif-clauses:
        }
        elsif ($version eq "1.0") {
                $nrcols = 3;
        }
-       else {
-               croak "Unsupported version found in $filename: $version"
-       }
        my $linesplitter = '^\s*'.join('\s+', ('(\S+)') x $nrcols).'\s*$';
        my $l = 1;
        while (<$fh>) {
git clone https://git.99rst.org/PROJECT