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
b4cdd7ae
...
b4cdd7ae98e7faa03dab3d17b5a9c99522e4df52
authored
2002-08-22 11:18:31 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mu_tilde_expansion): Bugfix. Was freeing passed homedir, which caused grief later.
1 parent
ab57485c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
mailbox/mutil.c
mailbox/mutil.c
View file @
b4cdd7a
...
...
@@ -351,6 +351,7 @@ char *
mu_tilde_expansion
(
const
char
*
ref
,
const
char
*
delim
,
const
char
*
homedir
)
{
char
*
p
=
strdup
(
ref
);
char
*
home
=
NULL
;
if
(
*
p
==
'~'
)
{
...
...
@@ -360,16 +361,16 @@ mu_tilde_expansion (const char *ref, const char *delim, const char *homedir)
char
*
s
;
if
(
!
homedir
)
{
home
dir
=
mu_get_homedir
();
if
(
!
home
dir
)
home
=
mu_get_homedir
();
if
(
!
home
)
return
NULL
;
homedir
=
home
;
}
s
=
calloc
(
strlen
(
homedir
)
+
strlen
(
p
)
+
1
,
1
);
strcpy
(
s
,
homedir
);
strcat
(
s
,
p
);
free
(
--
p
);
p
=
s
;
free
(
homedir
);
}
else
{
...
...
@@ -397,6 +398,8 @@ mu_tilde_expansion (const char *ref, const char *delim, const char *homedir)
p
--
;
}
}
if
(
home
)
free
(
home
);
return
p
;
}
...
...
Please
register
or
sign in
to post a comment