From 7e2d1b4ade7c4f2d6975e959131aaef6937d6b27 Mon Sep 17 00:00:00 2001 From: Jason Edmeades Date: Thu, 5 Apr 2007 22:47:58 +0100 Subject: [PATCH] cmd.exe: Partially fix 'dir *.' (ie files with no extension). --- programs/cmd/directory.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c index 95c64a16a5f..ac1e59d5eda 100644 --- a/programs/cmd/directory.c +++ b/programs/cmd/directory.c @@ -316,7 +316,6 @@ void WCMD_directory (char *cmd) { WINE_TRACE("Using location '%s'\n", fullname); status = GetFullPathName (fullname, sizeof(path), path, NULL); - WINE_TRACE("Using path '%s'\n", path); /* * If the path supplied does not include a wildcard, and the endpoint of the @@ -333,8 +332,13 @@ void WCMD_directory (char *cmd) { strcat (path, "\\*"); } } + } else { + /* Special case wildcard search with no extension (ie parameters ending in '.') as + GetFullPathName strips off the additional '.' */ + if (fullname[strlen(fullname)-1] == '.') strcat(path, "."); } + WINE_TRACE("Using path '%s'\n", path); thisEntry = (DIRECTORY_STACK *) HeapAlloc(GetProcessHeap(),0,sizeof(DIRECTORY_STACK)); if (fullParms == NULL) fullParms = thisEntry; if (prevEntry != NULL) prevEntry->next = thisEntry;