commit 2773184d92f52d93deb7f04e27f4ea377ee7ecd4
parent 184e1a6a4e58090d8104bde20f017f874fad0bff
Author: Chris Allegretta <chrisa@asty.org>
Date: Tue, 28 Nov 2000 05:53:41 +0000
Handle ~~ in tab comp without segfaulting =)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/files.c b/files.c
@@ -534,8 +534,9 @@ char *real_dir_from_tilde (char *buf)
int fd, i, status, searchctr = 1;
if (buf[0] == '~') {
-
- if (buf[1] == '/') {
+ if (buf[1] == '~')
+ goto abort; /* Handle ~~ without segfaulting =) */
+ else if (buf[1] == '/') {
if (getenv("HOME") != NULL) {
dirtmp = nmalloc(strlen(buf) + 2 + strlen(getenv("HOME")));