--- sourceforge.net/trunk/rdesktop/rdesktop.c 2004/01/21 14:40:40 569 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2004/01/21 18:17:20 571 @@ -26,6 +26,7 @@ #include /* stat */ #include /* gettimeofday */ #include /* times */ +#include /* toupper */ #include #include "rdesktop.h" @@ -748,13 +749,22 @@ 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; @@ -767,12 +777,12 @@ } -char * -toupper(char* p) +void +toupper_str(char* p) { while( *p ){ if( (*p >= 'a') && (*p <= 'z') ) - *p = *p - 32; + *p = toupper((int) *p); p++; } }