Patch by Jens Collin <jens.collin@lakhei.com>

Fixes autocompletion, see bug #177

svn path=/trunk/; revision=10002
This commit is contained in:
Gé van Geldorp 2004-07-05 22:12:45 +00:00
parent 1b16d86ba8
commit ad83568979

View file

@ -14,6 +14,10 @@
* *
* 30-Apr-2004 (Filip Navara <xnavara@volny.cz>) * 30-Apr-2004 (Filip Navara <xnavara@volny.cz>)
* Make the file listing readable when there is a lot of long names. * Make the file listing readable when there is a lot of long names.
*
* 05-Jul-2004 (Jens Collin <jens.collin@lakhei.com>)
* Now expands lfn even when trailing " is omitted.
*/ */
#include "config.h" #include "config.h"
@ -37,6 +41,7 @@ VOID CompleteFilename (LPTSTR str, INT charcount)
INT curplace = 0; INT curplace = 0;
INT start; INT start;
INT count; INT count;
INT step, c;
BOOL found_dot = FALSE; BOOL found_dot = FALSE;
BOOL perfectmatch = TRUE; BOOL perfectmatch = TRUE;
TCHAR path[MAX_PATH]; TCHAR path[MAX_PATH];
@ -50,8 +55,18 @@ VOID CompleteFilename (LPTSTR str, INT charcount)
if (count < 0) if (count < 0)
count = 0; count = 0;
/* find how many '"'s there is typed already.*/
step = count;
while (step > 0)
{
if (str[step] == _T('"'))
c++;
step--;
}
/* if c is odd, then user typed " before name, else not.*/
/* find front of word */ /* find front of word */
if (str[count] == _T('"')) if (str[count] == _T('"') || (c % 2))
{ {
count--; count--;
while (count > 0 && str[count] != _T('"')) while (count > 0 && str[count] != _T('"'))