1
0
Fork 0
forked from len0rd/rockbox

FS#8795 - Fixed fault of the escape processing in Changelog (by Kenjiro Arai).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17178 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Miika Pekkarinen 2008-04-19 23:48:13 +00:00
parent 5633784f4f
commit 984278b10a
2 changed files with 6 additions and 9 deletions

View file

@ -3157,17 +3157,13 @@ static bool write_tag(int fd, const char *tagstr, const char *datastr)
int i;
snprintf(buf, sizeof buf, "%s=\"", tagstr);
for (i = strlen(buf); i < (long)sizeof(buf)-3; i++)
for (i = strlen(buf); i < (long)sizeof(buf)-4; i++)
{
if (*datastr == '\0')
break;
if (*datastr == '"')
{
buf[i] = '\\';
datastr++;
continue;
}
if (*datastr == '"' || *datastr == '\\')
buf[i++] = '\\';
buf[i] = *(datastr++);
}
@ -3222,9 +3218,9 @@ static bool read_tag(char *dest, long size,
if (*src == '\0')
break;
if (*src == '\\' && *(src+1) == '"')
if (*src == '\\')
{
dest[pos] = '"';
dest[pos] = *(src+1);
src += 2;
continue;
}