winemenubuilder: eliminate wineshelllink (try 5)

Alexandre Julliard julliard at winehq.org
Tue Sep 16 06:30:44 CDT 2008


"Damjan Jovanovic" <damjan.jov at gmail.com> writes:

> +    do
> +    {
> +        line = HeapAlloc(GetProcessHeap(), 0, size);
> +        if (!line)
> +            return NULL;
> +        ret = fgets(line, size, file);
> +        if (ret != NULL)
> +        {
> +            if (strlen(line) < size - 1)
> +                return line;
> +            size *= 2;
> +        }
> +        HeapFree(GetProcessHeap(), 0, line);
> +    } while (ret != NULL);

This won't do what you want.

> +        char *line;
> +        while ((line = next_line(originalMenu)) != NULL)
> +        {
> +            if (strstr(line, "<Filename>"))
> +            {
> +                if (strstr(line, name))
> +                    found = TRUE;
> +                fprintf(tempfile, "%s", line);
> +            }

strstr is not appropriate for comparing file names. Also you are leaking
memory here.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list