Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
e15e6e76
Unverified
Commit
e15e6e76
authored
Mar 08, 2020
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Mar 08, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into BuildAndroid
parents
7c85a1ff
1cc270f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
AUTHORS
AUTHORS
+1
-1
mrbgems/mruby-io/src/file.c
mrbgems/mruby-io/src/file.c
+7
-6
No files found.
AUTHORS
View file @
e15e6e76
...
...
@@ -42,4 +42,4 @@ of this list.
Masahiro Wakame
YAMAMOTO Masaya
KOBAYASHI Shuji
RIZAL Reckordp
\ No newline at end of file
RIZAL Reckordp
mrbgems/mruby-io/src/file.c
View file @
e15e6e76
...
...
@@ -287,27 +287,28 @@ mrb_file__getwd(mrb_state *mrb, mrb_value klass)
#define CHECK_UNCDEV_PATH (IS_FILESEP(path[0]) && IS_FILESEP(path[1]))
static
int
is_absolute_traditional_path
(
const
char
*
path
,
in
t
len
)
is_absolute_traditional_path
(
const
char
*
path
,
size_
t
len
)
{
if
(
len
<
3
)
return
0
;
return
(
ISALPHA
(
path
[
0
])
&&
IS_VOLSEP
(
path
[
1
])
&&
IS_FILESEP
(
path
[
2
]));
}
static
int
is_aboslute_unc_path
(
const
char
*
path
,
in
t
len
)
{
is_aboslute_unc_path
(
const
char
*
path
,
size_
t
len
)
{
if
(
len
<
2
)
return
0
;
return
(
CHECK_UNCDEV_PATH
&&
!
IS_DEVICEID
(
path
[
2
]));
}
static
int
is_absolute_device_path
(
const
char
*
path
,
in
t
len
)
{
is_absolute_device_path
(
const
char
*
path
,
size_
t
len
)
{
if
(
len
<
4
)
return
0
;
return
(
CHECK_UNCDEV_PATH
&&
IS_DEVICEID
(
path
[
2
])
&&
IS_FILESEP
(
path
[
3
]));
}
static
int
mrb_file_is_absolute_path
(
const
char
*
path
,
int
len
)
mrb_file_is_absolute_path
(
const
char
*
path
)
{
size_t
len
=
strlen
(
path
);
if
(
IS_FILESEP
(
path
[
0
]))
return
1
;
if
(
len
>
0
)
return
(
...
...
@@ -366,14 +367,14 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
path
=
mrb_str_new_cstr
(
mrb
,
home
);
mrb_locale_free
(
home
);
return
path
;
#else
#else
/* _WIN32 */
argc
=
mrb_get_argc
(
mrb
);
if
(
argc
==
0
)
{
home
=
getenv
(
"USERPROFILE"
);
if
(
home
==
NULL
)
{
return
mrb_nil_value
();
}
if
(
!
mrb_file_is_absolute_path
(
home
,
strlen
(
home
)
))
{
if
(
!
mrb_file_is_absolute_path
(
home
))
{
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"non-absolute home"
);
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment