1
1
submodule(stdlib_system) stdlib_system_path
2
2
use stdlib_ascii, only: reverse
3
3
use stdlib_strings, only: chomp, find, join
4
- use stdlib_string_type, only: string_type, char, assignment ( = )
4
+ use stdlib_string_type, only: string_type, char, move
5
5
contains
6
6
module function join2_char_char (p1 , p2 ) result(path)
7
7
character (:), allocatable :: path
@@ -22,15 +22,21 @@ module function join2_string_char(p1, p2) result(path)
22
22
type (string_type) :: path
23
23
type (string_type), intent (in ) :: p1
24
24
character (* ), intent (in ) :: p2
25
+ character (:), allocatable :: join_char
25
26
26
- path = join_path(char (p1), p2)
27
+ join_char = join_path(char (p1), p2)
28
+
29
+ call move(join_char, path)
27
30
end function join2_string_char
28
31
29
32
module function join2_string_string (p1 , p2 ) result(path)
30
33
type (string_type) :: path
31
34
type (string_type), intent (in ) :: p1, p2
35
+ character (:), allocatable :: join_char
36
+
37
+ join_char = join_path(char (p1), char (p2))
32
38
33
- path = join_path( char (p1), char (p2) )
39
+ call move(join_char, path )
34
40
end function join2_string_string
35
41
36
42
module function joinarr_char (p ) result(path)
@@ -59,22 +65,22 @@ module function join_op_char_string(p1, p2) result(path)
59
65
character (* ), intent (in ) :: p1
60
66
type (string_type), intent (in ) :: p2
61
67
62
- path = join_path(p1, char (p2) )
68
+ path = join_path(p1, p2 )
63
69
end function join_op_char_string
64
70
65
71
module function join_op_string_char (p1 , p2 ) result(path)
66
72
type (string_type) :: path
67
73
type (string_type), intent (in ) :: p1
68
74
character (* ), intent (in ) :: p2
69
75
70
- path = join_path(char (p1) , p2)
76
+ path = join_path(p1 , p2)
71
77
end function join_op_string_char
72
78
73
79
module function join_op_string_string (p1 , p2 ) result(path)
74
80
type (string_type) :: path
75
81
type (string_type), intent (in ) :: p1, p2
76
82
77
- path = join_path(char (p1), char (p2) )
83
+ path = join_path(p1, p2 )
78
84
end function join_op_string_string
79
85
80
86
module subroutine split_path_char (p , head , tail )
@@ -128,8 +134,8 @@ module subroutine split_path_string(p, head, tail)
128
134
129
135
call split_path(char (p), head_char, tail_char)
130
136
131
- head = head_char
132
- tail = tail_char
137
+ call move( head_char, head)
138
+ call move( tail_char, tail)
133
139
end subroutine split_path_string
134
140
135
141
module function base_name_char (p ) result(base)
0 commit comments