diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:03 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:03 +0000 |
commit | 09cf02b0457f774bd10574c0facf1df29fb83b53 (patch) | |
tree | 4114125647494b42fe91521f69cdaf0ee055d93a /parsedpy.c | |
parent | d013d0b3ecb18ae2f1c162c6a1db89c6b4f063d3 (diff) |
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'parsedpy.c')
-rw-r--r-- | parsedpy.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group. * Author: Jim Fulton, MIT X Consortium */ -/* $XFree86: xc/programs/xauth/parsedpy.c,v 3.6 2001/12/14 20:01:15 dawes Exp $ */ +/* $XFree86: xc/programs/xauth/parsedpy.c,v 3.8 2003/07/18 15:53:28 tsi Exp $ */ #include <stdio.h> /* for NULL */ #include <ctype.h> /* for isascii() and isdigit() */ @@ -111,10 +111,10 @@ parse_displayname (char *displayname, if (!displayname || !displayname[0]) return False; /* must have at least :number */ - ptr = strchr(displayname, ':'); + ptr = strrchr(displayname, ':'); if (!ptr || !ptr[1]) return False; - if (ptr[1] == ':') { - if (ptr[2] == '\0') return False; + if ((ptr != displayname) && (*(ptr - 1) == ':')) { + ptr--; dnet = True; } @@ -137,6 +137,10 @@ parse_displayname (char *displayname, family = FamilyInternet; } #endif + } else if (!dnet && (*displayname == '[') && (*(ptr - 1) == ']')) { + /* Allow RFC2732-like [<IPv6NumericAddress>]:display syntax */ + family = FamilyInternet6; + host = copystring (displayname + 1, len - 2); } else { host = copystring (displayname, len); if (dnet) { |