From d0721af92ab08fc526c7c432ecc6273717cecae0 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Tue, 25 Nov 2003 19:29:18 +0000 Subject: XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks --- choose.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'choose.c') diff --git a/choose.c b/choose.c index c5806f0..8abee3f 100644 --- a/choose.c +++ b/choose.c @@ -23,7 +23,7 @@ Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. ******************************************************************************/ -/* $XFree86: xc/programs/xsm/choose.c,v 1.5 2001/12/14 20:02:24 dawes Exp $ */ +/* $XFree86: xc/programs/xsm/choose.c,v 1.7 2003/07/20 16:12:21 tsi Exp $ */ #include "xsm.h" #include "saveutil.h" @@ -144,7 +144,12 @@ GetSessionNames(int *count_ret, String **short_names_ret, else { char *host = ((char *) strchr (id, '/')) + 1; - char *colon = (char *) strchr (host, ':'); + char *colon = (char *) strrchr (host, ':'); + + /* backtrack over previous colon if there are 2 (DECnet), + but not three (IPv6) */ + if ((*(colon - 1) == ':') && (*(colon - 2) != ':')) + colon--; *colon = '\0'; @@ -584,7 +589,6 @@ ChooseSessionBreakLockXtProc(Widget w, XtPointer client_data, } else { - char *id; int longest; XtVaSetValues (chooseSessionMessageLabel, @@ -593,7 +597,7 @@ ChooseSessionBreakLockXtProc(Widget w, XtPointer client_data, name = sessionNamesShort[current->list_index]; - id = GetLockId (name); + (void) GetLockId (name); UnlockSession (name); -- cgit v1.2.3