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
b8c2da9d
...
b8c2da9dab90d25fab6c44c3474ab990eec0e36a
authored
2001-06-22 16:38:32 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added util_get_homedir() and util_fullpath().
1 parent
72a44d34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
mail/util.c
mail/util.c
View file @
b8c2da9
...
...
@@ -234,14 +234,24 @@ util_do_command (const char *c, ...)
if
(
vasprintf
(
&
cmd
,
c
,
ap
)
<
1
)
return
0
;
if
(
cmd
)
{
struct
mail_command_entry
entry
;
if
(
cmd
[
0
]
==
'#'
)
return
0
;
if
(
cmd
)
{
if
(
argcv_get
(
cmd
,
&
argc
,
&
argv
)
!=
0
)
return
argcv_free
(
argc
,
argv
);
command
=
util_command_get
(
argv
[
0
]);
entry
=
util_find_entry
(
argv
[
0
]);
if
(
if_cond
()
==
0
&&
entry
.
isflow
==
0
)
{
argcv_free
(
argc
,
argv
);
return
0
;
}
command
=
entry
.
func
;
}
else
command
=
util_command_get
(
"quit"
);
...
...
@@ -537,3 +547,24 @@ readline (const char *prompt)
}
}
#endif
char
*
util_get_homedir
()
{
char
*
homedir
=
mu_get_homedir
();
if
(
!
homedir
)
{
/* Shouldn't happen, but one never knows */
fprintf
(
ofile
,
"can't get homedir
\n
"
);
exit
(
EXIT_FAILURE
);
}
return
strdup
(
homedir
);
}
char
*
util_fullpath
(
char
*
inpath
)
{
return
mu_tilde_expansion
(
inpath
,
"/"
,
NULL
);
}
...
...
Please
register
or
sign in
to post a comment