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
2671de1b
...
2671de1b56501d14d8f54f8608a580af48f513d4
authored
2004-01-13 15:14:26 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(_url_path_init): Moved from ../url_path.c
1 parent
417a1a49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
mailbox/mbox/url.c
mailbox/mbox/url.c
View file @
2671de1
...
...
@@ -255,3 +255,44 @@ _url_mbox_init (url_t url)
return
0
;
}
static
void
url_path_destroy
(
url_t
url
ARG_UNUSED
)
{
}
int
_url_path_init
(
url_t
url
)
{
const
char
*
name
=
url_to_string
(
url
);
const
char
*
path
;
/* reject the obvious */
if
(
name
==
NULL
||
*
name
==
'\0'
)
return
EINVAL
;
mu_scheme_autodetect_p
(
name
,
&
path
);
name
=
strdup
(
path
);
free
(
url
->
name
);
url
->
name
=
name
;
/* TYPE */
url
->
_destroy
=
url_path_destroy
;
/* SCHEME */
url
->
scheme
=
strdup
(
MU_PATH_SCHEME
);
if
(
url
->
scheme
==
NULL
)
{
url_path_destroy
(
url
);
return
ENOMEM
;
}
/* PATH */
url
->
path
=
strdup
(
name
);
if
(
url
->
path
==
NULL
)
{
url_path_destroy
(
url
);
return
ENOMEM
;
}
return
0
;
}
...
...
Please
register
or
sign in
to post a comment