cmd: handle spaces in directory names in del /s

Alexandre Julliard julliard at winehq.org
Tue Apr 26 10:20:36 CDT 2011


Dan Kegel <dank at kegel.com> writes:

> @@ -771,13 +771,16 @@ BOOL WCMD_delete (WCHAR *command, BOOL expectDir) {
>  
>                  DIRECTORY_STACK *nextDir;
>                  WCHAR subParm[MAX_PATH];
> +                static const WCHAR quoteW[] = { '"', 0 };
>  
>                  /* Work out search parameter in sub dir */
> -                strcpyW (subParm, thisDir);
> +                strcpyW (subParm, quoteW);
> +                strcatW (subParm, thisDir);
>                  strcatW (subParm, fd.cFileName);
>                  strcatW (subParm, slashW);
>                  strcatW (subParm, fname);
>                  strcatW (subParm, ext);
> +                strcatW (subParm, quoteW);

That's ugly. File names should not go through command processing again.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list