]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lexer.ll
Issue 3832: react sanely to ill-formed version strings
[lilypond.git] / lily / lexer.ll
index fbe878c56c9c227955a53b591f7562a330633f8e..f242158df78a0ad137efa96ea1da64d97d65908e 100644 (file)
@@ -1274,7 +1274,12 @@ is_valid_version (string s)
 {
   Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
   Lilypond_version ver (s);
-  if (int (ver) < oldest_version)
+  if (!ver)
+  {
+         non_fatal_error (_f ("Invalid version string \"%s\"", s));
+         return false;
+  }
+  if (ver < oldest_version)
        {       
                non_fatal_error (_f ("file too old: %s (oldest supported: %s)", ver.to_string (), oldest_version.to_string ()));
                non_fatal_error (_ ("consider updating the input with the convert-ly script"));