From: Chris Allegretta Date: Tue, 28 Nov 2000 05:53:41 +0000 (+0000) Subject: Handle ~~ in tab comp without segfaulting =) X-Git-Tag: v0.9.22~36 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=2773184d92f52d93deb7f04e27f4ea377ee7ecd4;p=nano.git Handle ~~ in tab comp without segfaulting =) git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@339 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/files.c b/files.c index 1f72d3f9..3cc2dfc6 100644 --- 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")));