[Top][All Lists]
[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
Re: [Qemu-devel] [PATCH] vvfat mbr fixes, Ivan Kalvachev, 2007/09/24
- Re: [Qemu-devel] [PATCH] vvfat mbr fixes, Johannes Schindelin, 2007/09/24
- Re: [Qemu-devel] [PATCH] vvfat mbr fixes, Ivan Kalvachev, 2007/09/24
- Re: [Qemu-devel] [PATCH] vvfat mbr fixes, Johannes Schindelin, 2007/09/24
- Re: [Qemu-devel] [PATCH] vvfat mbr fixes, Ivan Kalvachev, 2007/09/24
- [Qemu-devel] Re: [PATCH] vvfat mbr fixes, Lorenzo Campedelli, 2007/09/24
- [Qemu-devel] Re: [PATCH] vvfat mbr fixes, Johannes Schindelin, 2007/09/24