Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
dc57ec18
...
dc57ec1899b7ba2608ba0855b236704f1936b0a6
authored
2003-01-16 13:45:11 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_expand_name): Correctly handle full and relative pathname specifications.
1 parent
7b5f1106
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
mh/mh_init.c
mh/mh_init.c
View file @
dc57ec1
...
...
@@ -342,15 +342,31 @@ mh_expand_name (const char *base, const char *name, int is_folder)
tmp
=
mu_tilde_expansion
(
name
,
"/"
,
NULL
);
if
(
tmp
[
0
]
==
'+'
)
name
=
tmp
+
1
;
else
if
(
strncmp
(
tmp
,
"../"
,
3
)
==
0
||
strncmp
(
tmp
,
"./"
,
2
)
==
0
)
{
char
*
cwd
=
mu_getcwd
();
asprintf
(
&
name
,
"%s/%s"
,
cwd
,
tmp
);
free
(
cwd
);
free
(
tmp
);
tmp
=
NULL
;
}
else
name
=
tmp
;
if
(
!
base
)
base
=
mu_path_folder_dir
;
if
(
is_folder
)
asprintf
(
&
p
,
"mh:%s/%s"
,
base
,
name
);
{
if
(
name
[
0
]
==
'/'
)
asprintf
(
&
p
,
"mh:%s"
,
name
);
else
asprintf
(
&
p
,
"mh:%s/%s"
,
base
,
name
);
}
else
if
(
name
[
0
]
!=
'/'
)
asprintf
(
&
p
,
"%s/%s"
,
base
,
name
);
else
return
name
;
free
(
tmp
);
return
p
;
}
...
...
Please
register
or
sign in
to post a comment