From fdb70af10b255002f4ce9a00b66eb2b6c44ed08c Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 17 Sep 2005 18:56:16 +0000 Subject: [PATCH] Bug fix dir *. it only show folders svn path=/trunk/; revision=17898 --- reactos/subsys/system/cmd/dir.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/reactos/subsys/system/cmd/dir.c b/reactos/subsys/system/cmd/dir.c index 2c21d11e178..e7ef5001704 100644 --- a/reactos/subsys/system/cmd/dir.c +++ b/reactos/subsys/system/cmd/dir.c @@ -240,6 +240,8 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */ BOOL bPNegative; /* Negative switch parameter */ BOOL bIntoQuotes; /* A flag showing if we are in quotes (") */ LPTSTR ptrLast; /* A pointer to the last character of param */ + INT t = 0; + /* Initialize variables; */ cCurSwitch = _T(' '); @@ -258,6 +260,32 @@ DirReadParam(LPTSTR Line, /* [IN] The line with the parameters & switches */ lpFlags->stOrderBy.bParSetted = TRUE; lpFlags->stTimeField.bParSetted = TRUE; + + /* Add correct handling of *. */ + for(t=0;t<_tcslen(Line);t++) + { + static INT count=0; + + if ((count==0) && (Line[t]==_T('*'))) + count++; + + else if ((count==1) && (Line[t]==_T('.'))) + count++; + + else if ((count==2) && (Line[t]==_T('*'))) + count++; + + else if (!_istspace(Line[t])) + { + if (count==2) + lpFlags->bWideListColSort = ! bNegative; + count=-1; + } + } + + + + /* Main Loop (see README_DIR.txt) */ /* scan the command line char per char, and we process its char */ while (*Line)