* source.c (openp): Expand tilde in path entries.
This commit is contained in:
parent
b887615911
commit
ebd86fb568
2 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2012-05-30 Thiago Jung Bauermann <thiago.bauermann@linaro.org>
|
||||||
|
|
||||||
|
* source.c (openp): Expand tilde in path entries.
|
||||||
|
|
||||||
2012-05-29 Doug Evans <dje@google.com>
|
2012-05-29 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
* buildsym.c (block_compar): Fix comment.
|
* buildsym.c (block_compar): Fix comment.
|
||||||
|
|
19
gdb/source.c
19
gdb/source.c
|
@ -769,6 +769,25 @@ openp (const char *path, int opts, const char *string,
|
||||||
}
|
}
|
||||||
strcpy (filename, current_directory);
|
strcpy (filename, current_directory);
|
||||||
}
|
}
|
||||||
|
else if (strchr(dir, '~'))
|
||||||
|
{
|
||||||
|
/* See whether we need to expand the tilde. */
|
||||||
|
int newlen;
|
||||||
|
char *tilde_expanded;
|
||||||
|
|
||||||
|
tilde_expanded = tilde_expand (dir);
|
||||||
|
|
||||||
|
/* First, realloc the filename buffer if too short. */
|
||||||
|
len = strlen (tilde_expanded);
|
||||||
|
newlen = len + strlen (string) + 2;
|
||||||
|
if (newlen > alloclen)
|
||||||
|
{
|
||||||
|
alloclen = newlen;
|
||||||
|
filename = alloca (alloclen);
|
||||||
|
}
|
||||||
|
strcpy (filename, tilde_expanded);
|
||||||
|
xfree (tilde_expanded);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Normal file name in path -- just use it. */
|
/* Normal file name in path -- just use it. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue