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
493ff8a9
...
493ff8a93db4f17c84c91d2887696920fb283587
authored
2001-06-22 16:32:35 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
use mu_tilde_expansion()
1 parent
2861429f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
37 deletions
imap4d/util.c
imap4d/util.c
View file @
493ff8a
...
...
@@ -112,43 +112,7 @@ util_unquote (char **ptr)
char
*
util_tilde_expansion
(
const
char
*
ref
,
const
char
*
delim
)
{
char
*
p
=
strdup
(
ref
);
if
(
*
p
==
'~'
)
{
p
++
;
if
(
*
p
==
delim
[
0
]
||
*
p
==
'\0'
)
{
char
*
s
=
calloc
(
strlen
(
homedir
)
+
strlen
(
p
)
+
1
,
1
);
strcpy
(
s
,
homedir
);
strcat
(
s
,
p
);
free
(
--
p
);
p
=
s
;
}
else
{
struct
passwd
*
pw
;
char
*
s
=
p
;
char
*
name
;
while
(
*
s
&&
*
s
!=
delim
[
0
])
s
++
;
name
=
calloc
(
s
-
p
+
1
,
1
);
memcpy
(
name
,
p
,
s
-
p
);
name
[
s
-
p
]
=
'\0'
;
pw
=
getpwnam
(
name
);
free
(
name
);
if
(
pw
)
{
char
*
buf
=
calloc
(
strlen
(
pw
->
pw_dir
)
+
strlen
(
s
)
+
1
,
1
);
strcpy
(
buf
,
pw
->
pw_dir
);
strcat
(
buf
,
s
);
free
(
--
p
);
p
=
buf
;
}
else
p
--
;
}
}
return
p
;
return
mu_tilde_expansion
(
ref
,
delim
,
homedir
);
}
/* util_normalize_path: convert pathname containig relative paths specs (../)
...
...
Please
register
or
sign in
to post a comment