summaryrefslogtreecommitdiff
path: root/lib/chef/win32
diff options
context:
space:
mode:
author007lva <007.lva@gmail.com>2020-09-24 23:08:12 +0200
committer007lva <007.lva@gmail.com>2020-09-24 23:08:52 +0200
commit6ecacec32423b116e64fdcc11be0e8e18ce94706 (patch)
treeea00b3aa4389335922f42b6e22aa6921f64ad070 /lib/chef/win32
parenta1e8747af72cf91a7b5a729db647e158f46ad01f (diff)
downloadchef-6ecacec32423b116e64fdcc11be0e8e18ce94706.tar.gz
Use Ruby 2.6 endless Range syntax
Signed-off-by: Luigi <007.lva@gmail.com>
Diffstat (limited to 'lib/chef/win32')
-rw-r--r--lib/chef/win32/file.rb2
-rw-r--r--lib/chef/win32/unicode.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb
index e898144414..55fc2461e8 100644
--- a/lib/chef/win32/file.rb
+++ b/lib/chef/win32/file.rb
@@ -124,7 +124,7 @@ class Chef
# Return the link destination (strip off \??\ at the beginning, which is a local filesystem thing)
link_dest = reparse_buffer.reparse_buffer.substitute_name
if /^\\\?\?\\/.match?(link_dest)
- link_dest = link_dest[4..-1]
+ link_dest = link_dest[4..]
end
link_dest
end
diff --git a/lib/chef/win32/unicode.rb b/lib/chef/win32/unicode.rb
index f6e97737de..731fe2fbd9 100644
--- a/lib/chef/win32/unicode.rb
+++ b/lib/chef/win32/unicode.rb
@@ -40,7 +40,7 @@ module FFI
last_char = nil
while last_char != "\000\000"
length += 1
- last_char = get_bytes(0, length * 2)[-2..-1]
+ last_char = get_bytes(0, length * 2)[-2..]
end
num_wchars = length