]> git.wh0rd.org Git - nano.git/commitdiff
Handle ~~ in tab comp without segfaulting =)
authorChris Allegretta <chrisa@asty.org>
Tue, 28 Nov 2000 05:53:41 +0000 (05:53 +0000)
committerChris Allegretta <chrisa@asty.org>
Tue, 28 Nov 2000 05:53:41 +0000 (05:53 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

files.c

diff --git a/files.c b/files.c
index 1f72d3f9f345ab9020b9f33fd455bde90ee91484..3cc2dfc62d039dde63d00dded8fda8b63cc3ddc8 100644 (file)
--- 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")));