--- sourceforge.net/trunk/rdesktop/rdesktop.c 2004/01/23 14:37:51 582 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2004/02/16 20:28:09 609 @@ -69,6 +69,7 @@ BOOL g_console_session = False; BOOL g_numlock_sync = False; extern BOOL g_owncolmap; +extern BOOL g_ownbackstore; #ifdef WITH_RDPSND BOOL g_rdpsnd = False; @@ -107,6 +108,7 @@ fprintf(stderr, " -g: desktop geometry (WxH)\n"); fprintf(stderr, " -f: full-screen mode\n"); fprintf(stderr, " -b: force bitmap updates\n"); + fprintf(stderr, " -B: use BackingStore of X-server (if available)\n"); fprintf(stderr, " -e: disable encryption (French TS)\n"); fprintf(stderr, " -E: disable encryption from client to server\n"); fprintf(stderr, " -m: do not send motion events\n"); @@ -251,7 +253,7 @@ #define VNCOPT #endif - while ((c = getopt(argc, argv, VNCOPT "u:d:s:c:p:n:k:g:fbeEmCDKS:T:Na:r:045h?")) != -1) + while ((c = getopt(argc, argv, VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:Na:r:045h?")) != -1) { switch (c) { @@ -347,6 +349,10 @@ g_orders = False; break; + case 'B': + g_ownbackstore = False; + break; + case 'e': g_encryption = False; break; @@ -732,7 +738,9 @@ } /* - input: src is the string we look in for needle + input: src is the string we look in for needle. + Needle may be escaped by a backslash, in + that case we ignore that particular needle. return value: returns next src pointer, for succesive executions, like in a while loop if retval is 0, then there are no more args. @@ -814,43 +822,35 @@ #define LTOA_BUFSIZE (sizeof(long) * 8 + 1) char * -ltoa(long N, int base) +l_to_a(long N, int base) { static char ret[LTOA_BUFSIZE]; - register int i = 2; - long uarg; - char *tail, *head = ret, buf[LTOA_BUFSIZE]; + char *head = ret, buf[LTOA_BUFSIZE], *tail = buf + sizeof(buf); - if (36 < base || 2 > base) - base = 10; + register int divrem; - tail = &buf[LTOA_BUFSIZE - 1]; - *tail-- = '\0'; + if (base < 36 || 2 > base) + base = 10; - if (10 == base && N < 0L) + if (N < 0) { *head++ = '-'; - uarg = -N; + N = -N; } - else - uarg = N; - if (uarg) - { - for (i = 1; uarg; ++i) - { - register ldiv_t r; + tail = buf + sizeof(buf); + *--tail = 0; - r = ldiv(uarg, base); - *tail-- = (char) (r.rem + ((9L < r.rem) ? ('A' - 10L) : '0')); - uarg = r.quot; - } + do + { + divrem = N % base; + *--tail = (divrem <= 9) ? divrem + '0' : divrem + 'a' - 10; + N /= base; } - else - *tail-- = '0'; + while (N); - memcpy(head, ++tail, i); + strcpy(head, tail); return ret; }