diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 018a8e01221..49548de73ca 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -519,6 +519,8 @@ HANDLE hff; /* If 2nd parm is directory, then use original filename */ GetFullPathName (param2, sizeof(outpath), outpath, NULL); + if (outpath[strlen(outpath) - 1] == '\\') + outpath[strlen(outpath) - 1] = '\0'; hff = FindFirstFile (outpath, &fd); if (hff != INVALID_HANDLE_VALUE) { if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {