--- sourceforge.net/trunk/rdesktop/rdesktop.c 2004/07/30 08:25:54 739 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2004/11/18 11:18:49 800 @@ -35,11 +35,7 @@ #include /* sockaddr_un */ #endif -#ifdef WITH_OPENSSL #include -#else -#include "crypto/md5.h" -#endif char g_title[64] = ""; char g_username[64]; @@ -53,6 +49,8 @@ absolute value specifies the percent of the whole screen. */ int g_height = 600; +int g_xpos = 0; +int g_ypos = 0; extern int g_tcp_port_rdp; int g_server_bpp = 8; int g_win_button_size = 0; /* If zero, disable single app mode */ @@ -126,6 +124,7 @@ fprintf(stderr, " -N: enable numlock syncronization\n"); fprintf(stderr, " -X: embed into another window with a given id.\n"); fprintf(stderr, " -a: connection colour depth\n"); + fprintf(stderr, " -z: enable rdp compression\n"); fprintf(stderr, " -x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex nr.)\n"); fprintf(stderr, " -P: use persistent bitmap caching\n"); fprintf(stderr, " -r: enable specified device redirection (this flag can be repeated)\n"); @@ -133,8 +132,8 @@ " '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n"); fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n"); fprintf(stderr, - " '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n"); - fprintf(stderr, " or A=/mnt/floppy,D=/mnt/cdrom'\n"); + " '-r disk:floppy=/mnt/floppy': enable redirection of /mnt/floppy to 'floppy' share\n"); + fprintf(stderr, " or 'floppy=/mnt/floppy,cdrom=/mnt/cdrom'\n"); fprintf(stderr, " '-r clientname=': Set the client name displayed\n"); fprintf(stderr, " for redirected disks\n"); fprintf(stderr, @@ -367,7 +366,7 @@ #endif while ((c = getopt(argc, argv, - VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:NX:a:x:Pr:045h?")) != -1) + VNCOPT "u:d:s:c:p:n:k:g:fbBeEmzCDKS:T:NX:a:x:Pr:045h?")) != -1) { switch (c) { @@ -442,7 +441,7 @@ } if (*p == 'x') - g_height = strtol(p + 1, NULL, 10); + g_height = strtol(p + 1, &p, 10); if (g_height <= 0) { @@ -451,7 +450,16 @@ } if (*p == '%') + { g_width = -g_width; + p++; + } + + if (*p == '+' || *p == '-') + g_xpos = strtol(p, &p, 10); + + if (*p == '+' || *p == '-') + g_ypos = strtol(p, NULL, 10); break; @@ -528,8 +536,12 @@ } break; - case 'x': + case 'z': + DEBUG(("rdp compression enabled\n")); + flags |= RDP_COMPRESSION; + break; + case 'x': if (strncmp("modem", optarg, 1) == 0) { g_rdp5_performanceflags = @@ -851,7 +863,11 @@ void * xrealloc(void *oldmem, int size) { - void *mem = realloc(oldmem, size); + void *mem; + + if (size < 1) + size = 1; + mem = realloc(oldmem, size); if (mem == NULL) { error("xrealloc %d\n", size);