Added a better test for './' and changed a few other things about the

correct_dir_fullname() function.

Ian
This commit is contained in:
Ian Main 1998-01-11 04:03:32 +00:00
parent 75b20f2eaf
commit 24cfae7295

View File

@ -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)