Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Use a slightly more liberal regex to detect Visual Studio version
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 17 Apr 2020 18:44:33 +0000 (14:44 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 17 Apr 2020 18:44:33 +0000 (14:44 -0400)
Apparently in some language versions of Visual Studio nmake outputs some
material after the version number and before the end of the line. This
has been seen in Chinese versions. Therefore, we no longer demand that
the version string comes at the end of a line.

Per complaint from Cuiping Lin.

Backpatch to all live branches.

src/tools/msvc/VSObjectFactory.pm

index e6983b241fb6e550715309b742e7136e91a35157..541254006128a20474b8e66701f3e2e1f0860454 100644 (file)
@@ -120,7 +120,7 @@ sub DetermineVisualStudioVersion
        $? >> 8 == 0
          or croak
          "Unable to determine Visual Studio version: The nmake command wasn't found.";
-       if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+)?$/m)
+       if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+)?/)
        {
            return _GetVisualStudioVersion($1, $2);
        }