[tools v2] testbot/SetWinLocale: Simplify sending the Powershell script.

Francois Gouget fgouget at codeweavers.com
Thu Feb 17 03:16:03 CST 2022


Converting the line endings to CR+LF is not needed.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
v2: Rediffed. I think v1 failed to apply because GetWinProperties() took 
    the place of GetWinSettings().
---
 testbot/bin/SetWinLocale | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index 73c774e6e4..670de46043 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -662,20 +662,9 @@ sub RegGetValue($;$)
 # Show the host's locale settings
 #
 
-if (open(my $fh, "<", "$0.ps1"))
+if (!$TA->SendFile("$0.ps1", "$name0.ps1", 0))
 {
-  my $Script = join("", <$fh>);
-  close($fh);
-
-  $Script =~ s~\n~\r\n~g;
-  if (!$TA->SendFileFromString($Script, "$name0.ps1", 0))
-  {
-    FatalError("could not send the batch file:", $TA->GetLastError(), "\n");
-  }
-}
-else
-{
-  FatalError("could not open '$0.ps1' for reading: $!\n");
+  FatalError("could not send the Powershell script:", $TA->GetLastError(), "\n");
 }
 
 sub GetWinProperties($)
-- 
2.30.2



More information about the wine-devel mailing list