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:55:55 +0000 (14:55 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 17 Apr 2020 18:56:56 +0000 (14:56 -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 07be39f2bd8d3996dc0bd164fe60c56d9eb86c83..f8f6b300ebac2cc0624c607146d5c56e7a5b2d25 100644 (file)
@@ -150,7 +150,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);
    }