Handle ~~ in tab comp without segfaulting =)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
184e1a6a4e
commit
2773184d92
5
files.c
5
files.c
|
@ -534,8 +534,9 @@ char *real_dir_from_tilde (char *buf)
|
||||||
int fd, i, status, searchctr = 1;
|
int fd, i, status, searchctr = 1;
|
||||||
|
|
||||||
if (buf[0] == '~') {
|
if (buf[0] == '~') {
|
||||||
|
if (buf[1] == '~')
|
||||||
if (buf[1] == '/') {
|
goto abort; /* Handle ~~ without segfaulting =) */
|
||||||
|
else if (buf[1] == '/') {
|
||||||
if (getenv("HOME") != NULL) {
|
if (getenv("HOME") != NULL) {
|
||||||
dirtmp = nmalloc(strlen(buf) + 2 + strlen(getenv("HOME")));
|
dirtmp = nmalloc(strlen(buf) + 2 + strlen(getenv("HOME")));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue