Launcher: Replace ~/ by $HOME/
This commit is contained in:
parent
e723c03fe3
commit
39ef26690c
@ -275,7 +275,17 @@ complete_on_files(char *start, size_t hits)
|
||||
path = _strdup(".");
|
||||
else
|
||||
{
|
||||
dirname = _strdup(p);
|
||||
/* remplace ~ by $HOME in dirname */
|
||||
if (!strncmp(p, "~/", 2) && getenv("HOME"))
|
||||
asprintf(&dirname, "%s%s", getenv("HOME"), p+1);
|
||||
else
|
||||
dirname = _strdup(p);
|
||||
|
||||
/* Set p to filename to be complete
|
||||
* and path the directory containing the file
|
||||
* /foooooo/baaaaaar/somethinglikethis<tab>
|
||||
* <---- path - ---><------- p ------>
|
||||
*/
|
||||
p = strrchr(dirname, '/');
|
||||
if (p != dirname)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user