prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  VS 2017 backend emits bad WindowsTargetPlatformVersion value
  When I tried generating a VS 2017 solution, the generated app.vcxproj contained this:
  
  ```
  <WindowsTargetPlatformVersion>10.0.14393.0\</WindowsTargetPlatformVersion>
  ```
  
  Which then causes errors in other `.targets` files attempting to do a numeric comparison against that.
  This value is probably taken straight from one of these environment variables:
  
  ```
  WindowsSDKLibVersion=10.0.14393.0\
  WindowsSDKVersion=10.0.14393.0\
  ```
  
  The trailing backslash is a bit suspect, but may be there intentionally so it can be concatenated to 
  ```
  WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
  ```
  directly.
  
  </issue>
  <code>
  [start of mesonbuild/backend/vs2017backend.py]
  1 # Copyright 2014-2016 The Meson development team
  2 
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 import os
  16 
  17 from .vs2010backend import Vs2010Backend
  18 
  19 
  20 class Vs2017Backend(Vs2010Backend):
  21     def __init__(self, build):
  22         super().__init__(build)
  23         self.name = 'vs2017'
  24         self.platform_toolset = 'v141'
  25         self.vs_version = '2017'
  26         # WindowsSDKVersion should be set by command prompt.
  27         self.windows_target_platform_version = os.getenv('WindowsSDKVersion', None)
  28
  [end of mesonbuild/backend/vs2017backend.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/mesonbuild/backend/vs2017backend.py b/mesonbuild/backend/vs2017backend.py
  --- a/mesonbuild/backend/vs2017backend.py
  +++ b/mesonbuild/backend/vs2017backend.py
  @@ -24,4 +24,4 @@
           self.platform_toolset = 'v141'
           self.vs_version = '2017'
           # WindowsSDKVersion should be set by command prompt.
  -        self.windows_target_platform_version = os.getenv('WindowsSDKVersion', None)
  +        self.windows_target_platform_version = os.getenv('WindowsSDKVersion', None).rstrip('\\')
  
verification_info: {"golden_diff": "diff --git a/mesonbuild/backend/vs2017backend.py b/mesonbuild/backend/vs2017backend.py\n--- a/mesonbuild/backend/vs2017backend.py\n+++ b/mesonbuild/backend/vs2017backend.py\n@@ -24,4 +24,4 @@\n         self.platform_toolset = 'v141'\n         self.vs_version = '2017'\n         # WindowsSDKVersion should be set by command prompt.\n-        self.windows_target_platform_version = os.getenv('WindowsSDKVersion', None)\n+        self.windows_target_platform_version = os.getenv('WindowsSDKVersion', None).rstrip('\\\\')\n", "issue": "VS 2017 backend emits bad WindowsTargetPlatformVersion value\nWhen I tried generating a VS 2017 solution, the generated app.vcxproj contained this:\r\n\r\n```\r\n<WindowsTargetPlatformVersion>10.0.14393.0\\</WindowsTargetPlatformVersion>\r\n```\r\n\r\nWhich then causes errors in other `.targets` files attempting to do a numeric comparison against that.\r\nThis value is probably taken straight from one of these environment variables:\r\n\r\n```\r\nWindowsSDKLibVersion=10.0.14393.0\\\r\nWindowsSDKVersion=10.0.14393.0\\\r\n```\r\n\r\nThe trailing backslash is a bit suspect, but may be there intentionally so it can be concatenated to \r\n```\r\nWindowsSdkDir=C:\\Program Files (x86)\\Windows Kits\\10\\\r\n```\r\ndirectly.\n", "before_files": [{"content": "# Copyright 2014-2016 The Meson development team\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\n\nfrom .vs2010backend import Vs2010Backend\n\n\nclass Vs2017Backend(Vs2010Backend):\n    def __init__(self, build):\n        super().__init__(build)\n        self.name = 'vs2017'\n        self.platform_toolset = 'v141'\n        self.vs_version = '2017'\n        # WindowsSDKVersion should be set by command prompt.\n        self.windows_target_platform_version = os.getenv('WindowsSDKVersion', None)\n", "path": "mesonbuild/backend/vs2017backend.py"}]}