summaryrefslogtreecommitdiff
path: root/rx
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:16 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:16 +0000
commit602b63c5d9961b7776e0e830dc4ed026380f6dc9 (patch)
tree58edc60fbb69308bf987e935228d53c963a561dc /rx
parent634bfc0b47a1a0c613c5d1890fa465fc96818d26 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16
Diffstat (limited to 'rx')
-rw-r--r--rx/XDpyName.c13
-rw-r--r--rx/XUrls.c26
2 files changed, 25 insertions, 14 deletions
diff --git a/rx/XDpyName.c b/rx/XDpyName.c
index 0a5c006..106f2e3 100644
--- a/rx/XDpyName.c
+++ b/rx/XDpyName.c
@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization from
The Open Group.
*/
+/* $XFree86: xc/programs/xrx/rx/XDpyName.c,v 1.7 2003/10/24 20:38:22 tsi Exp $ */
#ifdef XP_UNIX
#include "RxPlugin.h" /* for PluginGlobal */
@@ -68,9 +69,7 @@ The Open Group.
* Compute the number of bytes for a STRING representation
*/
-#define STRING_BYTES(_str) (2 + (_str ? strlen (_str) : 0) + \
- PAD64 (2 + (_str ? strlen (_str) : 0)))
-
+#define STRING_BYTES(_str) (2 + strlen(_str) + PAD64(2 + strlen(_str)))
#define SKIP_STRING(_pBuf, _swap) \
@@ -94,7 +93,7 @@ The Open Group.
#define STORE_STRING(_pBuf, _string) \
{ \
- int _len = _string ? strlen (_string) : 0; \
+ int _len = strlen(_string); \
STORE_CARD16 (_pBuf, _len); \
if (_len) { \
memcpy (_pBuf, _string, _len); \
@@ -182,6 +181,8 @@ typedef struct {
char *error;
} GetProxyAddrReply;
+#if 0
+#else
static int findproxy (proxyname, manager, server, name)
char* proxyname;
char* manager;
@@ -292,7 +293,7 @@ static int findproxy (proxyname, manager, server, name)
}
return 1;
}
-
+#endif
static void
@@ -326,8 +327,10 @@ Bool *replyReadyRet;
GetProxyAddrReply *reply =
(GetProxyAddrReply *) (replyWait->reply);
+#if 0 /* No-op */
CHECK_AT_LEAST_SIZE (iceConn, PMOPCODE, opcode,
length, SIZEOF (pmGetProxyAddrReplyMsg), IceFatalToProtocol);
+#endif
IceReadCompleteMessage (iceConn, SIZEOF (pmGetProxyAddrReplyMsg),
pmGetProxyAddrReplyMsg, pMsg, pStart);
diff --git a/rx/XUrls.c b/rx/XUrls.c
index ec1f7c1..105a805 100644
--- a/rx/XUrls.c
+++ b/rx/XUrls.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from
The Open Group.
*/
-/* $XFree86: xc/programs/xrx/rx/XUrls.c,v 1.11 2001/12/14 20:02:19 dawes Exp $ */
+/* $XFree86: xc/programs/xrx/rx/XUrls.c,v 1.12 2003/07/20 16:12:20 tsi Exp $ */
#include "RxI.h"
#include "XUrls.h"
@@ -142,7 +142,7 @@ MyBestHostname (
} else { /* otherwise believe the display_name */
char *ptr;
- ptr = strchr(display_name, ':');
+ ptr = strrchr(display_name, ':');
if (ptr == NULL) {
/* if there's no ":0" in the name, just copy it */
strncpy(myname, display_name, myname_len);
@@ -343,13 +343,21 @@ ParseHostname(char *url, char *buf, int buflen)
while (*ptr && *ptr == '/')
ptr++;
begin = ptr;
- /* look for possible port specification */
- ptr = strchr(begin, ':');
- if (ptr == NULL) {
- /* look for possible path */
- ptr = strchr(begin, '/');
- if (ptr == NULL)
- ptr += strlen(begin);
+ /* Check for RFC 2732 bracketed IPv6 numeric address */
+ if (*ptr == '[') {
+ begin++;
+ while (*ptr && (*ptr != ']')) {
+ ptr++;
+ }
+ } else {
+ /* look for possible port specification */
+ ptr = strchr(begin, ':');
+ if (ptr == NULL) {
+ /* look for possible path */
+ ptr = strchr(begin, '/');
+ if (ptr == NULL)
+ ptr += strlen(begin);
+ }
}
if (ptr - begin < buflen) {
strncpy(buf, begin, ptr - begin);