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
8b40ce89
...
8b40ce8956e22a135ffb3336f2cb6b60dd8fd111
authored
2002-06-27 09:13:21 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(make_progfile_name): moved to mailbox/mutil.c:mu_expand_path_pattern
1 parent
96a185d6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
74 deletions
mail.local/main.c
mail.local/main.c
View file @
8b40ce8
...
...
@@ -240,80 +240,6 @@ main (int argc, char *argv[])
return
exit_code
;
}
char
*
make_progfile_name
(
char
*
pattern
,
char
*
username
)
{
char
*
homedir
=
NULL
;
char
*
p
,
*
q
,
*
startp
;
char
*
progfile
;
int
len
=
0
;
for
(
p
=
pattern
;
*
p
;
p
++
)
{
if
(
*
p
==
'%'
)
switch
(
*++
p
)
{
case
'u'
:
len
+=
strlen
(
username
);
break
;
case
'h'
:
if
(
!
homedir
)
{
struct
passwd
*
pwd
=
mu_getpwnam
(
username
);
if
(
!
pwd
)
return
NULL
;
homedir
=
pwd
->
pw_dir
;
}
len
+=
strlen
(
homedir
);
break
;
case
'%'
:
len
++
;
break
;
default:
len
+=
2
;
}
else
len
++
;
}
progfile
=
malloc
(
len
+
1
);
if
(
!
progfile
)
return
NULL
;
startp
=
pattern
;
q
=
progfile
;
while
(
*
startp
&&
(
p
=
strchr
(
startp
,
'%'
))
!=
NULL
)
{
memcpy
(
q
,
startp
,
p
-
startp
);
q
+=
p
-
startp
;
switch
(
*++
p
)
{
case
'u'
:
strcpy
(
q
,
username
);
q
+=
strlen
(
username
);
break
;
case
'h'
:
strcpy
(
q
,
homedir
);
q
+=
strlen
(
homedir
);
break
;
case
'%'
:
*
q
++
=
'%'
;
break
;
default:
*
q
++
=
'%'
;
*
q
++
=
*
p
;
}
startp
=
p
+
1
;
}
if
(
*
startp
)
{
strcpy
(
q
,
startp
);
q
+=
strlen
(
startp
);
}
*
q
=
0
;
return
progfile
;
}
int
mda
(
FILE
*
fp
,
char
*
username
)
{
...
...
Please
register
or
sign in
to post a comment