Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
f94f7f20
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f94f7f20
编写于
10月 12, 2010
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6983520: java/io/pathNames/GeneralWin32.java fails with jdk7-b108 (win)
Reviewed-by: sherman
上级
db044453
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
3 deletion
+23
-3
src/windows/native/java/io/WinNTFileSystem_md.c
src/windows/native/java/io/WinNTFileSystem_md.c
+1
-1
src/windows/native/java/io/io_util_md.c
src/windows/native/java/io/io_util_md.c
+20
-1
src/windows/native/java/io/io_util_md.h
src/windows/native/java/io/io_util_md.h
+1
-0
test/java/io/pathNames/GeneralWin32.java
test/java/io/pathNames/GeneralWin32.java
+1
-1
未找到文件。
src/windows/native/java/io/WinNTFileSystem_md.c
浏览文件 @
f94f7f20
...
...
@@ -815,7 +815,7 @@ Java_java_io_WinNTFileSystem_getDriveDirectory(JNIEnv *env, jobject this,
jint
drive
)
{
jstring
ret
=
NULL
;
jchar
*
p
=
_wgetdcwd
(
drive
,
NULL
,
MAX_PATH
);
jchar
*
p
=
currentDir
(
drive
);
jchar
*
pf
=
p
;
if
(
p
==
NULL
)
return
NULL
;
if
(
iswalpha
(
*
p
)
&&
(
p
[
1
]
==
L':'
))
p
+=
2
;
...
...
src/windows/native/java/io/io_util_md.c
浏览文件 @
f94f7f20
...
...
@@ -66,6 +66,25 @@ fileToNTPath(JNIEnv *env, jobject file, jfieldID id) {
return
pathToNTPath
(
env
,
path
,
JNI_FALSE
);
}
/* Returns the working directory for the given drive, or NULL */
WCHAR
*
currentDir
(
int
di
)
{
UINT
dt
;
WCHAR
root
[
4
];
// verify drive is valid as _wgetdcwd in the VC++ 2010 runtime
// library does not handle invalid drives.
root
[
0
]
=
L'A'
+
(
WCHAR
)(
di
-
1
);
root
[
1
]
=
L':'
;
root
[
2
]
=
L'\\'
;
root
[
3
]
=
L'\0'
;
dt
=
GetDriveTypeW
(
root
);
if
(
dt
==
DRIVE_UNKNOWN
||
dt
==
DRIVE_NO_ROOT_DIR
)
{
return
NULL
;
}
else
{
return
_wgetdcwd
(
di
,
NULL
,
MAX_PATH
);
}
}
/* We cache the length of current working dir here to avoid
calling _wgetcwd() every time we need to resolve a relative
path. This piece of code needs to be revisited if chdir
...
...
@@ -83,7 +102,7 @@ currentDirLength(const WCHAR* ps, int pathlen) {
if
((
d
>=
L'a'
)
&&
(
d
<=
L'z'
))
di
=
d
-
L'a'
+
1
;
else
if
((
d
>=
L'A'
)
&&
(
d
<=
L'Z'
))
di
=
d
-
L'A'
+
1
;
else
return
0
;
/* invalid drive name. */
dir
=
_wgetdcwd
(
di
,
NULL
,
MAX_PATH
);
dir
=
currentDir
(
di
);
if
(
dir
!=
NULL
){
dirlen
=
wcslen
(
dir
);
free
(
dir
);
...
...
src/windows/native/java/io/io_util_md.h
浏览文件 @
f94f7f20
...
...
@@ -33,6 +33,7 @@
WCHAR
*
pathToNTPath
(
JNIEnv
*
env
,
jstring
path
,
jboolean
throwFNFE
);
WCHAR
*
fileToNTPath
(
JNIEnv
*
env
,
jobject
file
,
jfieldID
id
);
WCHAR
*
getPrefixed
(
const
WCHAR
*
path
,
int
pathlen
);
WCHAR
*
currentDir
(
int
di
);
int
currentDirLength
(
const
WCHAR
*
path
,
int
pathlen
);
void
fileOpen
(
JNIEnv
*
env
,
jobject
this
,
jstring
path
,
jfieldID
fid
,
int
flags
);
int
handleAvailable
(
jlong
fd
,
jlong
*
pbytes
);
...
...
test/java/io/pathNames/GeneralWin32.java
浏览文件 @
f94f7f20
...
...
@@ -22,7 +22,7 @@
*/
/* @test
@bug 4032066 4039597 4046914 4054511 4065189 4109131 4875229
@bug 4032066 4039597 4046914 4054511 4065189 4109131 4875229
6983520
@summary General exhaustive test of win32 pathname handling
@author Mark Reinhold
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录