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
d12f61a6
...
d12f61a65fbd800b1b74b7ee1d1bd8bbf9950cc7
authored
2004-01-05 18:08:38 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mu_true_answer_p): New function.
1 parent
d57538cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
include/mailutils/mutil.h
mailbox/mutil.c
include/mailutils/mutil.h
View file @
d12f61a
...
...
@@ -125,7 +125,9 @@ extern int munre_set_regex __P((char *str, int caseflag, char **errp));
extern
int
munre_subject
__P
((
const
char
*
subject
,
const
char
**
new_subject
));
extern
char
*
mu_charset_lookup
__P
((
char
*
lang
,
char
*
terr
));
extern
int
mu_true_answer_p
__P
((
const
char
*
p
));
#ifdef __cplusplus
}
#endif
...
...
mailbox/mutil.c
View file @
d12f61a
...
...
@@ -49,6 +49,7 @@
#include <mailutils/header.h>
#include <mailutils/message.h>
#include <mailutils/envelope.h>
#include <mailutils/nls.h>
/* convert a sequence of hex characters into an integer */
...
...
@@ -758,6 +759,7 @@ mu_unroll_symlink (char *out, size_t outsz, const char *in)
---------+------------
%u user name
%h user's home dir
~ Likewise
---------+------------
Allocates memory.
...
...
@@ -773,7 +775,17 @@ mu_expand_path_pattern (const char *pattern, const char *username)
for
(
p
=
pattern
;
*
p
;
p
++
)
{
if
(
*
p
==
'%'
)
if
(
*
p
==
'~'
)
{
if
(
!
auth
)
{
auth
=
mu_get_auth_by_name
(
username
);
if
(
!
auth
)
return
NULL
;
}
len
+=
strlen
(
auth
->
dir
);
}
else
if
(
*
p
==
'%'
)
switch
(
*++
p
)
{
case
'u'
:
...
...
@@ -1114,3 +1126,29 @@ mu_string_unfold (char *text, size_t *plen)
*
plen
=
p
-
text
;
return
0
;
}
int
mu_true_answer_p
(
const
char
*
p
)
{
if
(
!
p
)
return
-
1
;
/* TRANSLATORS: This is a list of characters which start
an affirmative answer. Whenever possible, please preserve
'yY' in your translation, e.g., for Euskara:
msgstr "yYbB";
*/
if
(
strchr
(
_
(
"yY"
),
*
p
))
return
1
;
/* TRANSLATORS: This is a list of characters which start
a negative answer. Whenever possible, please preserve
'nN' in your translation, e.g., for Euskara:
msgstr "nNeE";
*/
else
if
(
strchr
(
_
(
"nN"
),
*
p
))
return
0
;
return
-
1
;
}
...
...
Please
register
or
sign in
to post a comment