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:52:42 +0000 (14:52 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 17 Apr 2020 18:53:56 +0000 (14:53 -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 73990ede3996798d1160dd3b77668e6f1de48e7a..fb774011ffd37fb6a4af97226745fe82454b0bb7 100644 (file)
@@ -152,7 +152,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);
    }