next_arg modified to support escaping of needles with backslash. ( you may need two dep. on your shell. )
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@570 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
00af04fa57
commit
457653ccff
13
rdesktop.c
13
rdesktop.c
@ -749,13 +749,22 @@ char *
|
||||
next_arg(char *src, char needle)
|
||||
{
|
||||
char *nextval;
|
||||
char *p;
|
||||
|
||||
// EOS
|
||||
if (*src == (char) 0x00)
|
||||
return 0;
|
||||
|
||||
// more args available.
|
||||
nextval = strchr(src, needle);
|
||||
p = src;
|
||||
// skip escaped needles.
|
||||
while( (nextval = strchr(p, needle) ) )
|
||||
{
|
||||
if( *(nextval-1) != '\\' )
|
||||
break;
|
||||
p = nextval +1;
|
||||
}
|
||||
|
||||
// more args available
|
||||
if (nextval)
|
||||
{
|
||||
*nextval = (char) 0x00;
|
||||
|
Loading…
Reference in New Issue
Block a user