From 24cfae7295e7dd4a213b2f31f53095dafddec366 Mon Sep 17 00:00:00 2001 From: Ian Main Date: Sun, 11 Jan 1998 04:03:32 +0000 Subject: [PATCH] Added a better test for './' and changed a few other things about the correct_dir_fullname() function. Ian --- gtk/gtkfilesel.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index c90e96c83..e5abad837 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -1560,9 +1560,18 @@ correct_dir_fullname(CompletionDir* cmpl_dir) struct stat sbuf; if (strcmp(cmpl_dir->fullname + length - 2, "/.") == 0) - cmpl_dir->fullname[length - 2] = 0; + { + if (length == 2) + { + strcpy(cmpl_dir->fullname, "/"); + cmpl_dir->fullname_len = 1; + return TRUE; + } else { + cmpl_dir->fullname[length - 2] = 0; + } + } else if (strcmp(cmpl_dir->fullname + length - 3, "/./") == 0) - cmpl_dir->fullname[length - 3] = 0; + cmpl_dir->fullname[length - 2] = 0; else if (strcmp(cmpl_dir->fullname + length - 3, "/..") == 0) { if(length == 3)