mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
dll: fsp_fuse_opt_add_opt: testing
This commit is contained in:
parent
7ea13a967a
commit
3d3dcbe0c5
@ -495,22 +495,24 @@ static int fsp_fuse_opt_add_opt_internal(char **opts, const char *opt, int escap
|
|||||||
newopts = memalloc(optsize + optlen + 1);
|
newopts = memalloc(optsize + optlen + 1);
|
||||||
if (0 == newopts)
|
if (0 == newopts)
|
||||||
return -1;
|
return -1;
|
||||||
memfree(*opts);
|
|
||||||
*opts = newopts;
|
|
||||||
|
|
||||||
if (0 != optsize)
|
if (0 != optsize)
|
||||||
{
|
{
|
||||||
memcpy(newopts, *opts, optsize - 1);
|
memcpy(newopts, *opts, optsize - 1);
|
||||||
newopts[optsize - 1] = ',';
|
newopts[optsize - 1] = ',';
|
||||||
newopts += optsize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memfree(*opts);
|
||||||
|
*opts = newopts;
|
||||||
|
newopts += optsize;
|
||||||
|
|
||||||
for (p = opt; *p; p++, newopts++)
|
for (p = opt; *p; p++, newopts++)
|
||||||
{
|
{
|
||||||
if (escaped && (',' == *p || '\\' == *p))
|
if (escaped && (',' == *p || '\\' == *p))
|
||||||
*newopts++ = '\\';
|
*newopts++ = '\\';
|
||||||
*newopts = *p;
|
*newopts = *p;
|
||||||
}
|
}
|
||||||
|
*newopts = '\0';
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user