mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
Andrey Janzen (virus126):
- Fix warning when using FEATURE_UNIX_FILENAME_COMPLETION. - Make unix-style completion work correctly. - Make %time% return milliseconds/10. svn path=/trunk/; revision=25896
This commit is contained in:
parent
658c2a1911
commit
54cf74f087
3 changed files with 16 additions and 6 deletions
|
@ -1172,7 +1172,7 @@ GetEnvVarOrSpecial ( LPCTSTR varName )
|
||||||
GetSystemTime(&t);
|
GetSystemTime(&t);
|
||||||
_sntprintf ( ret, retlen, _T("%02d%c%02d%c%02d%c%02d"),
|
_sntprintf ( ret, retlen, _T("%02d%c%02d%c%02d%c%02d"),
|
||||||
t.wHour, cTimeSeparator, t.wMinute, cTimeSeparator,
|
t.wHour, cTimeSeparator, t.wMinute, cTimeSeparator,
|
||||||
t.wSecond, cDecimalSeparator, t.wMilliseconds );
|
t.wSecond, cDecimalSeparator, t.wMilliseconds / 10);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
/* %DATE% */
|
/* %DATE% */
|
||||||
|
|
|
@ -139,8 +139,10 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
|
||||||
TCHAR ch;
|
TCHAR ch;
|
||||||
BOOL bContinue=FALSE;/*is TRUE the second case will not be executed*/
|
BOOL bContinue=FALSE;/*is TRUE the second case will not be executed*/
|
||||||
BOOL bReturn = FALSE;
|
BOOL bReturn = FALSE;
|
||||||
TCHAR szPath[MAX_PATH];
|
|
||||||
BOOL bCharInput;
|
BOOL bCharInput;
|
||||||
|
#ifdef FEATURE_4NT_FILENAME_COMPLETION
|
||||||
|
TCHAR szPath[MAX_PATH];
|
||||||
|
#endif
|
||||||
|
|
||||||
/* get screen size */
|
/* get screen size */
|
||||||
GetScreenSize (&maxx, &maxy);
|
GetScreenSize (&maxx, &maxy);
|
||||||
|
|
|
@ -43,7 +43,7 @@ VOID CompleteFilename (LPTSTR str, UINT charcount)
|
||||||
LPCOMMAND cmds_ptr;
|
LPCOMMAND cmds_ptr;
|
||||||
|
|
||||||
/* expand current file name */
|
/* expand current file name */
|
||||||
count = charcount - 1;
|
count = charcount - 1;
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ VOID CompleteFilename (LPTSTR str, UINT charcount)
|
||||||
_tcscpy (path, directory);
|
_tcscpy (path, directory);
|
||||||
|
|
||||||
while (curplace >= 0 && directory[curplace] != _T('\\') &&
|
while (curplace >= 0 && directory[curplace] != _T('\\') &&
|
||||||
|
directory[curplace] != _T('/') &&
|
||||||
directory[curplace] != _T(':'))
|
directory[curplace] != _T(':'))
|
||||||
{
|
{
|
||||||
directory[curplace] = 0;
|
directory[curplace] = 0;
|
||||||
|
@ -205,7 +206,7 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount)
|
||||||
BOOL found_dot = FALSE;
|
BOOL found_dot = FALSE;
|
||||||
INT curplace = 0;
|
INT curplace = 0;
|
||||||
INT start;
|
INT start;
|
||||||
UINT count;
|
INT count;
|
||||||
TCHAR path[MAX_PATH];
|
TCHAR path[MAX_PATH];
|
||||||
TCHAR fname[MAX_PATH];
|
TCHAR fname[MAX_PATH];
|
||||||
TCHAR directory[MAX_PATH];
|
TCHAR directory[MAX_PATH];
|
||||||
|
@ -361,6 +362,7 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix)
|
||||||
TCHAR * szSearch;
|
TCHAR * szSearch;
|
||||||
TCHAR * szSearch1;
|
TCHAR * szSearch1;
|
||||||
TCHAR * szSearch2;
|
TCHAR * szSearch2;
|
||||||
|
TCHAR * szSearch3;
|
||||||
/* number of quotes in the string */
|
/* number of quotes in the string */
|
||||||
INT nQuotes = 0;
|
INT nQuotes = 0;
|
||||||
/* used in for loops */
|
/* used in for loops */
|
||||||
|
@ -395,8 +397,11 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix)
|
||||||
/* Find the one closest to end */
|
/* Find the one closest to end */
|
||||||
szSearch1 = _tcsrchr(str, _T('\"'));
|
szSearch1 = _tcsrchr(str, _T('\"'));
|
||||||
szSearch2 = _tcsrchr(str, _T('\\'));
|
szSearch2 = _tcsrchr(str, _T('\\'));
|
||||||
|
szSearch3 = _tcsrchr(str, _T('.'));
|
||||||
if(szSearch2 != NULL && _tcslen(szSearch1) > _tcslen(szSearch2))
|
if(szSearch2 != NULL && _tcslen(szSearch1) > _tcslen(szSearch2))
|
||||||
szSearch = szSearch2;
|
szSearch = szSearch2;
|
||||||
|
else if(szSearch3 != NULL && _tcslen(szSearch1) > _tcslen(szSearch3))
|
||||||
|
szSearch = szSearch3;
|
||||||
else
|
else
|
||||||
szSearch = szSearch1;
|
szSearch = szSearch1;
|
||||||
/* Move one char past */
|
/* Move one char past */
|
||||||
|
@ -437,8 +442,11 @@ VOID FindPrefixAndSuffix(LPTSTR strIN, LPTSTR szPrefix, LPTSTR szSuffix)
|
||||||
_tcscpy(str,strIN);
|
_tcscpy(str,strIN);
|
||||||
szSearch1 = _tcsrchr(str, _T(' '));
|
szSearch1 = _tcsrchr(str, _T(' '));
|
||||||
szSearch2 = _tcsrchr(str, _T('\\'));
|
szSearch2 = _tcsrchr(str, _T('\\'));
|
||||||
|
szSearch3 = _tcsrchr(str, _T('/'));
|
||||||
if(szSearch2 != NULL && _tcslen(szSearch1) > _tcslen(szSearch2))
|
if(szSearch2 != NULL && _tcslen(szSearch1) > _tcslen(szSearch2))
|
||||||
szSearch = szSearch2;
|
szSearch = szSearch2;
|
||||||
|
else if(szSearch3 != NULL && _tcslen(szSearch1) > _tcslen(szSearch3))
|
||||||
|
szSearch = szSearch3;
|
||||||
else
|
else
|
||||||
szSearch = szSearch1;
|
szSearch = szSearch1;
|
||||||
szSearch++;
|
szSearch++;
|
||||||
|
|
Loading…
Reference in a new issue