Fix SERIOUS bug in winecfg

James Hawkins truiken at gmail.com
Mon Oct 24 20:33:46 CDT 2005


On 10/24/05, Mike Hearn <mike at plan99.net> wrote:
> +
> +            if ('A' + i != 'Z')
> +            {
> +                struct drive swapbuf;
> +
> +                /* the root drive must be letter Z for now, the unixfs seems to expect it */
> +                WINE_TRACE("attempting to remap / to drive Z:\n");
> +
> +                /* if Z is already used, we need to swap Z and this drive around */
> +                if (drives['Z' - 'A'].in_use)
> +                {
> +                    swapbuf = drives['Z' - 'A'];
> +                    drives['Z' - 'A'] = drives[i];
> +                    drives[i] = swapbuf;
> +                }
> +                else
> +                {
> +                    drives['Z' - 'A'] = drives[i];
> +                    drives[i].in_use = FALSE;
> +                }
> +            }

Couldn't we check that Z points to / already before we swap the
drives?  If Z already points to /, then we would drop the current
letter we're adding; otherwise, wouldn't we have two drive letters
mapping to /?  Besides that point, it looks good to me.

--
James Hawkins



More information about the wine-devel mailing list