qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] vvfat mbr fixes


From: Johannes Schindelin
Subject: Re: [Qemu-devel] Re: [PATCH] vvfat mbr fixes
Date: Sun, 23 Sep 2007 12:34:46 +0100 (BST)

Hi,

On Sun, 23 Sep 2007, Lorenzo Campedelli wrote:

> While you are working on vvfat issues, could you give a look to the 
> attached small patch?

Okay, this is what I would do:

- not make this handling dependent on vvfat (but this means checking if 
  the colon is the second character, because then it is most likely 
  a Windows path and does _not_ want special handling), and

- I'd use the result of strrchr() directly.

This is a sketch of the code I propose:

        const char *tmp;

        ...

        get_tmp_filename(tmp_filename, sizeof(tmp_filename));
        /* Handle 'fat:rw:<filename>' */
        tmp = strrchr(backing_filename, ':');
        if (tmp - backing_filename == 2) /* DOS path */
                tmp = NULL;
        else if (tmp - backing_filename > 2 && tmp[-2] == ':')
                tmp -= 2;
        realpath(filename, tmp ? tmp : backing_filename);

Ciao,
Dscho





reply via email to

[Prev in Thread] Current Thread [Next in Thread]