win32-xpath 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +10 -0
- data/MANIFEST +1 -0
- data/README +6 -2
- data/appveyor.yml +10 -9
- data/bench/bench_win32_xpath.rb +1 -1
- data/certs/djberg96_pub.pem +22 -17
- data/ext/win32/xpath.c +9 -8
- data/lib/win32-xpath.rb +1 -0
- data/test/test_win32_xpath.rb +6 -1
- data/win32-xpath.gemspec +1 -1
- metadata +27 -20
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 57095d0364728770789c298d760f6c075edc3faedc66595415ab208e3570b2de
|
4
|
+
data.tar.gz: 45cdd6f3d4f05b1fcec3270cd23d8606d2f1f335667df718c0d5d63b1d4ce0c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5caa0c94f6dd269df0f796fe986a5e779977697bc0b36d9234c5296e53786be145729d090fa1c01ac7cefa614f3d68fdcb74eae05e376394e17893b8e86b03f2
|
7
|
+
data.tar.gz: 14089d9172d55a185f9b3e5631f597832ccf6f47b8b1b0ab95976ff3f770b47d5209260b09efa094adc48e5891acf1618810597ca99f0e3f36fb4c777f5d1168
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
= 1.1.1 - 3-Mar-2019
|
2
|
+
* Switched RSTRING_PTR to StringValueCStr internally because apparently I
|
3
|
+
I didn't get the memo on null termination changes.
|
4
|
+
* Fixed a warning caused by rb_funcall by switching it to rb_funcall2.
|
5
|
+
* Fixed a bug where it would try to expand tildes for paths in 8.3 format.
|
6
|
+
Now tildes are only expanded if they are the first character in the path.
|
7
|
+
* Updated the cert.
|
8
|
+
* Updated the appveyor file to include Ruby 2.3, 2.4 and 2.5.
|
9
|
+
* Added a win32-xpath.rb file for convenience.
|
10
|
+
|
1
11
|
= 1.1.0 - 11-Jun-2016
|
2
12
|
* Changed license to Apache 2.0.
|
3
13
|
* Use PathCchXXX functions wherever I could that had not already been
|
data/MANIFEST
CHANGED
data/README
CHANGED
@@ -17,8 +17,9 @@
|
|
17
17
|
= Known Issues
|
18
18
|
* This library does not support drive-current paths for the 2nd argument.
|
19
19
|
* This library does not support alt-stream name autocorrection.
|
20
|
+
* This library does not convert short paths to long paths.
|
20
21
|
|
21
|
-
It is very unlikely you will ever be affected by
|
22
|
+
It is very unlikely you will ever be affected by any of these things.
|
22
23
|
Drive-current paths are a relic of DOS 1.0, but even so this library
|
23
24
|
will handle them in the first argument.
|
24
25
|
|
@@ -27,6 +28,9 @@
|
|
27
28
|
for the default $DATA stream, and then only for a certain type of
|
28
29
|
syntax error. I do not know when or why it was added.
|
29
30
|
|
31
|
+
Failure to convert short paths to long paths is irrelevant since that
|
32
|
+
has nothing to do with relative versus absolute paths.
|
33
|
+
|
30
34
|
One possible "real" issue is that on Windows 7 or earlier you will be
|
31
35
|
limited to 260 character paths. This is a limitation of the shlwapi.h
|
32
36
|
functions that I use internally.
|
@@ -48,7 +52,7 @@
|
|
48
52
|
Apache 2.0
|
49
53
|
|
50
54
|
== Copyright
|
51
|
-
(C) 2003-
|
55
|
+
(C) 2003-2019 Daniel J. Berger, All Rights Reserved
|
52
56
|
|
53
57
|
== Warranty
|
54
58
|
This package is provided "as is" and without any express or
|
data/appveyor.yml
CHANGED
@@ -2,17 +2,18 @@ version: '{build}'
|
|
2
2
|
branches:
|
3
3
|
only:
|
4
4
|
- master
|
5
|
+
- appveyor
|
5
6
|
skip_tags: true
|
6
7
|
environment:
|
7
8
|
matrix:
|
8
|
-
- ruby_version: 21
|
9
|
-
ruby_dir: 2.1.0
|
10
|
-
- ruby_version: 21-x64
|
11
|
-
ruby_dir: 2.1.0
|
12
|
-
- ruby_version: 22
|
13
|
-
ruby_dir: 2.2.0
|
14
9
|
- ruby_version: 22-x64
|
15
10
|
ruby_dir: 2.2.0
|
11
|
+
- ruby_version: 23-x64
|
12
|
+
ruby_dir: 2.3.0
|
13
|
+
- ruby_version: 24-x64
|
14
|
+
ruby_dir: 2.4.0
|
15
|
+
- ruby_version: 25-x64
|
16
|
+
ruby_dir: 2.5.0
|
16
17
|
install:
|
17
18
|
- ps: >-
|
18
19
|
$env:path = "C:\Ruby" + $env:ruby_version + "\bin;" + $env:path
|
@@ -25,10 +26,10 @@ install:
|
|
25
26
|
|
26
27
|
if ((gem query -i test-unit -v ">= 3.0") -eq $False){ gem install test-unit --no-document }
|
27
28
|
cache:
|
28
|
-
- C:\Ruby21\lib\ruby\gems\2.1.0
|
29
|
-
- C:\Ruby21-x64\lib\ruby\gems\2.1.0
|
30
|
-
- C:\Ruby22\lib\ruby\gems\2.2.0
|
31
29
|
- C:\Ruby22-x64\lib\ruby\gems\2.2.0
|
30
|
+
- C:\Ruby23-x64\lib\ruby\gems\2.3.0
|
31
|
+
- C:\Ruby24-x64\lib\ruby\gems\2.4.0
|
32
|
+
- C:\Ruby25-x64\lib\ruby\gems\2.5.0
|
32
33
|
build: off
|
33
34
|
test_script:
|
34
35
|
- cmd: rake
|
data/bench/bench_win32_xpath.rb
CHANGED
data/certs/djberg96_pub.pem
CHANGED
@@ -1,21 +1,26 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
2
|
+
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
|
3
3
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
4
|
-
|
4
|
+
MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
|
5
5
|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WG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
|
19
|
+
h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
|
20
|
+
6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
|
21
|
+
ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
|
22
|
+
1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
|
23
|
+
DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
|
24
|
+
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
25
|
+
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
21
26
|
-----END CERTIFICATE-----
|
data/ext/win32/xpath.c
CHANGED
@@ -201,7 +201,7 @@ static VALUE rb_xpath(int argc, VALUE* argv, VALUE self){
|
|
201
201
|
rb_scan_args(argc, argv, "11", &v_path_orig, &v_dir_orig);
|
202
202
|
|
203
203
|
if (rb_respond_to(v_path_orig, rb_intern("to_path")))
|
204
|
-
v_path_orig =
|
204
|
+
v_path_orig = rb_funcall2(v_path_orig, rb_intern("to_path"), 0, NULL);
|
205
205
|
|
206
206
|
SafeStringValue(v_path_orig);
|
207
207
|
|
@@ -223,10 +223,10 @@ static VALUE rb_xpath(int argc, VALUE* argv, VALUE self){
|
|
223
223
|
rb_str_modify_expand(v_path, MAX_WPATH);
|
224
224
|
|
225
225
|
// Make our path a wide string for later functions
|
226
|
-
length = MultiByteToWideChar(CP_UTF8, 0,
|
226
|
+
length = MultiByteToWideChar(CP_UTF8, 0, StringValueCStr(v_path), -1, NULL, 0);
|
227
227
|
path = (wchar_t*)ruby_xmalloc(length * sizeof(wchar_t));
|
228
228
|
|
229
|
-
if(!MultiByteToWideChar(CP_UTF8, 0,
|
229
|
+
if(!MultiByteToWideChar(CP_UTF8, 0, StringValueCStr(v_path), -1, path, length)){
|
230
230
|
ruby_xfree(path);
|
231
231
|
rb_raise_syserr("MultibyteToWideChar", GetLastError());
|
232
232
|
}
|
@@ -235,8 +235,8 @@ static VALUE rb_xpath(int argc, VALUE* argv, VALUE self){
|
|
235
235
|
while(wcsstr(path, L"/"))
|
236
236
|
path[wcscspn(path, L"/")] = L'\\';
|
237
237
|
|
238
|
-
// Handle ~ expansion.
|
239
|
-
if (ptr = wcschr(path, L'~')){
|
238
|
+
// Handle ~ expansion if first character.
|
239
|
+
if ( (ptr = wcschr(path, L'~')) && ((int)(ptr - path) == 0) ){
|
240
240
|
wchar_t* home;
|
241
241
|
|
242
242
|
// Handle both ~/user and ~user syntax
|
@@ -291,10 +291,10 @@ static VALUE rb_xpath(int argc, VALUE* argv, VALUE self){
|
|
291
291
|
// Prep string for modification
|
292
292
|
rb_str_modify_expand(v_dir, MAX_WPATH);
|
293
293
|
|
294
|
-
length = MultiByteToWideChar(CP_UTF8, 0,
|
294
|
+
length = MultiByteToWideChar(CP_UTF8, 0, StringValueCStr(v_dir), -1, NULL, 0);
|
295
295
|
dir = (wchar_t*)ruby_xmalloc(MAX_WPATH * sizeof(wchar_t));
|
296
296
|
|
297
|
-
if (!MultiByteToWideChar(CP_UTF8, 0,
|
297
|
+
if (!MultiByteToWideChar(CP_UTF8, 0, StringValueCStr(v_dir), -1, dir, length)){
|
298
298
|
ruby_xfree(dir);
|
299
299
|
rb_raise_syserr("MultibyteToWideChar", GetLastError());
|
300
300
|
}
|
@@ -302,7 +302,8 @@ static VALUE rb_xpath(int argc, VALUE* argv, VALUE self){
|
|
302
302
|
while (wcsstr(dir, L"/"))
|
303
303
|
dir[wcscspn(dir, L"/")] = L'\\';
|
304
304
|
|
305
|
-
|
305
|
+
// Check for tilde in first character
|
306
|
+
if ( (ptr = wcschr(dir, L'~')) && ((int)(ptr - dir) == 0) ){
|
306
307
|
if (ptr[1] && ptr[1] != L'\\'){
|
307
308
|
dir = find_user(++ptr);
|
308
309
|
}
|
data/lib/win32-xpath.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'win32/xpath'
|
data/test/test_win32_xpath.rb
CHANGED
@@ -11,7 +11,7 @@ class Test_XPath < Test::Unit::TestCase
|
|
11
11
|
|
12
12
|
def setup
|
13
13
|
@pwd = Dir.pwd
|
14
|
-
@tmp =
|
14
|
+
@tmp = 'C:/Temp'
|
15
15
|
@root = 'C:/'
|
16
16
|
@drive = ENV['HOMEDRIVE']
|
17
17
|
@home = ENV['HOME'].tr('\\', '/')
|
@@ -118,6 +118,11 @@ class Test_XPath < Test::Unit::TestCase
|
|
118
118
|
assert_equal("#{@home}/foo", File.expand_path('foo', '~'))
|
119
119
|
end
|
120
120
|
|
121
|
+
test "doesn't attempt to expand a tilde unless it's the first character" do
|
122
|
+
assert_equal("C:/Progra~1", File.expand_path("C:/Progra~1"))
|
123
|
+
assert_equal("C:/Progra~1", File.expand_path("C:/Progra~1", "C:/Progra~1"))
|
124
|
+
end
|
125
|
+
|
121
126
|
test "does not modify a HOME string argument" do
|
122
127
|
str = "~/a"
|
123
128
|
assert_equal("#{@home}/a", File.expand_path(str))
|
data/win32-xpath.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-xpath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -10,27 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIEcDCCAtigAwIBAgIBATANBgk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gNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
|
27
|
+
AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
|
28
|
+
YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
|
29
|
+
/3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
|
30
|
+
h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
|
31
|
+
6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
|
32
|
+
ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
|
33
|
+
1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
|
34
|
+
DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
|
35
|
+
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
|
+
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
32
37
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
38
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
34
39
|
dependencies:
|
35
40
|
- !ruby/object:Gem::Dependency
|
36
41
|
name: rake
|
@@ -83,6 +88,8 @@ files:
|
|
83
88
|
- ext/extconf.rb
|
84
89
|
- ext/win32
|
85
90
|
- ext/win32/xpath.c
|
91
|
+
- lib
|
92
|
+
- lib/win32-xpath.rb
|
86
93
|
- MANIFEST
|
87
94
|
- Rakefile
|
88
95
|
- README
|
@@ -109,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
116
|
version: '0'
|
110
117
|
requirements: []
|
111
118
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.6
|
119
|
+
rubygems_version: 2.7.6
|
113
120
|
signing_key:
|
114
121
|
specification_version: 4
|
115
122
|
summary: Revamped File.expand_path for Windows
|
metadata.gz.sig
CHANGED
Binary file
|